Module index

source download

Module: zlib.lsp

Functions for compression/decompression with zlib

Version: 1.1 - comments redone for automatic documentation
Version: 1.2 - new library detection routine
Version: 1.3 - added lib for opnBSD and tested for 64-bit newLISP
Version: 1.4 - doc changes
Version: 1.5 - replaced write-buffer with write
Version: 1.6 - removed broken squeeze and unsqueeze functions.
Version: 1.7 - added library for CentOS 6 Linux
Version: 1.71 - added library for Ubuntu Linux 12.04 and 13.04
Version: 1.72 - swap else-less 'if' for 'when'
Version: 1.73 changes references to /usr/ to /usr/local/
Version: 1.74 library path additions
Author: L.M 2006-2016

Functions for compression/decompression with zlib

For this module a platform sepcific library from www.zib.net is needed.

The module offers two compression/decompression support as GZ compatible file compression and decompression.

Before using the module it must be loaded:
 (load "/usr/local/share/newlisp/modules/zlib.lsp")
 ; or shorter
 (module "zlib.lsp")



syntax: (zlib:gz-read-file str-file-name)

return: A string buffer with the original contents.

Uncompresses the GZ compressed file in str-file-name. Example:
 (set 'buff (zlib:gz-read-file "myfile.gz"))



syntax: (zlib:gz-write-file str-file-name str-buffer)

return: The number of bytes in str-buffer.

Does a GZ compatible comrpression of a buffer in str-buffer and writes it to the file in str-file-name. Example:
 (zlib:gz-write-file "myfile.gz" buff) 

- ∂ -

generated with newLISP  and newLISPdoc