[Cosm Logo]

Data Compression Functions


v3CompressInit

Syntax

#include "compress.h"
s32 v3CompressInit( v3_BUFFER * output, v3_COMPRESS_TMP * tmp,
  u32 type, u32 level );

Description

Initialize the output buffer and setup the temporary data needed to perform the type of compression specified by type. level is a number ranging from 1 to 9 representing the amount of compression to attempt, 1 being fast, 9 being intensive.

Types of Compression:

V3_COMPRESS_BZIP2
bzip2 compression.

Return Values

V3_PASS on success, or an error code on failure.

Errors

None.

Example




    

v3Compress

Syntax

#include "compress.h"
s32 v3Compress( v3_BUFFER * output, v3_COMPRESS_TMP * tmp,
  const void * const data, u64 length );

Description

Feed length bytes of data into the compression routines. Any compressed data will be placed into the output buffer but may not be put into the output buffer after every call.

Note: Make sure your data is in big endian format before using.

Return Values

V3_PASS on success, or an error code on failure.

Errors

None.

Example




    

v3CompressEnd

Syntax

#include "compress.h"
s32 v3CompressEnd( v3_BUFFER * output, v3_COMPRESS_TMP * tmp );

Description

Clear any temporary data and put the last of the compressed data into the buffer. Make sure to empty and v3BufferFree the output buffer of your data after calling this function.

Return Values

V3_PASS on success, or an error code on failure.

Errors

None.

Example




    

v3DecompressInit

Syntax

#include "compress.h"
s32 v3DecompressInit( v3_BUFFER * output, v3_COMPRESS_TMP * tmp,
  u32 type );

Description

Initialize the output buffer and setup the temporary data needed to perform the type of decompression specified by type. See v3CompressInit for the types of compression.

Return Values

V3_PASS on success, or an error code on failure.

Errors

None.

Example




    

v3Decompress

Syntax

#include "compress.h"
s32 v3Decompress( v3_BUFFER * output, v3_COMPRESS_TMP * tmp,
  const void * const data, u64 length );

Description

Feed length bytes of data into the decompression routines. Any decompressed data will be placed into the output buffer but may not be put into the output buffer after every call.

Return Values

V3_PASS on success, or an error code on failure.

Errors

None.

Example




    

v3DecompressEnd

Syntax

#include "compress.h"
s32 v3DecompressEnd( v3_BUFFER * output, v3_COMPRESS_TMP * tmp );

Description

Clear any temporary data and put the last of the decompressed data into the buffer. Make sure to empty and v3BufferFree the output buffer of your data after calling this function.

Return Values

V3_PASS on success, or an error code on failure.

Errors

None.

Example





© Copyright Mithral Communications & Design, Inc. 1999. All rights reserved. Mithral(tm) and Cosm(tm) are trademarks of Mithral Communications & Design, Inc.
Document last modified: