Go to the source code of this file.
|
| bmz_init () |
| Perform bmz initialization only needs to be called once, mostly for sanity checks. More...
|
|
| bmz_pack (const void *in, size_t in_len, void *out, size_t *out_len_p, size_t offset, size_t fp_len, unsigned flags, void *work_mem) |
| Perform bmz compression. More...
|
|
| bmz_unpack (const void *in, size_t in_len, void *out, size_t *out_len_p, void *work_mem) |
| Perform bmz decompression. More...
|
|
| bmz_pack_buflen (size_t in_len) |
| Compute bmz compression output buffer length. More...
|
|
| bmz_pack_worklen (size_t in_len, size_t fp_len) |
| Return size of work memory for bmz compression. More...
|
|
| bmz_unpack_worklen (size_t out_len) |
| Return size of work memory for bmz decompression. More...
|
|
| bmz_set_verbosity (int verbosity) |
| Set the verbosity of library for testing and debugging. More...
|
|
| bmz_set_out_proc (BmzOutProc proc) |
| Set messaging/logging procedure. More...
|
|
| bmz_set_die_proc (BmzDieProc proc) |
| Set fatal message procedure. More...
|
|
| bmz_checksum (const void *in, size_t in_len) |
| A fast checksum (adler32) function that might be useful. More...
|
|
| bmz_update_checksum (unsigned s, const void *in, size_t in_len) |
|
Definition at line 33 of file bmz.h.
#define BMZ_E_INPUT_OVERRUN (-4) |
Definition at line 34 of file bmz.h.
Definition at line 32 of file bmz.h.
#define BMZ_E_OUTPUT_OVERRUN (-5) |
Definition at line 35 of file bmz.h.
Definition at line 26 of file bmz.h.
Definition at line 27 of file bmz.h.
#define BMZ_VER_NUM 0x0110 |
Definition at line 25 of file bmz.h.
Definition at line 29 of file bmz.h.
Definition at line 28 of file bmz.h.
typedef void(* BmzDieProc)(const char *msg) HT_NORETURN |
Signature of the fatal procedure.
Definition at line 121 of file bmz.h.
typedef void(* BmzOutProc)(const char *msg, size_t len) |
Signature of the messaging/logging procedure.
Definition at line 117 of file bmz.h.
bmz_checksum |
( |
const void * |
in, |
|
|
size_t |
in_len |
|
) |
| |
A fast checksum (adler32) function that might be useful.
- Parameters
-
in | - input buffer |
in_len | - input buffer length in bytes |
Definition at line 1473 of file bmz.c.
Perform bmz initialization only needs to be called once, mostly for sanity checks.
Definition at line 1445 of file bmz.c.
bmz_pack |
( |
const void * |
in, |
|
|
size_t |
in_len, |
|
|
void * |
out, |
|
|
size_t * |
out_len_p, |
|
|
size_t |
offset, |
|
|
size_t |
fp_len, |
|
|
unsigned |
flags, |
|
|
void * |
work_mem |
|
) |
| |
Perform bmz compression.
- Parameters
-
in | - input buffer |
in_len | - input buffer length in bytes |
out | - output buffer for compressed data |
out_len_p | - pointer to the length of output, which specifies the size of the output buffer as input and is set to the length of compressed data on return |
offset | - starting offset of fingerprints, use 0 if you have to ask |
fp_len | - fingerprint length, use 50 if you have to ask |
flags | - compression options. See BMZ_F_* defines. |
work_mem | - pointer to work memory buffer, cf. bmz_pack_worklen |
- Returns
- error code
Definition at line 1254 of file bmz.c.
bmz_pack_buflen |
( |
size_t |
in_len | ) |
|
Compute bmz compression output buffer length.
- Parameters
-
in_len | - input buffer length in bytes |
- Returns
- output length in bytes
Definition at line 1164 of file bmz.c.
bmz_pack_worklen |
( |
size_t |
in_len, |
|
|
size_t |
fp_len |
|
) |
| |
Return size of work memory for bmz compression.
So we don't have to allocate memory per invocation when the input buffer size is fixed.
- Parameters
-
in_len | - input buffer length in bytes |
fp_len | - fingerprint length in bytes |
- Returns
- length in bytes
Definition at line 1186 of file bmz.c.
Set fatal message procedure.
- Parameters
-
proc | - pointer to a fatal function |
- Returns
- old proc
Set messaging/logging procedure.
- Parameters
-
proc | - pointer to a message function |
- Returns
- old proc
Definition at line 253 of file bmz.c.
bmz_set_verbosity |
( |
int |
verbosity | ) |
|
Set the verbosity of library for testing and debugging.
- Parameters
-
- Returns
- old verbosity
Definition at line 246 of file bmz.c.
bmz_unpack |
( |
const void * |
in, |
|
|
size_t |
in_len, |
|
|
void * |
out, |
|
|
size_t * |
out_len_p, |
|
|
void * |
work_mem |
|
) |
| |
Perform bmz decompression.
- Parameters
-
in | - input buffer (compressed) |
in_len | - input buffer length in bytes |
out | - output buffer |
out_len_p | - pointer to the length of output, which specifies the size of the output buffer and is set to length of uncompressed data on return; |
work_mem | - pointer to work memory buffer, cf. bmz_unpack_worklen |
- Returns
- error code
Definition at line 1280 of file bmz.c.
bmz_unpack_worklen |
( |
size_t |
out_len | ) |
|
Return size of work memory for bmz decompression.
- Parameters
-
out_len | - work memory length in bytes |
- Returns
- length in bytes
Definition at line 1192 of file bmz.c.
bmz_update_checksum |
( |
unsigned |
s, |
|
|
const void * |
in, |
|
|
size_t |
in_len |
|
) |
| |