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"
|
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).
◆ section_foot_markers_t
Markers at the end of sections to tell whether more follow.
Enumerator |
---|
NOT_LAST_SECTION | Marker for all non-final sections in file.
|
LAST_SECTION | Marker for the last section in a file.
|
BITS_SECTION_FOOT | Number of bits to write for sect. foot markers.
|
◆ alter_mtime()
int alter_mtime |
( |
const char * | filename, |
|
|
time_t | mtime ) |
|
inline |
Alter the access and modification time on a closed file.
- Parameters
-
filename | The file to alter. |
mtime | The new value for filename's atime and mtime. |
- Returns
- Returns 0 on success or -1 on error (and errno is set).
◆ verify_twos_complement()
static void verify_twos_complement |
( |
| ) |
|
|
inlinestatic |
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).