Data Compression Functionsv3CompressInitSyntax#include "compress.h" s32 v3CompressInit( v3_BUFFER * output, v3_COMPRESS_TMP * tmp, u32 type, u32 level ); DescriptionInitialize 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:
Return ValuesV3_PASS on success, or an error code on failure. ErrorsNone. Examplev3CompressSyntax#include "compress.h" s32 v3Compress( v3_BUFFER * output, v3_COMPRESS_TMP * tmp, const void * const data, u64 length ); DescriptionFeed 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 ValuesV3_PASS on success, or an error code on failure. ErrorsNone. Examplev3CompressEndSyntax#include "compress.h" s32 v3CompressEnd( v3_BUFFER * output, v3_COMPRESS_TMP * tmp ); DescriptionClear 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 ValuesV3_PASS on success, or an error code on failure. ErrorsNone. Examplev3DecompressInitSyntax#include "compress.h" s32 v3DecompressInit( v3_BUFFER * output, v3_COMPRESS_TMP * tmp, u32 type ); DescriptionInitialize 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 ValuesV3_PASS on success, or an error code on failure. ErrorsNone. Examplev3DecompressSyntax#include "compress.h" s32 v3Decompress( v3_BUFFER * output, v3_COMPRESS_TMP * tmp, const void * const data, u64 length ); DescriptionFeed 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 ValuesV3_PASS on success, or an error code on failure. ErrorsNone. Examplev3DecompressEndSyntax#include "compress.h" s32 v3DecompressEnd( v3_BUFFER * output, v3_COMPRESS_TMP * tmp ); DescriptionClear 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 ValuesV3_PASS on success, or an error code on failure. ErrorsNone. Example
© Copyright Mithral Communications & Design, Inc. 1999.
All rights reserved.
Mithral(tm) and Cosm(tm) are trademarks of
Mithral Communications & Design, Inc.
|