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) 1996-2014 Markus Franz Xaver Johannes Oberhumer |
6 | All Rights Reserved. |
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 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
22 | |
23 | Markus F.X.J. Oberhumer |
24 | <markus@oberhumer.com> |
25 | http://www.oberhumer.com/opensource/lzo/ |
26 | */ |
27 | |
28 | |
29 | #ifndef __LZO1X_H_INCLUDED |
30 | #define __LZO1X_H_INCLUDED 1 |
31 | |
32 | #ifndef __LZOCONF_H_INCLUDED |
33 | #include "lzoconf.h" |
34 | #endif |
35 | |
36 | #ifdef __cplusplus |
37 | extern "C" { |
38 | #endif |
39 | |
40 | |
41 | /*********************************************************************** |
42 | // |
43 | ************************************************************************/ |
44 | |
45 | /* Memory required for the wrkmem parameter. |
46 | * When the required size is 0, you can also pass a NULL pointer. |
47 | */ |
48 | |
49 | #define LZO1X_MEM_COMPRESS LZO1X_1_MEM_COMPRESS |
50 | #define LZO1X_MEM_DECOMPRESS (0) |
51 | #define LZO1X_MEM_OPTIMIZE (0) |
52 | |
53 | |
54 | /* decompression */ |
55 | LZO_EXTERN(int) |
56 | lzo1x_decompress ( const lzo_bytep src, lzo_uint src_len, |
57 | lzo_bytep dst, lzo_uintp dst_len, |
58 | lzo_voidp wrkmem /* NOT USED */ ); |
59 | |
60 | /* safe decompression with overrun testing */ |
61 | LZO_EXTERN(int) |
62 | lzo1x_decompress_safe ( const lzo_bytep src, lzo_uint src_len, |
63 | lzo_bytep dst, lzo_uintp dst_len, |
64 | lzo_voidp wrkmem /* NOT USED */ ); |
65 | |
66 | |
67 | /*********************************************************************** |
68 | // |
69 | ************************************************************************/ |
70 | |
71 | #define LZO1X_1_MEM_COMPRESS ((lzo_uint32_t) (16384L * lzo_sizeof_dict_t)) |
72 | |
73 | LZO_EXTERN(int) |
74 | lzo1x_1_compress ( const lzo_bytep src, lzo_uint src_len, |
75 | lzo_bytep dst, lzo_uintp dst_len, |
76 | lzo_voidp wrkmem ); |
77 | |
78 | |
79 | /*********************************************************************** |
80 | // special compressor versions |
81 | ************************************************************************/ |
82 | |
83 | /* this version needs only 8 KiB work memory */ |
84 | #define LZO1X_1_11_MEM_COMPRESS ((lzo_uint32_t) (2048L * lzo_sizeof_dict_t)) |
85 | |
86 | LZO_EXTERN(int) |
87 | lzo1x_1_11_compress ( const lzo_bytep src, lzo_uint src_len, |
88 | lzo_bytep dst, lzo_uintp dst_len, |
89 | lzo_voidp wrkmem ); |
90 | |
91 | |
92 | /* this version needs 16 KiB work memory */ |
93 | #define LZO1X_1_12_MEM_COMPRESS ((lzo_uint32_t) (4096L * lzo_sizeof_dict_t)) |
94 | |
95 | LZO_EXTERN(int) |
96 | lzo1x_1_12_compress ( const lzo_bytep src, lzo_uint src_len, |
97 | lzo_bytep dst, lzo_uintp dst_len, |
98 | lzo_voidp wrkmem ); |
99 | |
100 | |
101 | /* use this version if you need a little more compression speed */ |
102 | #define LZO1X_1_15_MEM_COMPRESS ((lzo_uint32_t) (32768L * lzo_sizeof_dict_t)) |
103 | |
104 | LZO_EXTERN(int) |
105 | lzo1x_1_15_compress ( const lzo_bytep src, lzo_uint src_len, |
106 | lzo_bytep dst, lzo_uintp dst_len, |
107 | lzo_voidp wrkmem ); |
108 | |
109 | |
110 | /*********************************************************************** |
111 | // better compression ratio at the cost of more memory and time |
112 | ************************************************************************/ |
113 | |
114 | #define LZO1X_999_MEM_COMPRESS ((lzo_uint32_t) (14 * 16384L * sizeof(short))) |
115 | |
116 | LZO_EXTERN(int) |
117 | lzo1x_999_compress ( const lzo_bytep src, lzo_uint src_len, |
118 | lzo_bytep dst, lzo_uintp dst_len, |
119 | lzo_voidp wrkmem ); |
120 | |
121 | |
122 | /*********************************************************************** |
123 | // |
124 | ************************************************************************/ |
125 | |
126 | LZO_EXTERN(int) |
127 | lzo1x_999_compress_dict ( const lzo_bytep src, lzo_uint src_len, |
128 | lzo_bytep dst, lzo_uintp dst_len, |
129 | lzo_voidp wrkmem, |
130 | const lzo_bytep dict, lzo_uint dict_len ); |
131 | |
132 | LZO_EXTERN(int) |
133 | lzo1x_999_compress_level ( const lzo_bytep src, lzo_uint src_len, |
134 | lzo_bytep dst, lzo_uintp dst_len, |
135 | lzo_voidp wrkmem, |
136 | const lzo_bytep dict, lzo_uint dict_len, |
137 | lzo_callback_p cb, |
138 | int compression_level ); |
139 | |
140 | LZO_EXTERN(int) |
141 | lzo1x_decompress_dict_safe ( const lzo_bytep src, lzo_uint src_len, |
142 | lzo_bytep dst, lzo_uintp dst_len, |
143 | lzo_voidp wrkmem /* NOT USED */, |
144 | const lzo_bytep dict, lzo_uint dict_len ); |
145 | |
146 | |
147 | /*********************************************************************** |
148 | // optimize a compressed data block |
149 | ************************************************************************/ |
150 | |
151 | LZO_EXTERN(int) |
152 | lzo1x_optimize ( lzo_bytep src, lzo_uint src_len, |
153 | lzo_bytep dst, lzo_uintp dst_len, |
154 | lzo_voidp wrkmem /* NOT USED */ ); |
155 | |
156 | |
157 | |
158 | #ifdef __cplusplus |
159 | } /* extern "C" */ |
160 | #endif |
161 | |
162 | #endif /* already included */ |
163 | |
164 | |
165 | /* vim:set ts=4 sw=4 et: */ |
166 | |