Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

# Generic Bit-Buffer Structure and Function Library (bitbuf.c)
[General Libraries]

## Detailed Description

     #include "bitbuf.h"

Overview
  This bit-buffer structure provides an easy and efficient way to store and process bits. You can create as many bit buffers as you like (within memory limits), and then use this common set of functions to access each buffer. Supported functions include sequential getting and storing of bits, array-like get, buffer flush (dump data), and reset-to-beginning. This buffer is not dynamically allocated, it has a user-defined fixed maximum size.

## Data Structures
struct | struct_BitBuf
## Typedefs
typedef struct_BitBuf | BitBuf
## Functions
void | bitbufInit (BitBuf *bitBuffer, unsigned char *start, unsigned short bytesize)
| initialize a buffer to start at a given address and have given size
unsigned char | bitbufGet (BitBuf *bitBuffer)
| get the bit at the current position in the buffer
unsigned char | bitbufGetAtIndex (BitBuf *bitBuffer, unsigned short bitIndex)
| get a bit at the specified index in the buffer (kind of like array access)
void | bitbufStore (BitBuf *bitBuffer, unsigned char bit)
| store a bit at the current position in the buffer
unsigned short | bitbufGetDataLength (BitBuf *bitBuffer)
| return the number of bits in the buffer
void | bitbufReset (BitBuf *bitBuffer)
| resets the read/write position of the buffer to beginning
void | bitbufFlush (BitBuf *bitBuffer)
| flush (clear) the contents of the buffer