Slim numerical data compression  1.0
bitstream.cpp File Reference
#include <cstdlib>
#include <cassert>
#include <climits>
#include <cstring>
#include <cerrno>
#include <iostream>
#include "bitstream.h"
#include "slim.h"

Detailed Description

Implement the abstract base class bitstream and derived classes ibitstream and obitstream, for i/o of data with access to an arbitrary (integer) number of bits at a time.

slim_expander_t
slimlib_file_t::bytes_used
long bytes_used
How many bytes read/written so far.
Definition: slimlib.cpp:48
slim_compressor_t
slimtell
long slimtell(SLIMFILE *sf)
Return the current position in the file (bytes from the start).
Definition: slimlib.cpp:127
slimrewind
void slimrewind(SLIMFILE *sf)
Rewind the current position pointer in the file to the beginning.
Definition: slimlib.cpp:159
slimlib_file_t::writing_is_underway
int writing_is_underway
If in _WRITE mode, did we start writing?
Definition: slimlib.cpp:45
slimlib_mode_t
slimlib_mode_t
Select the read/write mode.
Definition: slimlib.cpp:28
SLIMLIB_READ
@ SLIMLIB_READ
This SLIMFILE object is for reading slim data.
Definition: slimlib.cpp:29
slimread
size_t slimread(void *ptr, size_t size, size_t nmemb, SLIMFILE *sf)
Read bytes from open SLIMFILE into a buffer.
Definition: slimlib.cpp:140
SLIMFILE
struct slimlib_file_t SLIMFILE
The external name is SLIMFILE.
Definition: slimlib.cpp:35
slimopen
SLIMFILE * slimopen(const char *filename, const char *modes)
The following symbols need to be linkable from C.
Definition: slimlib.cpp:68
slimseek
int slimseek(SLIMFILE *sf, long offset, int whence)
Seek to a point in the file (analogue of fseek, which see for meaning of offset and whence).
Definition: slimlib.cpp:176
slimclose
int slimclose(SLIMFILE *sf)
Close an open SLIMFILE.
Definition: slimlib.cpp:110
SLIMLIB_WRITE
@ SLIMLIB_WRITE
This SLIMFILE object is for writing slim data.
Definition: slimlib.cpp:30
slimlib_file_t::filename
char * filename
Remember the filename that was opened.
Definition: slimlib.cpp:52
slimlib_file_t::nframes
int nframes
How many frames expected per section.
Definition: slimlib.cpp:47
slimlib_file_t::expander
struct slim_expander_t * expander
Expander, for _READ mode.
Definition: slimlib.cpp:44
slimlib_file_t
All important elements of the SLIMFILE.
Definition: slimlib.cpp:41
slimlib_file_t::mode
enum slimlib_mode_t mode
Mode (SLIMLIB_READ or SLIMLIB_WRITE)
Definition: slimlib.cpp:42
slimlib_file_t::compressor
struct slim_compressor_t * compressor
Compressor, for _WRITE mode.
Definition: slimlib.cpp:43
slimlib_file_t::nchan
int nchan
How many channels are known?
Definition: slimlib.cpp:46
slimrawsize
long slimrawsize(const char *filename)
Return the raw size of a compressed slim file.
Definition: slimlib.cpp:210