Menu

zlib-prototype

Marian Edu

zlib-prototype.p

Function prototypes for zlib library written by Jean-loup Gailly - http://www.zlib.net/

If the zlib library is not already available on the system default libraries path you can set the full path to the downloaded library by using ZLIB_LIB preprocessor.

Summary

zlib-prototype.pFunction prototypes for zlib library written by Jean-loup Gailly - http://www.zlib.net/

Preprocessors

ZLIB_LIBThe full path to the Zlib shared library (.dll for Windows, .so for *nix) .

Procedures

compressCompresses the data from input buffer into destination memory buffer that will hold the compressed data.
uncompressUncompresses the data from input buffer into destination memory buffer that will hold the uncompressed data.
compressBoundReturn the minimum buffer allocation size for holding compressed data for given input buffer size.
gzopenOpen gzip file for read/write.
gzcloseClose the gzip file pointer.
gzreadRead from gzip file in a allocated memory buffer.
gzputsWrite uncompressed string to a gzip file; need to be open with ‘w’ or ‘a.
gzwriteWrite uncompressed data from a memory buffer to a gzip file.

Preprocessors

ZLIB_LIB

The full path to the Zlib shared library (.dll for Windows, .so for *nix) .

Procedures

compress

procedure compress external {&ZLIB_LIB} cdecl persistent

Compresses the data from input buffer into destination memory buffer that will hold the compressed data.

Parameters

  • output buffer for compressed data.
  • size of output buffer, will be updated on call
  • input buffer with uncompressed data
  • size of input buffer

Returns

return code, 0 if OK

uncompress

procedure uncompress external {&ZLIB_LIB} cdecl persistent

Uncompresses the data from input buffer into destination memory buffer that will hold the uncompressed data.

Parameters

  • output buffer for uncompressed data.
  • size of output buffer, will be updated on call
  • input buffer with compressed data
  • size of input buffer

Returns

return code, 0 if OK

compressBound

procedure compressBound external {&ZLIB_LIB} cdecl persistent

Return the minimum buffer allocation size for holding compressed data for given input buffer size.

Parameters

Input uncompressed data length

Returns

minimum buffer allocation for compress buffer

gzopen

procedure gzopen external {&ZLIB_LIB} cdecl persistent

Open gzip file for read/write.

Parameters

  • file pathname, must exists for read/append
  • open mode: read ®, write (w), append (a)

Returns

gzip file pointer, 0 if error

gzclose

procedure gzclose external {&ZLIB_LIB} cdecl persistent

Close the gzip file pointer.

Parameters

gzip file pointer

Returns

0 if OK, else error code

gzread

procedure gzread external {&ZLIB_LIB} cdecl persistent

Read from gzip file in a allocated memory buffer.

Parameters

  • gzip file pointer
  • output buffer for uncompressed data
  • size of output buffer

Returns

number of bytes read, less than buffer size if eof, -1 if error

gzputs

procedure gzputs external {&ZLIB_LIB} cdecl persistent

Write uncompressed string to a gzip file; need to be open with ‘w’ or ‘a.

Parameters

  • gzip file pointer
  • uncompressed data to write

Returns

number of characters written, -1 on error

gzwrite

procedure gzwrite external {&ZLIB_LIB} cdecl persistent

Write uncompressed data from a memory buffer to a gzip file.

Parameters

  • gzip file pointer
  • uncompressed data buffer
  • uncompressed buffer length

Returns

written compressed data length, 0 if error


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.