lzo: update to 2.09
[tomato.git] / release / src / router / lzo / include / lzo / lzo1y.h
blobda199c0fc3734ca26518b2734057828cf9b5177e
1 /* lzo1y.h -- public interface of the LZO1Y compression algorithm
3 This file is part of the LZO real-time data compression library.
5 Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer
6 All Rights Reserved.
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.
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.
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 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 Markus F.X.J. Oberhumer
24 <markus@oberhumer.com>
25 http://www.oberhumer.com/opensource/lzo/
29 #ifndef __LZO1Y_H_INCLUDED
30 #define __LZO1Y_H_INCLUDED 1
32 #ifndef __LZOCONF_H_INCLUDED
33 #include <lzo/lzoconf.h>
34 #endif
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
41 /***********************************************************************
43 ************************************************************************/
45 /* Memory required for the wrkmem parameter.
46 * When the required size is 0, you can also pass a NULL pointer.
49 #define LZO1Y_MEM_COMPRESS ((lzo_uint32_t) (16384L * lzo_sizeof_dict_t))
50 #define LZO1Y_MEM_DECOMPRESS (0)
51 #define LZO1Y_MEM_OPTIMIZE (0)
54 /* decompression */
55 LZO_EXTERN(int)
56 lzo1y_decompress ( const lzo_bytep src, lzo_uint src_len,
57 lzo_bytep dst, lzo_uintp dst_len,
58 lzo_voidp wrkmem /* NOT USED */ );
60 /* safe decompression with overrun testing */
61 LZO_EXTERN(int)
62 lzo1y_decompress_safe ( const lzo_bytep src, lzo_uint src_len,
63 lzo_bytep dst, lzo_uintp dst_len,
64 lzo_voidp wrkmem /* NOT USED */ );
67 /***********************************************************************
69 ************************************************************************/
71 LZO_EXTERN(int)
72 lzo1y_1_compress ( const lzo_bytep src, lzo_uint src_len,
73 lzo_bytep dst, lzo_uintp dst_len,
74 lzo_voidp wrkmem );
77 /***********************************************************************
78 // better compression ratio at the cost of more memory and time
79 ************************************************************************/
81 #define LZO1Y_999_MEM_COMPRESS ((lzo_uint32_t) (14 * 16384L * sizeof(short)))
83 LZO_EXTERN(int)
84 lzo1y_999_compress ( const lzo_bytep src, lzo_uint src_len,
85 lzo_bytep dst, lzo_uintp dst_len,
86 lzo_voidp wrkmem );
90 /***********************************************************************
92 ************************************************************************/
94 LZO_EXTERN(int)
95 lzo1y_999_compress_dict ( const lzo_bytep src, lzo_uint src_len,
96 lzo_bytep dst, lzo_uintp dst_len,
97 lzo_voidp wrkmem,
98 const lzo_bytep dict, lzo_uint dict_len );
100 LZO_EXTERN(int)
101 lzo1y_999_compress_level ( const lzo_bytep src, lzo_uint src_len,
102 lzo_bytep dst, lzo_uintp dst_len,
103 lzo_voidp wrkmem,
104 const lzo_bytep dict, lzo_uint dict_len,
105 lzo_callback_p cb,
106 int compression_level );
108 LZO_EXTERN(int)
109 lzo1y_decompress_dict_safe ( const lzo_bytep src, lzo_uint src_len,
110 lzo_bytep dst, lzo_uintp dst_len,
111 lzo_voidp wrkmem /* NOT USED */,
112 const lzo_bytep dict, lzo_uint dict_len );
115 /***********************************************************************
116 // optimize a compressed data block
117 ************************************************************************/
119 LZO_EXTERN(int)
120 lzo1y_optimize ( lzo_bytep src, lzo_uint src_len,
121 lzo_bytep dst, lzo_uintp dst_len,
122 lzo_voidp wrkmem /* NOT USED */ );
126 #ifdef __cplusplus
127 } /* extern "C" */
128 #endif
130 #endif /* already included */
133 /* vim:set ts=4 sw=4 et: */