|
LibBitbuf is a simple library written in C to write bit-a-bit or byte-a-byte to files and other streams. LibBitbuf provides an easy to use interface, very similar to stdio, so that everyone should be able to start using it very quickly. The code is written to be portable, however Libbitbuf only works on little endian architectures. This is a very simple example: int main(int argc,char**argv){ bitbuf buf; FILE*fout,*fout2,*fin; unsigned long int res=100; unsigned char c=2; if((fout=fopen(argv[1],"wb"))==NULL) {perror("fopen");exit(3);} if(binit(&buf,64,fout,1)<0) {perror("binit");exit(7);} bytewrite(&buf,sizeof(unsigned long int),&res); bitwrite(&buf,2,c); bflush(&buf); fclose(fout); } For more informations read bitbuf.h. libbitbuf 0.1 sources |
| ABOUT ME |
| PROJECTS |
|
|