Bitfile
0.9.2
Bit stream file I/O library
|
Bit file stream library header. More...
#include <stdio.h>
Go to the source code of this file.
Typedefs | |
typedef struct bit_file_t | bit_file_t |
This is shorthand for struct bit_file_t, the of the structure that is used to access all bitfiles. It is analogous to FILE. | |
Enumerations | |
enum | BF_MODES { BF_READ = 0, BF_WRITE = 1, BF_APPEND = 2, BF_NO_MODE } |
This is an enumeration of the bit file modes (read, write, and append) More... | |
Functions | |
bit_file_t * | BitFileOpen (const char *fileName, const BF_MODES mode) |
This function opens a bit file for reading, writing, or appending. More... | |
bit_file_t * | MakeBitFile (FILE *stream, const BF_MODES mode) |
This function naively wraps a standard file in a bit_file_t structure. More... | |
int | BitFileClose (bit_file_t *stream) |
This function closes a bit file and frees all associated data. More... | |
FILE * | BitFileToFILE (bit_file_t *stream) |
This function flushes and frees the bitfile structure, returning a pointer to a stdio file corresponding to the bitfile. More... | |
int | BitFileByteAlign (bit_file_t *stream) |
This function aligns the bitfile to the nearest byte. More... | |
int | BitFileFlushOutput (bit_file_t *stream, const unsigned char onesFill) |
This function flushes an output bit buffer. More... | |
int | BitFileGetChar (bit_file_t *stream) |
This function returns the next byte from the file passed as a parameter. More... | |
int | BitFilePutChar (const int c, bit_file_t *stream) |
This function writes the byte passed as a parameter to the file passed a parameter. More... | |
int | BitFileGetBit (bit_file_t *stream) |
This function returns the next bit from the file passed as a parameter. More... | |
int | BitFilePutBit (const int c, bit_file_t *stream) |
This function writes the bit passed as a parameter to the file passed a parameter. More... | |
int | BitFileGetBits (bit_file_t *stream, void *bits, const unsigned int count) |
This function reads the specified number of bits from the file passed as a parameter. More... | |
int | BitFilePutBits (bit_file_t *stream, void *bits, const unsigned int count) |
This function writes the specified number of bits from the memory location passed as a parameter to the file passed as a parameter. More... | |
int | BitFileGetBitsNum (bit_file_t *stream, void *bits, const unsigned int count, const size_t size) |
This function provides a machine independent layer that allows a single function call to stuff an arbitrary number of bits into an integer type variable. More... | |
int | BitFilePutBitsNum (bit_file_t *stream, void *bits, const unsigned int count, const size_t size) |
This function provides a machine independent layer that allows a single function call to write an arbitrary number of bits from an integer type variable into a file. More... | |
Bit file stream library header.
This file provides definitions and prototypes for a simple library of I/O functions for files that contain data in sizes that aren't integral bytes. An attempt was made to make the functions in this library analogous to functions provided to manipulate byte streams. The functions contained in this library were created with compression algorithms in mind, but may be suited to other applications.
enum BF_MODES |