Slim numerical data compression 1.0
|
Implements the classes slim_compressor_t and slim_expander_t. More...
#include <iostream>
#include <iomanip>
#include <cassert>
#include <climits>
#include <stdexcept>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <utime.h>
#include "slim.h"
#include "bitstream.h"
Enumerations | |
enum | section_foot_markers_t { NOT_LAST_SECTION = 0x8, LAST_SECTION = 0xf, BITS_SECTION_FOOT = 4 } |
Markers at the end of sections to tell whether more follow. More... | |
Functions | |
static void | verify_twos_complement () |
Fail an assertion if this is NOT a TWOS-COMPLEMENT machine. | |
int | alter_mtime (const char *filename, time_t mtime) |
Alter the access and modification time on a closed file. |
Implements the classes slim_compressor_t and slim_expander_t.
They are used respectively for compressing raw data (from memory to file) and restoring it from compressed (slim) form (file to memory).
int alter_mtime | ( | const char * | filename, |
time_t | mtime | ||
) | [inline] |
Alter the access and modification time on a closed file.
filename | The file to alter. |
mtime | The new value for filename's atime and mtime. |
static void verify_twos_complement | ( | ) | [inline, static] |
Fail an assertion if this is NOT a TWOS-COMPLEMENT machine.
The program assumes throughout that it's on a twos-complement machine. Failing these assertions means that this is NOT. It might either be a ones-complement machine (recogize when i and ~i are negatives of each other) or a sign-bit machine (recognize when i and -i differ only in the highest bit).