Introduction
This library provides tools for reading, writing and manipulating bdio files (bdio.pdf). These are binary files, structured into records, which contain a thin layer of meta-data each. This meta-data allows to keep the files machine independent and browsable, while maintaining the advantages of raw binary I/O, i.e. minimal file-size and decent speed.
Dependencies
The library should compile on standard UNIX systems with standard C99 compilers.
It depends on the standard C library, in particular
- stdio.h
- stdint.h (C99)
- stdlib.h
- string.h
- time.h
- errno.h
Furthermore the C POSIX library is needed
- unistd.h
- sys/types.h
- sys/socket.h
- netdb.h
- pwd.h
Compilation
- Copy the source code to some folder
- Edit the Makefile. Adjust the line
CC=gcc -pedantic -fstrict-aliasing -Wall -Wno-long-long -Werror]
to your liking. A strict standard "-std=c99" cannot be enforced due to the requirement of posix extensions, but something like CC=gcc -D_POSIX_C_SOURCE=200112L -std=c99 ...
might work.
- Run make. The library that your application will need to link to should appear in build/libbdio.a
- Your application needs to include bdio.h and be compiled with e.g.
gcc yourapp.c -L <bdio_path>/build/ -I <bdio_path>/include -lbdio
Examples
A very simple application is ex0.c
#include <stdlib.h>
int main(int argc, char *argv[])
{
int x[5] = {1,2,3,4,5};
fh =
bdio_open(
"ex0.bdio",
"w",
"protocol info goes here" );
return( EXIT_SUCCESS );
}
Further simple programs using bdio can be found here