Definition in file dernc.c.
#include "lbfileio.h"
#include "dernc.h"
#include "globals.h"
Go to the source code of this file.
Defines | |
#define | INTERNAL |
#define | HUFTABLE_ENTRIES 32 |
Functions | |
void | bitread_init (bit_stream *bs, const unsigned char **p, const unsigned char *pend) |
Initialises a bit stream with the first two bytes of the packed data. | |
void | bitread_fix (bit_stream *bs, const unsigned char **p, const unsigned char *pend) |
Fixes up a bit stream after literals have been read out of the data stream. | |
unsigned long | bit_peek (bit_stream *bs, const unsigned long mask) |
Returns some bits, masked with given bit mask. | |
void | bit_advance (bit_stream *bs, int n, const unsigned char **p, const unsigned char *pend) |
Advances the bit stream. | |
char * | rnc_error (long errcode) |
Returns an error string corresponding to an error code. | |
long | rnc_ulen (void *packed) |
Return the uncompressed length of a packed data block. | |
long | rnc_plen (void *packed) |
Return the compressed length of a packed data block. | |
long | rnc_nocallback (long done, long total) |
Empty callback - for use if no callback is needed. | |
long | rnc_printcallback (long done, long total) |
Console print callback - for use in console tools. | |
long | rnc_unpack (const void *packed, void *unpacked, const unsigned int flags) |
Decompress a packed data block. | |
long | rnc_crc (const void *data, unsigned long len) |
Calculate a CRC, the RNC way. |
void bit_advance | ( | bit_stream * | bs, | |
int | n, | |||
const unsigned char ** | p, | |||
const unsigned char * | pend | |||
) | [inline] |
Advances the bit stream.
Reads n bits from the bit_stream, then makes sure there are still at least 16 bits to read in next operation. The new bits are taken from buffer *p. Checks pend for proper buffer pointers range. The pend should point to the last readable byte in buffer.
Definition at line 653 of file dernc.c.
Referenced by rnc_unpack().
unsigned long bit_peek | ( | bit_stream * | bs, | |
unsigned long | mask | |||
) | [inline] |
void bitread_fix | ( | bit_stream * | bs, | |
const unsigned char ** | p, | |||
const unsigned char * | pend | |||
) | [inline] |
Fixes up a bit stream after literals have been read out of the data stream.
Checks pend for proper buffer pointers range. The pend should point to the last readable byte in buffer.
Definition at line 619 of file dernc.c.
Referenced by rnc_unpack().
void bitread_init | ( | bit_stream * | bs, | |
const unsigned char ** | p, | |||
const unsigned char * | pend | |||
) | [inline] |
Initialises a bit stream with the first two bytes of the packed data.
Checks pend for proper buffer pointers range. The pend should point to the last readable byte in buffer. If buffer is exceeded, fills output (or part of output) with zeros.
Definition at line 598 of file dernc.c.
Referenced by rnc_unpack().
long rnc_crc | ( | const void * | data, | |
unsigned long | len | |||
) |
Calculate a CRC, the RNC way.
data | The data buffer. | |
len | data Length of the data buffer. |
Definition at line 715 of file dernc.c.
Referenced by rnc_unpack().
char* rnc_error | ( | long | errcode | ) |
Returns an error string corresponding to an error code.
errcode | Error code returned by a function. |
Definition at line 272 of file dernc.c.
Referenced by memfile_error().
long rnc_nocallback | ( | long | done, | |
long | total | |||
) |
long rnc_plen | ( | void * | packed | ) |
Return the compressed length of a packed data block.
The packed buffer must be longer than SIZEOF_RNC_HEADER.
packed | Packed buffer. |
Definition at line 316 of file dernc.c.
Referenced by memfile_read().
long rnc_printcallback | ( | long | done, | |
long | total | |||
) |
long rnc_ulen | ( | void * | packed | ) |
Return the uncompressed length of a packed data block.
The packed buffer must be longer than SIZEOF_RNC_HEADER.
packed | Packed buffer. |
Definition at line 301 of file dernc.c.
Referenced by memfile_read().
long rnc_unpack | ( | const void * | packed, | |
void * | unpacked, | |||
const unsigned int | flags | |||
) |
Decompress a packed data block.
packed | Packed source data buffer. | |
unpacked | Unpacked destination data buffer. | |
flags | Option flags for the decompressor. |
Definition at line 351 of file dernc.c.
Referenced by memfile_read().