Blame doc/LZOAPI.TXT

Packit 679830
Packit 679830
============================================================================
Packit 679830
LZO -- a real-time data compression library                LIBRARY REFERENCE
Packit 679830
============================================================================
Packit 679830
Packit 679830
Packit 679830
[ please read LZO.FAQ first ]
Packit 679830
Packit 679830
Packit 679830
Table of Contents
Packit 679830
=================
Packit 679830
Packit 679830
1      Introduction to the LZO Library Reference
Packit 679830
1.1      Preliminary notes
Packit 679830
1.2      Headers
Packit 679830
2      General
Packit 679830
2.1      The memory model
Packit 679830
2.2      Public integral types
Packit 679830
2.3      Public pointer types
Packit 679830
2.4      Public function types
Packit 679830
3      Function reference
Packit 679830
3.1      Initialization
Packit 679830
3.2      Compression
Packit 679830
3.3      Decompression
Packit 679830
3.4      Optimization
Packit 679830
3.5      String functions
Packit 679830
3.6      Checksum functions
Packit 679830
3.7      Version functions
Packit 679830
4      Variable reference
Packit 679830
Packit 679830
Packit 679830
Packit 679830
1 Introduction to the LZO Library Reference
Packit 679830
=============================================
Packit 679830
Packit 679830
Packit 679830
1.1 Preliminary notes
Packit 679830
---------------------
Packit 679830
Packit 679830
- 'C90' is short for ISO 9899-1990, the ANSI/ISO standard for the C
Packit 679830
  programming language
Packit 679830
Packit 679830
Packit 679830
1.2 Headers
Packit 679830
-----------
Packit 679830
Packit 679830
This section briefly describes the headers.
Packit 679830
Packit 679830
<lzo/lzoconf.h>
Packit 679830
Packit 679830
    Contains definitions for the basic integral and pointer types,
Packit 679830
    provides wrappers for the library calling conventions, defines
Packit 679830
    error codes and contains prototypes for the generic functions.
Packit 679830
    This file is automatically included by all LZO headers.
Packit 679830
Packit 679830
<lzo/lzo1.h>
Packit 679830
<lzo/lzo1a.h>
Packit 679830
<lzo/lzo1b.h>
Packit 679830
<lzo/lzo1c.h>
Packit 679830
<lzo/lzo1f.h>
Packit 679830
<lzo/lzo1x.h>
Packit 679830
<lzo/lzo1y.h>
Packit 679830
<lzo/lzo1z.h>
Packit 679830
<lzo/lzo2a.h>
Packit 679830
Packit 679830
    These files provide definitions and prototypes for the
Packit 679830
    actual (de-)compression functions.
Packit 679830
Packit 679830
Packit 679830
Packit 679830
2 General
Packit 679830
=========
Packit 679830
Packit 679830
Packit 679830
2.1 The memory model
Packit 679830
--------------------
Packit 679830
Packit 679830
LZO requires a flat 32-bit or 64-bit memory model.
Packit 679830
Packit 679830
Packit 679830
2.2 Public integral types
Packit 679830
-------------------------
Packit 679830
Packit 679830
lzo_uint
Packit 679830
Packit 679830
    must match size_t
Packit 679830
Packit 679830
lzo_bool
Packit 679830
Packit 679830
    can store the values 0 ("false") and 1 ("true")
Packit 679830
Packit 679830
Packit 679830
2.3 Public pointer types
Packit 679830
------------------------
Packit 679830
Packit 679830
lzo_voidp
Packit 679830
Packit 679830
    pointer to void
Packit 679830
Packit 679830
lzo_bytep
Packit 679830
Packit 679830
    pointer to unsigned char
Packit 679830
Packit 679830
Packit 679830
2.4 Public function types
Packit 679830
-------------------------
Packit 679830
Packit 679830
lzo_compress_t
Packit 679830
Packit 679830
lzo_decompress_t
Packit 679830
Packit 679830
lzo_optimize_t
Packit 679830
Packit 679830
lzo_callback_t
Packit 679830
Packit 679830
Packit 679830
Packit 679830
3 Function reference
Packit 679830
====================
Packit 679830
Packit 679830
Packit 679830
3.1 Initialization
Packit 679830
------------------
Packit 679830
Packit 679830
int lzo_init ( void );
Packit 679830
Packit 679830
  This function initializes the LZO library. It must be the first LZO
Packit 679830
  function you call, and you cannot use any of the other LZO library
Packit 679830
  functions if the call fails.
Packit 679830
Packit 679830
  Return value:
Packit 679830
    Returns LZO_E_OK on success, error code otherwise.
Packit 679830
Packit 679830
  Note:
Packit 679830
    This function is actually implemented using a macro.
Packit 679830
Packit 679830
Packit 679830
3.2 Compression
Packit 679830
---------------
Packit 679830
Packit 679830
All compressors compress the memory block at 'src' with the uncompressed
Packit 679830
length 'src_len' to the address given by 'dst'.
Packit 679830
The length of the compressed blocked will be returned in the variable
Packit 679830
pointed by 'dst_len'.
Packit 679830
Packit 679830
The two blocks may overlap under certain conditions (see examples/overlap.c),
Packit 679830
thereby allowing "in-place" compression.
Packit 679830
Packit 679830
Packit 679830
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Packit 679830
#include <lzo/lzo1x.h>
Packit 679830
Packit 679830
int lzo1x_1_compress ( const lzo_bytep src, lzo_uint  src_len,
Packit 679830
                             lzo_bytep dst, lzo_uintp dst_len,
Packit 679830
                             lzo_voidp wrkmem );
