home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / lzo / lzo1x.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-06-09  |  6.2 KB  |  174 lines

  1. /* lzo1x.h -- public interface of the LZO1X compression algorithm
  2.  
  3.    This file is part of the LZO real-time data compression library.
  4.  
  5.    Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
  6.    Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
  7.    Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
  8.    Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
  9.    Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
  10.    Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
  11.    Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
  12.    Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
  13.    Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
  14.    Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
  15.    All Rights Reserved.
  16.  
  17.    The LZO library is free software; you can redistribute it and/or
  18.    modify it under the terms of the GNU General Public License,
  19.    version 2, as published by the Free Software Foundation.
  20.  
  21.    The LZO library is distributed in the hope that it will be useful,
  22.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  23.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  24.    GNU General Public License for more details.
  25.  
  26.    You should have received a copy of the GNU General Public License
  27.    along with the LZO library; see the file COPYING.
  28.    If not, write to the Free Software Foundation, Inc.,
  29.    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  30.  
  31.    Markus F.X.J. Oberhumer
  32.    <markus@oberhumer.com>
  33.    http://www.oberhumer.com/opensource/lzo/
  34.  */
  35.  
  36.  
  37. #ifndef __LZO1X_H_INCLUDED
  38. #define __LZO1X_H_INCLUDED
  39.  
  40. #ifndef __LZOCONF_H_INCLUDED
  41. #include "lzoconf.h"
  42. #endif
  43.  
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47.  
  48.  
  49. /***********************************************************************
  50. //
  51. ************************************************************************/
  52.  
  53. /* Memory required for the wrkmem parameter.
  54.  * When the required size is 0, you can also pass a NULL pointer.
  55.  */
  56.  
  57. #define LZO1X_MEM_COMPRESS      LZO1X_1_MEM_COMPRESS
  58. #define LZO1X_MEM_DECOMPRESS    (0)
  59. #define LZO1X_MEM_OPTIMIZE      (0)
  60.  
  61.  
  62. /* decompression */
  63. LZO_EXTERN(int)
  64. lzo1x_decompress        ( const lzo_bytep src, lzo_uint  src_len,
  65.                                 lzo_bytep dst, lzo_uintp dst_len,
  66.                                 lzo_voidp wrkmem /* NOT USED */ );
  67.  
  68. /* safe decompression with overrun testing */
  69. LZO_EXTERN(int)
  70. lzo1x_decompress_safe   ( const lzo_bytep src, lzo_uint  src_len,
  71.                                 lzo_bytep dst, lzo_uintp dst_len,
  72.                                 lzo_voidp wrkmem /* NOT USED */ );
  73.  
  74.  
  75. /***********************************************************************
  76. //
  77. ************************************************************************/
  78.  
  79. #define LZO1X_1_MEM_COMPRESS    ((lzo_uint32) (16384L * lzo_sizeof_dict_t))
  80.  
  81. LZO_EXTERN(int)
  82. lzo1x_1_compress        ( const lzo_bytep src, lzo_uint  src_len,
  83.                                 lzo_bytep dst, lzo_uintp dst_len,
  84.                                 lzo_voidp wrkmem );
  85.  
  86.  
  87. /***********************************************************************
  88. // special compressor versions
  89. ************************************************************************/
  90.  
  91. /* this version needs only 8 kB work memory */
  92. #define LZO1X_1_11_MEM_COMPRESS ((lzo_uint32) (2048L * lzo_sizeof_dict_t))
  93.  
  94. LZO_EXTERN(int)
  95. lzo1x_1_11_compress     ( const lzo_bytep src, lzo_uint  src_len,
  96.                                 lzo_bytep dst, lzo_uintp dst_len,
  97.                                 lzo_voidp wrkmem );
  98.  
  99.  
  100. /* this version needs 16 kB work memory */
  101. #define LZO1X_1_12_MEM_COMPRESS ((lzo_uint32) (4096L * lzo_sizeof_dict_t))
  102.  
  103. LZO_EXTERN(int)
  104. lzo1x_1_12_compress     ( const lzo_bytep src, lzo_uint  src_len,
  105.                                 lzo_bytep dst, lzo_uintp dst_len,
  106.                                 lzo_voidp wrkmem );
  107.  
  108.  
  109. /* use this version if you need a little more compression speed */
  110. #define LZO1X_1_15_MEM_COMPRESS ((lzo_uint32) (32768L * lzo_sizeof_dict_t))
  111.  
  112. LZO_EXTERN(int)
  113. lzo1x_1_15_compress     ( const lzo_bytep src, lzo_uint  src_len,
  114.                                 lzo_bytep dst, lzo_uintp dst_len,
  115.                                 lzo_voidp wrkmem );
  116.  
  117.  
  118. /***********************************************************************
  119. // better compression ratio at the cost of more memory and time
  120. ************************************************************************/
  121.  
  122. #define LZO1X_999_MEM_COMPRESS  ((lzo_uint32) (14 * 16384L * sizeof(short)))
  123.  
  124. LZO_EXTERN(int)
  125. lzo1x_999_compress      ( const lzo_bytep src, lzo_uint  src_len,
  126.                                 lzo_bytep dst, lzo_uintp dst_len,
  127.                                 lzo_voidp wrkmem );
  128.  
  129.  
  130. /***********************************************************************
  131. //
  132. ************************************************************************/
  133.  
  134. LZO_EXTERN(int)
  135. lzo1x_999_compress_dict     ( const lzo_bytep in , lzo_uint  in_len,
  136.                                     lzo_bytep out, lzo_uintp out_len,
  137.                                     lzo_voidp wrkmem,
  138.                               const lzo_bytep dict, lzo_uint dict_len );
  139.  
  140. LZO_EXTERN(int)
  141. lzo1x_999_compress_level    ( const lzo_bytep in , lzo_uint  in_len,
  142.                                     lzo_bytep out, lzo_uintp out_len,
  143.                                     lzo_voidp wrkmem,
  144.                               const lzo_bytep dict, lzo_uint dict_len,
  145.                                     lzo_callback_p cb,
  146.                                     int compression_level );
  147.  
  148. LZO_EXTERN(int)
  149. lzo1x_decompress_dict_safe ( const lzo_bytep in,  lzo_uint  in_len,
  150.                                    lzo_bytep out, lzo_uintp out_len,
  151.                                    lzo_voidp wrkmem /* NOT USED */,
  152.                              const lzo_bytep dict, lzo_uint dict_len );
  153.  
  154.  
  155. /***********************************************************************
  156. // optimize a compressed data block
  157. ************************************************************************/
  158.  
  159. LZO_EXTERN(int)
  160. lzo1x_optimize          (       lzo_bytep in , lzo_uint  in_len,
  161.                                 lzo_bytep out, lzo_uintp out_len,
  162.                                 lzo_voidp wrkmem /* NOT USED */ );
  163.  
  164.  
  165.  
  166. #ifdef __cplusplus
  167. } /* extern "C" */
  168. #endif
  169.  
  170. #endif /* already included */
  171.  
  172.  
  173. /* vim:set ts=4 et: */
  174.