#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <memory.h>
#include "desc.h"
#include "bufr.h"
#include "bitio.h"
Go to the source code of this file.
Functions | |
| int | bitio_i_open (void *buf, size_t size) |
| This function opens a bitstream for input. | |
| int | bitio_i_input (int handle, unsigned long *val, int nbits) |
| This function reads a value from a bitstream. | |
| void | bitio_i_close (int handle) |
| Closes an bitstream that was opened for input. | |
| int | bitio_o_open () |
| Opens a bitstream for output. | |
| long | bitio_o_append (int handle, unsigned long val, int nbits) |
| This function appends a value to a bitstream. | |
| void | bitio_o_outp (int handle, unsigned long val, int nbits, long bitpos) |
| This function outputs a value to a specified position of a bitstream. | |
| size_t | bitio_o_get_size (int handle) |
| Returns the size of an output-bitstream (number of bytes). | |
| void * | bitio_o_close (int handle, size_t *nbytes) |
| This function closes an output-bitstream. | |
Input from a bit-stream must be as follows:
h = bitio_i_open (); open a bitstream for input
bitio_i_input (); read a value from the bitstream
bitio_i_close (); close the bitstream
More details can be found at the description of the functions. Note that the buffer holding the bitstream is organized as an array of characters. So the functions are independent from the computer-architecture (byte-swapping).
Definition in file bitio.c.
1.5.4