Packit 679830
Packit 679830
  Algorithm:            LZO1X
Packit 679830
  Compression level:    LZO1X-1
Packit 679830
  Memory requirements:  LZO1X_1_MEM_COMPRESS    (64 KiB on 32-bit machines)
Packit 679830
Packit 679830
  This compressor is pretty fast.
Packit 679830
Packit 679830
  Return value:
Packit 679830
    Always returns LZO_E_OK (this function can never fail).
Packit 679830
Packit 679830
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Packit 679830
#include <lzo/lzo1x.h>
Packit 679830
Packit 679830
int lzo1x_999_compress ( const lzo_bytep src, lzo_uint  src_len,
Packit 679830
                               lzo_bytep dst, lzo_uintp dst_len,
Packit 679830
                               lzo_voidp wrkmem );
Packit 679830
Packit 679830
  Algorithm:            LZO1X
Packit 679830
  Compression level:    LZO1X-999
Packit 679830
  Memory requirements:  LZO1X_999_MEM_COMPRESS  (448 KiB on 32-bit machines)
Packit 679830
Packit 679830
  This compressor is quite slow but achieves a good compression
Packit 679830
  ratio. It is mainly intended for generating pre-compressed data.
Packit 679830
Packit 679830
  Return value:
Packit 679830
    Always returns LZO_E_OK (this function can never fail).
Packit 679830
Packit 679830
Packit 679830
[ ... lots of other compressors which all follow the same principle ... ]
Packit 679830
Packit 679830
Packit 679830
Packit 679830
3.3 Decompression
Packit 679830
-----------------
Packit 679830
Packit 679830
All decompressors decompress the memory block at 'src' with the compressed
Packit 679830
length 'src_len' to the address given by 'dst'.
Packit 679830
The length of the decompressed block will be returned in the variable
Packit 679830
pointed by 'dst_len' - on error the number of bytes that have
Packit 679830
been decompressed so far will be returned.
Packit 679830
Packit 679830
The safe decompressors expect that the number of bytes available in
Packit 679830
the 'dst' block is passed via the variable pointed by 'dst_len'.
Packit 679830
Packit 679830
The two blocks may overlap under certain conditions (see examples/overlap.c),
Packit 679830
thereby allowing "in-place" decompression.
Packit 679830
Packit 679830
Packit 679830
Description of return values:
Packit 679830
Packit 679830
  LZO_E_OK
Packit 679830
    Success.
Packit 679830
Packit 679830
  LZO_E_INPUT_NOT_CONSUMED
Packit 679830
    The end of the compressed block has been detected before all
Packit 679830
    bytes in the compressed block have been used.
Packit 679830
    This may actually not be an error (if 'src_len' is too large).
Packit 679830
Packit 679830
  LZO_E_INPUT_OVERRUN
Packit 679830
    The decompressor requested more bytes from the compressed
Packit 679830
    block than available.
Packit 679830
    Your data is corrupted (or 'src_len' is too small).
Packit 679830
Packit 679830
  LZO_E_OUTPUT_OVERRUN
Packit 679830
    The decompressor requested to write more bytes to the uncompressed
Packit 679830
    block than available.
Packit 679830
    Either your data is corrupted, or you should increase the number of
Packit 679830
    available bytes passed in the variable pointed by 'dst_len'.
Packit 679830
Packit 679830
  LZO_E_LOOKBEHIND_OVERRUN
Packit 679830
    Your data is corrupted.
Packit 679830
Packit 679830
  LZO_E_EOF_NOT_FOUND
Packit 679830
    No EOF code was found in the compressed block.
Packit 679830
    Your data is corrupted (or 'src_len' is too small).
Packit 679830
Packit 679830
  LZO_E_ERROR
Packit 679830
    Any other error (data corrupted).
Packit 679830
Packit 679830
Packit 679830
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Packit 679830
#include <lzo1x.h>
Packit 679830
Packit 679830
int lzo1x_decompress ( const lzo_bytep src, lzo_uint  src_len,
Packit 679830
                             lzo_bytep dst, lzo_uintp dst_len,
Packit 679830
                             lzo_voidp wrkmem );
Packit 679830
Packit 679830
  Algorithm:            LZO1X
Packit 679830
  Memory requirements:  0
Packit 679830
Packit 679830
Packit 679830
[ ... lots of other decompressors which all follow the same principle ... ]
Packit 679830
Packit 679830
Packit 679830
Packit 679830
4 Variable reference
Packit 679830
====================
Packit 679830
Packit 679830
The variables are listed alphabetically.
Packit 679830
Packit 679830
[ no public variables yet ]
Packit 679830
Packit 679830
Packit 679830
Packit 679830
--------------------------- END OF LZOAPI.TXT ------------------------------
Packit 679830