6 Module ZLIB
gullradriel edited this page 2026-10-29 20:54:40 +01:00

ZLIB: shortcuts to easy compress/decompress data

Functions

Name
N_STR * zip_nstr(N_STR * src)
Return a compressed version of src.
N_STR * unzip_nstr(N_STR * src)
Return an uncompressed version of src.
size_t UncompressData(unsigned char * abSrc, size_t nLenSrc, unsigned char * abDst, size_t nLenDst)
Uncompress a string to another.
size_t GetMaxCompressedLen(size_t nLenSrc)
Return the maximum compressed size.
size_t CompressData(unsigned char * abSrc, size_t nLenSrc, unsigned char * abDst, size_t nLenDst)
Compress a string to another.

Functions Documentation

function zip_nstr

N_STR * zip_nstr(
    N_STR * src
)

Return a compressed version of src.

Parameters:

  • src The source string

Return: The compressed string or NULL

return a compressed version of src

Return a compressed version of src.

function unzip_nstr

N_STR * unzip_nstr(
    N_STR * src
)

Return an uncompressed version of src.

Parameters:

  • src The source string

Return: The uncompressed string or NULL

return an uncompressed version of src

Return an uncompressed version of src.

function UncompressData

size_t UncompressData(
    unsigned char * abSrc,
    size_t nLenSrc,
    unsigned char * abDst,
    size_t nLenDst
)

Uncompress a string to another.

Parameters:

  • abSrc source string
  • nLenSrc size of source string
  • abDst destination string
  • nLenDst destination length

Return: 0 or length of output

function GetMaxCompressedLen

size_t GetMaxCompressedLen(
    size_t nLenSrc
)

Return the maximum compressed size.

Parameters:

  • nLenSrc The uncompressed source data length in bytes

Return: The size in bytes

function CompressData

size_t CompressData(
    unsigned char * abSrc,
    size_t nLenSrc,
    unsigned char * abDst,
    size_t nLenDst
)

Compress a string to another.

Parameters:

  • abSrc source string
  • nLenSrc size of source string
  • abDst destination string
  • nLenDst destination length

Return: 0 or length of output