Slim numerical data compression
1.0
|
#include <cstdlib>
#include <cassert>
#include <climits>
#include <cstring>
#include <cerrno>
#include <iostream>
#include "bitstream.h"
#include "slim.h"
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.
long bytes_used
How many bytes read/written so far.
Definition: slimlib.cpp:49
long slimtell(SLIMFILE *sf)
Return the current position in the file (bytes from the start).
Definition: slimlib.cpp:185
void slimrewind(SLIMFILE *sf)
Rewind the current position pointer in the file to the beginning.
Definition: slimlib.cpp:217
int writing_is_underway
If in _WRITE mode, did we start writing?
Definition: slimlib.cpp:46
SLIMFILE * slimdopen(int fd, const char *modes)
Associate SLIMFILE for reading or writing with an existing file descriptor But as of October 2009,...
Definition: slimlib.cpp:116
slimlib_mode_t
Select the read/write mode.
Definition: slimlib.cpp:29
@ SLIMLIB_READ
This SLIMFILE object is for reading slim data.
Definition: slimlib.cpp:30
size_t slimread(void *ptr, size_t size, size_t nmemb, SLIMFILE *sf)
Read bytes from open SLIMFILE into a buffer.
Definition: slimlib.cpp:198
struct slimlib_file_t SLIMFILE
The external name is SLIMFILE.
Definition: slimlib.cpp:36
SLIMFILE * slimopen(const char *filename, const char *modes)
The following symbols need to be linkable from C.
Definition: slimlib.cpp:70
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:237
int slimclose(SLIMFILE *sf)
Close an open SLIMFILE.
Definition: slimlib.cpp:164
@ SLIMLIB_WRITE
This SLIMFILE object is for writing slim data.
Definition: slimlib.cpp:31
int nframes
How many frames expected per section.
Definition: slimlib.cpp:48
struct slim_expander_t * expander
Expander, for _READ mode.
Definition: slimlib.cpp:45
All important elements of the SLIMFILE.
Definition: slimlib.cpp:42
enum slimlib_mode_t mode
Mode (SLIMLIB_READ or SLIMLIB_WRITE)
Definition: slimlib.cpp:43
struct slim_compressor_t * compressor
Compressor, for _WRITE mode.
Definition: slimlib.cpp:44
int fd
Remember the filename or file descriptor that was opened.
Definition: slimlib.cpp:53
int nchan
How many channels are known?
Definition: slimlib.cpp:47
long slimrawsize(const char *filename)
Return the raw size of a compressed slim file.
Definition: slimlib.cpp:273