PACK/UNPACK

Name

PACK/UNPACK --  Functions pack/unpack and compress/uncompress data or file.

Function

cResult             bUnZip2(<cData>)
cResult             bZip2(<cData> [,<nLevel>])
lRet                bZip2Close(<nHandle>)
nHandle             bZip2Open(<filename> [,<mode>])
realLen             bZip2Read(<nHandle>, <@cBuffer> [,<nLen>])
realLen             bZip2Write(<nHandle>, <cBuffer> [,<nLen>])
cResult             gUnZip(<cData>)
cResult             gZip(<cData> [,<nLevel>])
lRet                gZipClose(<nHandle>)
nHandle             gZipOpen(<filename> [,<mode>])
realLen             gZipRead(<nHandle>, <@cBuffer> [,<nLen>])
realLen             gZipWrite(<nHandle>, <cBuffer> [,<nLen>])

Description

Category Pack/Unpack include description of functions for pack/unpack and compress/uncompress data or file.

Library clip-gzip is wrapper to populiar gzip library, for using clip-gzip need linking: clip -e test.prg -lclip-gzip

Library clip-bzip2 is wrapper to populiar bzip2 library, for using clip-bzip2 need linking: clip -e test.prg -lclip-bzip2

Function BUNZIP2()

 bUnZip2(<cData>) --> cResult

Unompress string, compressed by bZip2().

Function BZIP2()

 bZip2(<cData> [,<nLevel>]) --> cResult

Compress string with given compression level (default 6).

Function BZIP2CLOSE()

 bZip2Close(<nHandle>) --> lRet

bZip2Close() must be called explicitly, to clear and sync all buffers.

Function BZIP2OPEN()

 bZip2Open(<filename> [,<mode>]) --> nHandle

Open bZIP2 file with name <filename> and mode <mode> , by default for reading. Possible modes: "rb" - binary read (no cr/lf translation) "wbX" - set compression level X in range 0 to 9

Function BZIP2READ()

 bZip2Read(<nHandle>, <@cBuffer> [,<nLen>]) --> realLen

Read and unpack data from opened bZIP2 file with <nHandle> into preallocated <cBuffer> <nLen> bytes.

Function BZIP2WRITE()

 bZip2Write(<nHandle>, <cBuffer> [,<nLen>]) --> realLen

Pack <len> bytes from <cBuffer> and write them to bZIP2-file.

Function GUNZIP()

 gUnZip(<cData>) --> cResult

Unompress string, compressed by gZip().

Function GZIP()

 gZip(<cData> [,<nLevel>]) --> cResult

Compress string with given compression level (default 6).

Function GZIPCLOSE()

 gZipClose(<nHandle>) --> lRet

gZipClose() must be called explicitly, to clear and sync all buffers.

Function GZIPOPEN()

 gZipOpen(<filename> [,<mode>]) --> nHandle

Open GZIP file with name <filename> and mode <mode> , by default for reading. Possible modes: "rb" - binary read (no cr/lf translation) "wbX" - set compression level X in range 0 to 9

Function GZIPREAD()

 gZipRead(<nHandle>, <@cBuffer> [,<nLen>]) --> realLen

Read and unpack data from opened GZIP file with <nHandle> into preallocated <cBuffer> <nLen> bytes.

Function GZIPWRITE()

 gZipWrite(<nHandle>, <cBuffer> [,<nLen>]) --> realLen

Pack <len> bytes from <cBuffer> and write them to GZIP-file.