Bz2 C Library Reference

Bz2

Provides the ability to create and unzip .bz2 compressed files using the BZip2 compression algorithm.

Create/Dispose

HCkBz2 CkBz2_Create(void);

Creates an instance of the CkBz2 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 CkBz2_Dispose(HCkBz2 handle);

Objects created by calling CkBz2_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 CkBz2_getLastErrorHtml(HCkBz2 cHandle, HCkString retval);

Error information in HTML format for the last method called.

void CkBz2_getLastErrorText(HCkBz2 cHandle, HCkString retval);

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

void CkBz2_getLastErrorXml(HCkBz2 cHandle, HCkString retval);

Error information in XML format for the last method called.

BOOL CkBz2_getUtf8(HCkBz2 cHandle);
void CkBz2_putUtf8(HCkBz2 cHandle, BOOL newVal);

To be documented soon...

C "Methods"

BOOL CkBz2_CompressFile(HCkBz2 cHandle, const char *inFilename, const char *outFilename);

Compresses a file to create a BZip2 compressed file (.bz2).

Returns TRUE for success, FALSE for failure.

BOOL CkBz2_CompressFileToMem(HCkBz2 cHandle, const char *inFilename, HCkByteData outBytes);

BZip2 compresses a file to an in-memory image of a .bz2 file.

BOOL CkBz2_CompressMemToFile(HCkBz2 cHandle, HCkByteData inData, const char *outFilename);

BZip2 compresses and creates a .bz2 file from in-memory data.

Returns TRUE for success, FALSE for failure.

BOOL CkBz2_CompressMemory(HCkBz2 cHandle, HCkByteData inData, HCkByteData outBytes);

Compresses in-memory data to an in-memory image of a .bz2 file.

BOOL CkBz2_SaveLastError(HCkBz2 cHandle, const char *filename);

Saves the last error information to an XML formatted file.

BOOL CkBz2_UncompressFile(HCkBz2 cHandle, const char *inFilename, const char *outFilename);

Unzips a .bz2 file.

Returns TRUE for success, FALSE for failure.

BOOL CkBz2_UncompressFileToMem(HCkBz2 cHandle, const char *inFilename, HCkByteData outBytes);

Unzips a .bz2 file directly to memory.

BOOL CkBz2_UncompressMemToFile(HCkBz2 cHandle, HCkByteData inData, const char *outFilename);

Unzips from an in-memory image of a .bz2 file to a file.

Returns TRUE for success, FALSE for failure.

BOOL CkBz2_UncompressMemory(HCkBz2 cHandle, HCkByteData inData, HCkByteData outBytes);

Unzips from an in-memory image of a .bz2 file directly into memory.

BOOL CkBz2_UnlockComponent(HCkBz2 cHandle, const char *regCode);

Unlocks the component allowing for the full functionality to be used. If a permanent (purchased) unlock code is passed, there is no expiration. Any other string automatically begins a fully-functional 30-day trial the first time UnlockComponent is called.

Returns TRUE for success, FALSE for failure.

Diagnosing UnlockComponent Problems

UnlockComponent LastErrorText shows exact string passed to it.

Verify UnlockComponent Success w/ Permanent Unlock Code

LastErrorText Standard Information

How UnlockComponent Works

const char *CkBz2_lastErrorHtml(HCkBz2 cHandle);

Error information in HTML format for the last method called.

Returns a null on failure

const char *CkBz2_lastErrorText(HCkBz2 cHandle);

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

Returns a null on failure

const char *CkBz2_lastErrorXml(HCkBz2 cHandle);

Error information in XML format for the last method called.

Returns a null on failure