ncompress42

Undocumented in source.

Members

Aliases

NCmpStreamReader
alias NCmpStreamReader = int function(ubyte* bytes, size_t numBytes, void* rwCtxt)

Used for emulating file reads, as the library is a port of ncompress. The function must return the number of bytes read, 0 if EoF (or end of datasteam) has reached, or -1 on errors. rwCtxt can contain filenames if they're applicable.

NCmpStreamWriter
alias NCmpStreamWriter = int function(const(ubyte)* bytes, size_t numBytes, void* rwCtxt)

Used for emulating file writes. It must return the number of files pushed, or -1 on error

Enums

NCompressError
enum NCompressError

Error codes, mainly from decompression.

Functions

nCompress
NCompressError nCompress(NCompressCtxt* ctxt)

Compresses the datasteam

nDecompress
NCompressError nDecompress(NCompressCtxt* ctxt)

Decompresses the datastream

nFreeCompress
void nFreeCompress(NCompressCtxt* ctxt)

Frees all buffers up.

nInitCompress
void nInitCompress(NCompressCtxt* ctxt, int bits)

Initialise for compression. Set the reader, writer and read-write context in the CompressCtxt struct. Then call initCompress() The bits parameter is only used when compressing. It sets the maximum size of a code word. The value must be in the range 9 to 16 or else zero to select the default of 16.

nInitDecompress
void nInitDecompress(NCompressCtxt* ctxt)

Initialise for decompression. Set the reader, writer and read-write context in the CompressCtxt struct. Then call initDecompress()

Structs

NCompressCtxt
struct NCompressCtxt

Used for storing function pointers and other contextual stuff.

Meta