LZOAPI.TXT 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. ============================================================================
  2. LZO -- a real-time data compression library LIBRARY REFERENCE
  3. ============================================================================
  4. [ please read LZO.FAQ first ]
  5. Table of Contents
  6. =================
  7. 1 Introduction to the LZO Library Reference
  8. 1.1 Preliminary notes
  9. 1.2 Headers
  10. 2 General
  11. 2.1 The memory model
  12. 2.2 Public integral types
  13. 2.3 Public pointer types
  14. 2.4 Public function types
  15. 3 Function reference
  16. 3.1 Initialization
  17. 3.2 Compression
  18. 3.3 Decompression
  19. 3.4 Optimization
  20. 3.5 String functions
  21. 3.6 Checksum functions
  22. 3.7 Version functions
  23. 4 Variable reference
  24. 1 Introduction to the LZO Library Reference
  25. =============================================
  26. 1.1 Preliminary notes
  27. ---------------------
  28. - 'C90' is short for ISO 9899-1990, the ANSI/ISO standard for the C
  29. programming language
  30. 1.2 Headers
  31. -----------
  32. This section briefly describes the headers.
  33. <lzo/lzoconf.h>
  34. Contains definitions for the basic integral and pointer types,
  35. provides wrappers for the library calling conventions, defines
  36. error codes and contains prototypes for the generic functions.
  37. This file is automatically included by all LZO headers.
  38. <lzo/lzo1.h>
  39. <lzo/lzo1a.h>
  40. <lzo/lzo1b.h>
  41. <lzo/lzo1c.h>
  42. <lzo/lzo1f.h>
  43. <lzo/lzo1x.h>
  44. <lzo/lzo1y.h>
  45. <lzo/lzo1z.h>
  46. <lzo/lzo2a.h>
  47. These files provide definitions and prototypes for the
  48. actual (de-)compression functions.
  49. 2 General
  50. =========
  51. 2.1 The memory model
  52. --------------------
  53. LZO requires a flat 32-bit or 64-bit memory model.
  54. 2.2 Public integral types
  55. -------------------------
  56. lzo_uint
  57. must match size_t
  58. lzo_bool
  59. can store the values 0 ("false") and 1 ("true")
  60. 2.3 Public pointer types
  61. ------------------------
  62. lzo_voidp
  63. pointer to void
  64. lzo_bytep
  65. pointer to unsigned char
  66. 2.4 Public function types
  67. -------------------------
  68. lzo_compress_t
  69. lzo_decompress_t
  70. lzo_optimize_t
  71. lzo_callback_t
  72. 3 Function reference
  73. ====================
  74. 3.1 Initialization
  75. ------------------
  76. int lzo_init ( void );
  77. This function initializes the LZO library. It must be the first LZO
  78. function you call, and you cannot use any of the other LZO library
  79. functions if the call fails.
  80. Return value:
  81. Returns LZO_E_OK on success, error code otherwise.
  82. Note:
  83. This function is actually implemented using a macro.
  84. 3.2 Compression
  85. ---------------
  86. All compressors compress the memory block at 'src' with the uncompressed
  87. length 'src_len' to the address given by 'dst'.
  88. The length of the compressed blocked will be returned in the variable
  89. pointed by 'dst_len'.
  90. The two blocks may overlap under certain conditions (see examples/overlap.c),
  91. thereby allowing "in-place" compression.
  92. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  93. #include <lzo/lzo1x.h>
  94. int lzo1x_1_compress ( const lzo_bytep src, lzo_uint src_len,
  95. lzo_bytep dst, lzo_uintp dst_len,
  96. lzo_voidp wrkmem );
  97. Algorithm: LZO1X
  98. Compression level: LZO1X-1
  99. Memory requirements: LZO1X_1_MEM_COMPRESS (64 KiB on 32-bit machines)
  100. This compressor is pretty fast.
  101. Return value:
  102. Always returns LZO_E_OK (this function can never fail).
  103. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  104. #include <lzo/lzo1x.h>
  105. int lzo1x_999_compress ( const lzo_bytep src, lzo_uint src_len,
  106. lzo_bytep dst, lzo_uintp dst_len,
  107. lzo_voidp wrkmem );
  108. Algorithm: LZO1X
  109. Compression level: LZO1X-999
  110. Memory requirements: LZO1X_999_MEM_COMPRESS (448 KiB on 32-bit machines)
  111. This compressor is quite slow but achieves a good compression
  112. ratio. It is mainly intended for generating pre-compressed data.
  113. Return value:
  114. Always returns LZO_E_OK (this function can never fail).
  115. [ ... lots of other compressors which all follow the same principle ... ]
  116. 3.3 Decompression
  117. -----------------
  118. All decompressors decompress the memory block at 'src' with the compressed
  119. length 'src_len' to the address given by 'dst'.
  120. The length of the decompressed block will be returned in the variable
  121. pointed by 'dst_len' - on error the number of bytes that have
  122. been decompressed so far will be returned.
  123. The safe decompressors expect that the number of bytes available in
  124. the 'dst' block is passed via the variable pointed by 'dst_len'.
  125. The two blocks may overlap under certain conditions (see examples/overlap.c),
  126. thereby allowing "in-place" decompression.
  127. Description of return values:
  128. LZO_E_OK
  129. Success.
  130. LZO_E_INPUT_NOT_CONSUMED
  131. The end of the compressed block has been detected before all
  132. bytes in the compressed block have been used.
  133. This may actually not be an error (if 'src_len' is too large).
  134. LZO_E_INPUT_OVERRUN
  135. The decompressor requested more bytes from the compressed
  136. block than available.
  137. Your data is corrupted (or 'src_len' is too small).
  138. LZO_E_OUTPUT_OVERRUN
  139. The decompressor requested to write more bytes to the uncompressed
  140. block than available.
  141. Either your data is corrupted, or you should increase the number of
  142. available bytes passed in the variable pointed by 'dst_len'.
  143. LZO_E_LOOKBEHIND_OVERRUN
  144. Your data is corrupted.
  145. LZO_E_EOF_NOT_FOUND
  146. No EOF code was found in the compressed block.
  147. Your data is corrupted (or 'src_len' is too small).
  148. LZO_E_ERROR
  149. Any other error (data corrupted).
  150. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  151. #include <lzo1x.h>
  152. int lzo1x_decompress ( const lzo_bytep src, lzo_uint src_len,
  153. lzo_bytep dst, lzo_uintp dst_len,
  154. lzo_voidp wrkmem );
  155. Algorithm: LZO1X
  156. Memory requirements: 0
  157. [ ... lots of other decompressors which all follow the same principle ... ]
  158. 4 Variable reference
  159. ====================
  160. The variables are listed alphabetically.
  161. [ no public variables yet ]
  162. --------------------------- END OF LZOAPI.TXT ------------------------------