UnixCompress C Library Reference

UnixCompress

UNIX (.Z) compression C library.

Create/Dispose

HCkUnixCompress CkUnixCompress_Create(void);

Creates an instance of the CkUnixCompress object and returns a handle (i.e. a "void *" pointer). The handle is passed in the 1st argument for the functions listed on this page.

void CkUnixCompress_Dispose(HCkUnixCompress handle);

Objects created by calling CkUnixCompress_Create must be freed by calling this method. A memory leak occurs if a handle is not disposed by calling this function.

C "Properties"

void CkUnixCompress_getLastErrorHtml(HCkUnixCompress cHandle, HCkString retval);

Error information in HTML format for the last method called.

void CkUnixCompress_getLastErrorText(HCkUnixCompress cHandle, HCkString retval);

Error information in plain-text format for the last method called.

void CkUnixCompress_getLastErrorXml(HCkUnixCompress cHandle, HCkString retval);

Error information in XML format for the last method called.

BOOL CkUnixCompress_getUtf8(HCkUnixCompress cHandle);
void CkUnixCompress_putUtf8(HCkUnixCompress cHandle, BOOL newVal);

When set to true, all "const char *" arguments are expected to be utf-8 strings. If set to false, the "const char *" arguments are expected to be ANSI strings.

C "Methods"

BOOL CkUnixCompress_CompressFile(HCkUnixCompress cHandle, const char *inFilename, const char *outFilename);

Compresses a file to create a UNIX compressed file (.Z). This compression uses the LZW (Lempel-Ziv-Welch) compression algorithm.

Returns TRUE for success, FALSE for failure.

BOOL CkUnixCompress_CompressFileToMem(HCkUnixCompress cHandle, const char *inFilename, HCkByteData outData);

Unix compresses a file to an in-memory image of a .Z file. (This compression uses the LZW (Lempel-Ziv-Welch) compression algorithm.)

BOOL CkUnixCompress_CompressMemToFile(HCkUnixCompress cHandle, HCkByteData db, const char *outFilename);

Unix compresses and creates a .Z file from in-memory data. (This compression uses the LZW (Lempel-Ziv-Welch) compression algorithm.)

Returns TRUE for success, FALSE for failure.

BOOL CkUnixCompress_CompressMemory(HCkUnixCompress cHandle, HCkByteData dbIn, HCkByteData outData);

Compresses in-memory data to an in-memory image of a .Z file. (This compression uses the LZW (Lempel-Ziv-Welch) compression algorithm.)

BOOL CkUnixCompress_CompressString(HCkUnixCompress cHandle, const char *inStr, const char *outCharset, HCkByteData outBytes);

To be documented soon...

BOOL CkUnixCompress_CompressStringToFile(HCkUnixCompress cHandle, const char *inStr, const char *outCharset, const char *outFilename);

To be documented soon...

BOOL CkUnixCompress_IsUnlocked(HCkUnixCompress cHandle);

Returns true if the component has been unlocked. (For ActiveX, returns 1 if unlocked.)

BOOL CkUnixCompress_SaveLastError(HCkUnixCompress cHandle, const char *filename);

Saves the last error information to an XML formatted file.

BOOL CkUnixCompress_UnTarZ(HCkUnixCompress cHandle, const char *zFilename, const char *destDir, BOOL bNoAbsolute);

Unpacks a .tar.Z file. The decompress and untar occur in streaming mode. There are no temporary files and the memory footprint is constant (and small) while untarring.

Returns TRUE for success, FALSE for failure.

BOOL CkUnixCompress_UncompressFile(HCkUnixCompress cHandle, const char *inFilename, const char *outFilename);

Uncompresses a .Z file. (This compression uses the LZW (Lempel-Ziv-Welch) compression algorithm.)

Returns TRUE for success, FALSE for failure.

BOOL CkUnixCompress_UncompressFileToMem(HCkUnixCompress cHandle, const char *inFilename, HCkByteData outData);

Uncompresses a .Z file directly to memory. (This compression uses the LZW (Lempel-Ziv-Welch) compression algorithm.)

BOOL CkUnixCompress_UncompressFileToString(HCkUnixCompress cHandle, const char *inFilename, const char *inCharset, HCkString outStr);

Uncompresses a .Z file that contains a text file. The contents of the text file are returned as a string. The character encoding of the text file is specified by charset. Typical charsets are "iso-8859-1", "utf-8", "windows-1252", "shift_JIS", "big5", etc.

List of Valid Charsets

BOOL CkUnixCompress_UncompressMemToFile(HCkUnixCompress cHandle, HCkByteData db, const char *outFilename);

Uncompresses from an in-memory image of a .Z file to a file. (This compression uses the LZW (Lempel-Ziv-Welch) compression algorithm.)

Returns TRUE for success, FALSE for failure.

BOOL CkUnixCompress_UncompressMemory(HCkUnixCompress cHandle, HCkByteData dbIn, HCkByteData outData);

Uncompresses from an in-memory image of a .Z file directly into memory. (This compression uses the LZW (Lempel-Ziv-Welch) compression algorithm.)

BOOL CkUnixCompress_UncompressString(HCkUnixCompress cHandle, HCkByteData inData, const char *inCharset, HCkString outStr);

To be documented soon...

BOOL CkUnixCompress_UnlockComponent(HCkUnixCompress cHandle, const char *unlockCode);

Unlocks the component allowing for the full functionality to be used.

Returns TRUE for success, FALSE for failure.

const char *CkUnixCompress_lastErrorHtml(HCkUnixCompress cHandle);

Error information in HTML format for the last method called.

Returns a null on failure

const char *CkUnixCompress_lastErrorText(HCkUnixCompress cHandle);

Error information in plain-text format for the last method called.

Returns a null on failure

const char *CkUnixCompress_lastErrorXml(HCkUnixCompress cHandle);

Error information in XML format for the last method called.

Returns a null on failure

const char *CkUnixCompress_uncompressFileToString(HCkUnixCompress cHandle, const char *inFilename, const char *inCharset);

Uncompresses a .Z file that contains a text file. The contents of the text file are returned as a string. The character encoding of the text file is specified by charset. Typical charsets are "iso-8859-1", "utf-8", "windows-1252", "shift_JIS", "big5", etc.

Returns a null on failure

List of Valid Charsets

const char *CkUnixCompress_uncompressString(HCkUnixCompress cHandle, HCkByteData inData, const char *inCharset);

To be documented soon...