home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lzo100.zip / lzo-1.00 / include / lzo1x.h < prev    next >
C/C++ Source or Header  |  1997-07-13  |  4KB  |  129 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) 1997 Markus Franz Xaver Johannes Oberhumer
  6.    Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
  7.  
  8.    The LZO library is free software; you can redistribute it and/or
  9.    modify it under the terms of the GNU General Public License as
  10.    published by the Free Software Foundation; either version 2 of
  11.    the License, or (at your option) any later version.
  12.  
  13.    The LZO library is distributed in the hope that it will be useful,
  14.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.    GNU General Public License for more details.
  17.  
  18.    You should have received a copy of the GNU General Public License
  19.    along with the LZO library; see the file COPYING.
  20.    If not, write to the Free Software Foundation, Inc.,
  21.    59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  22.  
  23.    Markus F.X.J. Oberhumer
  24.    markus.oberhumer@jk.uni-linz.ac.at
  25.  */
  26.  
  27.  
  28. #ifndef __LZO1X_H
  29. #define __LZO1X_H
  30.  
  31. #ifndef __LZOCONF_H
  32. #include <lzoconf.h>
  33. #endif
  34.  
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif
  38.  
  39.  
  40. /***********************************************************************
  41. //
  42. ************************************************************************/
  43.  
  44. /* Memory required for the wrkmem parameter.
  45.  * When the required size is 0, you can also pass a NULL pointer.
  46.  */
  47.  
  48. #define LZO1X_MEM_COMPRESS      ((lzo_uint) (16384L * sizeof(lzo_byte *)))
  49. #define LZO1X_MEM_DECOMPRESS    (0)
  50. #define LZO1X_MEM_OPTIMIZE      (0)
  51.  
  52.  
  53. /* decompression */
  54. LZO_EXTERN(int)
  55. lzo1x_decompress        ( const lzo_byte *src, lzo_uint  src_len,
  56.                                 lzo_byte *dst, lzo_uint *dst_len,
  57.                                 lzo_voidp wrkmem /* NOT USED */ );
  58.  
  59. /* safe decompression with overrun testing */
  60. LZO_EXTERN(int)
  61. lzo1x_decompress_safe   ( const lzo_byte *src, lzo_uint  src_len,
  62.                                 lzo_byte *dst, lzo_uint *dst_len,
  63.                                 lzo_voidp wrkmem /* NOT USED */ );
  64.  
  65.  
  66. /***********************************************************************
  67. //
  68. ************************************************************************/
  69.  
  70. LZO_EXTERN(int)
  71. lzo1x_1_compress        ( const lzo_byte *src, lzo_uint  src_len,
  72.                                 lzo_byte *dst, lzo_uint *dst_len,
  73.                                 lzo_voidp wrkmem );
  74.  
  75.  
  76. /***********************************************************************
  77. // special compressor versions
  78. ************************************************************************/
  79.  
  80. /* this version needs only 8kB work memory */
  81. #define LZO1X_1_11_MEM_COMPRESS ((lzo_uint) (2048L * sizeof(lzo_byte *)))
  82.  
  83. LZO_EXTERN(int)
  84. lzo1x_1_11_compress     ( const lzo_byte *src, lzo_uint  src_len,
  85.                                 lzo_byte *dst, lzo_uint *dst_len,
  86.                                 lzo_voidp wrkmem );
  87.  
  88.  
  89. /* use this version if you need a little more compression speed */
  90. #define LZO1X_1_15_MEM_COMPRESS ((lzo_uint) (32768L * sizeof(lzo_byte *)))
  91.  
  92. LZO_EXTERN(int)
  93. lzo1x_1_15_compress     ( const lzo_byte *src, lzo_uint  src_len,
  94.                                 lzo_byte *dst, lzo_uint *dst_len,
  95.                                 lzo_voidp wrkmem );
  96.  
  97.  
  98. /***********************************************************************
  99. // better compression ratio at the cost of more memory and time
  100. ************************************************************************/
  101.  
  102. #define LZO1X_999_MEM_COMPRESS  ((lzo_uint) (14 * 16384L * sizeof(short)))
  103.  
  104. #if !defined(LZO_999_UNSUPPORTED)
  105. LZO_EXTERN(int)
  106. lzo1x_999_compress      ( const lzo_byte *src, lzo_uint  src_len,
  107.                                 lzo_byte *dst, lzo_uint *dst_len,
  108.                                 lzo_voidp wrkmem );
  109. #endif
  110.  
  111.  
  112. /***********************************************************************
  113. // optimize a compressed data block
  114. ************************************************************************/
  115.  
  116. LZO_EXTERN(int)
  117. lzo1x_optimize          (       lzo_byte *in , lzo_uint  in_len,
  118.                                 lzo_byte *out, lzo_uint *out_len,
  119.                                 lzo_voidp wrkmem );
  120.  
  121.  
  122.  
  123. #ifdef __cplusplus
  124. } /* extern "C" */
  125. #endif
  126.  
  127. #endif /* already included */
  128.  
  129.