📄 lzoapi.txt
字号:
============================================================================LZO -- a real-time data compression library LIBRARY REFERENCE============================================================================[ to be written - this is only a very first draft ][ please read LZO.FAQ first ]Table of Contents=================1 Introduction to the LZO Library Reference1.1 Preliminary notes1.2 Headers2 General2.1 The memory model2.2 Public integral types2.3 Public pointer types2.4 Public function types3 Function reference3.1 Initialization3.2 Compression3.3 Decompression3.4 Optimization3.5 String functions3.6 Checksum functions3.7 Version functions4 Variable reference1 Introduction to the LZO Library Reference=============================================1.1 Preliminary notes---------------------- `C90' is short for ISO 9899-1990, the ANSI/ISO standard for the C programming language1.2 Headers-----------This section briefly describes the headers.<lzoconf.h> Contains definitions for the basic integral and pointer types, provides wrappers for the library calling conventions, defines error codes and contains prototypes for the generic functions. This file is automatically included by all LZO headers.<lzo1.h><lzo1a.h><lzo1b.h><lzo1c.h><lzo1f.h><lzo1x.h><lzo1y.h><lzo1z.h><lzo2a.h> These files provide definitions and prototypes for the actual (de-)compression functions.<lzo16bit.h> Provides definitions for building and running LZO under a strict 16-bit memory model. Not officially supported.2 General=========2.1 The memory model--------------------The documentation indicates that LZO requires 32-bit integers. It'snot the integer size that really matters, though, but the memorymodel. If your memory model allows to access pointers at 32-bitoffsets, then there is no problem at all - LZO works fine on myold Atari ST, which has 16 bit integers and a flat 32-bit memory model.Using `huge' 32-bit pointers under 16-bit DOS is a workaround for this.While LZO also works with a strict 16-bit memory model, I don't officiallysupport this because this limits the maximum block size to 64 kB - and thismakes the library incompatible with other platforms, i.e. you cannotdecompress larger blocks compressed on those platforms.2.2 Public integral types-------------------------lzo_uint used as size_t, must be 32 bits or more for compatibility reasonslzo_uint32 *must* be 32 bits or morelzo_bool can store the values 0 ("false") and 1 ("true")lzo_byte unsigned char (memory model specific)2.3 Public pointer types------------------------All pointer types are memory model specific.lzo_voidp pointer to voidlzo_bytep pointer to unsigned charlzo_bytepp array of pointers to unsigned char2.4 Public function types-------------------------lzo_compress_tlzo_decompress_tlzo_optimize_tlzo_progress_callback_t3 Function reference====================3.1 Initialization------------------int lzo_init ( void ); This function initializes the LZO library. It must be the first LZO function you call, and you cannot use any of the other LZO library functions if the call fails. Return value: Returns LZO_E_OK on success, error code otherwise. Note: This function is actually implemented using a macro.3.2 Compression---------------All compressors compress the memory block at `src' with the uncompressedlength `src_len' to the address given by `dst'.The length of the compressed blocked will be returned in the variablepointed by `dst_len'.The two blocks may overlap under certain conditions (see examples/overlap.c).~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#include <lzo1x.h>int lzo1x_1_compress ( const lzo_byte *src, lzo_uint src_len, lzo_byte *dst, lzo_uint *dst_len, lzo_voidp wrkmem ); Algorithm: LZO1X Compression level: LZO1X-1 Memory requirements: LZO1X_1_MEM_COMPRESS (64 kB) This compressor is pretty fast. Return value: Always returns LZO_E_OK (this function can never fail).~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#include <lzo1x.h>int lzo1x_999_compress ( const lzo_byte *src, lzo_uint src_len, lzo_byte *dst, lzo_uint *dst_len, lzo_voidp wrkmem ); Algorithm: LZO1X Compression level: LZO1X-999 Memory requirements: LZO1X_999_MEM_COMPRESS (448 kB) This compressor is quite slow but achieves a good compression ratio. It is mainly intended for generating pre-compressed data. Return value: Always returns LZO_E_OK (this function can never fail).[ ... lots of other compressors ... ]3.3 Decompression-----------------All decompressors decompress the memory block at `src' with the compressedlength `src_len' to the address given by `dst'.The length of the decompressed block will be returned in the variablepointed by `dst_len' - on error the number of bytes that havebeen decompressed so far will be returned.The safe decompressors expect that the number of bytes available inthe `dst' block is passed via the variable pointed by `dst_len'.The two blocks may overlap under certain conditions (see examples/overlap.c).Description of return values: LZO_E_OK Success. LZO_E_INPUT_NOT_CONSUMED The end of the compressed block has been detected before all bytes in the compressed block have been used. This may actually not be an error (if `src_len' is too large). LZO_E_INPUT_OVERRUN The decompressor requested more bytes from the compressed block than available. Your data is corrupted (or `src_len' is too small). LZO_E_OUTPUT_OVERRUN The decompressor requested to write more bytes to the uncompressed block than available. Either your data is corrupted or you should increase the number of available bytes passed in `dst_len'. LZO_E_LOOKBEHIND_OVERRUN Your data is corrupted. LZO_E_EOF_NOT_FOUND No EOF code was found in the compressed block. Your data is corrupted (or `src_len' is too small). LZO_E_ERROR Any other error (data corrupted).~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#include <lzo1x.h>int lzo1x_decompress ( const lzo_byte *src, lzo_uint src_len, lzo_byte *dst, lzo_uint *dst_len, lzo_voidp wrkmem ); Algorithm: LZO1X Memory requirements: 0[ ... lots of other decompressors ... ]4 Variable reference====================The variables are listed alphabetically.[ no public variables yet ]--------------------------- END OF LZOAPI.TXT ------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -