Subversion Repositories freemyipod

Rev

Rev 160 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
160 theseven 1
/* ucl.h -- prototypes for the UCL real-time data compression library
2
 
3
   This file is part of the UCL data compression library.
4
 
5
   Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
6
   Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
7
   Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
8
   Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
9
   Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
10
   Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
11
   Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
12
   All Rights Reserved.
13
 
14
   The UCL library is free software; you can redistribute it and/or
15
   modify it under the terms of the GNU General Public License as
16
   published by the Free Software Foundation; either version 2 of
17
   the License, or (at your option) any later version.
18
 
19
   The UCL library is distributed in the hope that it will be useful,
20
   but WITHOUT ANY WARRANTY; without even the implied warranty of
21
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22
   GNU General Public License for more details.
23
 
24
   You should have received a copy of the GNU General Public License
25
   along with the UCL library; see the file COPYING.
26
   If not, write to the Free Software Foundation, Inc.,
27
   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28
 
29
   Markus F.X.J. Oberhumer
30
   <markus@oberhumer.com>
31
   http://www.oberhumer.com/opensource/ucl/
32
 */
33
 
34
 
35
#ifndef __UCL_H
36
#define __UCL_H
37
 
38
#ifndef __UCLCONF_H
39
#include <ucl/uclconf.h>
40
#endif
41
 
42
#ifdef __cplusplus
43
extern "C" {
44
#endif
45
 
46
 
47
/***********************************************************************
48
//
49
************************************************************************/
50
 
51
/* note: to use default values pass -1, i.e. initialize
52
 * this struct by a memset(x,0xff,sizeof(x)) */
53
struct ucl_compress_config_t
54
{
55
    int bb_endian;
56
    int bb_size;
57
    ucl_uint max_offset;
58
    ucl_uint max_match;
59
    int s_level;
60
    int h_level;
61
    int p_level;
62
    int c_flags;
63
    ucl_uint m_size;
64
};
65
 
66
#define ucl_compress_config_p   ucl_compress_config_t __UCL_MMODEL *
67
 
68
 
69
/***********************************************************************
70
// compressors
71
************************************************************************/
72
 
73
UCL_EXTERN(int)
74
ucl_nrv2b_99_compress      ( const ucl_bytep src, ucl_uint src_len,
75
                                   ucl_bytep dst, ucl_uintp dst_len,
76
                                   ucl_progress_callback_p cb,
77
                                   int level,
78
                             const struct ucl_compress_config_p conf,
79
                                   ucl_uintp result );
80
 
81
UCL_EXTERN(int)
82
ucl_nrv2d_99_compress      ( const ucl_bytep src, ucl_uint src_len,
83
                                   ucl_bytep dst, ucl_uintp dst_len,
84
                                   ucl_progress_callback_p cb,
85
                                   int level,
86
                             const struct ucl_compress_config_p conf,
87
                                   ucl_uintp result );
88
 
89
UCL_EXTERN(int)
90
ucl_nrv2e_99_compress      ( const ucl_bytep src, ucl_uint src_len,
91
                                   ucl_bytep dst, ucl_uintp dst_len,
92
                                   ucl_progress_callback_p cb,
93
                                   int level,
94
                             const struct ucl_compress_config_p conf,
95
                                   ucl_uintp result );
96
 
97
 
98
/***********************************************************************
99
// decompressors
100
************************************************************************/
101
 
102
UCL_EXTERN(int)
103
ucl_nrv2b_decompress_8          ( const ucl_bytep src, ucl_uint  src_len,
104
                                        ucl_bytep dst, ucl_uintp dst_len,
105
                                        ucl_voidp wrkmem );
106
UCL_EXTERN(int)
107
ucl_nrv2b_decompress_le16       ( const ucl_bytep src, ucl_uint  src_len,
108
                                        ucl_bytep dst, ucl_uintp dst_len,
109
                                        ucl_voidp wrkmem );
110
UCL_EXTERN(int)
111
ucl_nrv2b_decompress_le32       ( const ucl_bytep src, ucl_uint  src_len,
112
                                        ucl_bytep dst, ucl_uintp dst_len,
113
                                        ucl_voidp wrkmem );
114
UCL_EXTERN(int)
115
ucl_nrv2b_decompress_safe_8     ( const ucl_bytep src, ucl_uint  src_len,
116
                                        ucl_bytep dst, ucl_uintp dst_len,
117
                                        ucl_voidp wrkmem );
118
UCL_EXTERN(int)
119
ucl_nrv2b_decompress_safe_le16  ( const ucl_bytep src, ucl_uint  src_len,
120
                                        ucl_bytep dst, ucl_uintp dst_len,
121
                                        ucl_voidp wrkmem );
122
UCL_EXTERN(int)
123
ucl_nrv2b_decompress_safe_le32  ( const ucl_bytep src, ucl_uint  src_len,
124
                                        ucl_bytep dst, ucl_uintp dst_len,
125
                                        ucl_voidp wrkmem );
126
 
127
UCL_EXTERN(int)
128
ucl_nrv2d_decompress_8          ( const ucl_bytep src, ucl_uint  src_len,
129
                                        ucl_bytep dst, ucl_uintp dst_len,
130
                                        ucl_voidp wrkmem );
131
UCL_EXTERN(int)
132
ucl_nrv2d_decompress_le16       ( const ucl_bytep src, ucl_uint  src_len,
133
                                        ucl_bytep dst, ucl_uintp dst_len,
134
                                        ucl_voidp wrkmem );
135
UCL_EXTERN(int)
136
ucl_nrv2d_decompress_le32       ( const ucl_bytep src, ucl_uint  src_len,
137
                                        ucl_bytep dst, ucl_uintp dst_len,
138
                                        ucl_voidp wrkmem );
139
UCL_EXTERN(int)
140
ucl_nrv2d_decompress_safe_8     ( const ucl_bytep src, ucl_uint  src_len,
141
                                        ucl_bytep dst, ucl_uintp dst_len,
142
                                        ucl_voidp wrkmem );
143
UCL_EXTERN(int)
144
ucl_nrv2d_decompress_safe_le16  ( const ucl_bytep src, ucl_uint  src_len,
145
                                        ucl_bytep dst, ucl_uintp dst_len,
146
                                        ucl_voidp wrkmem );
147
UCL_EXTERN(int)
148
ucl_nrv2d_decompress_safe_le32  ( const ucl_bytep src, ucl_uint  src_len,
149
                                        ucl_bytep dst, ucl_uintp dst_len,
150
                                        ucl_voidp wrkmem );
151
 
152
UCL_EXTERN(int)
153
ucl_nrv2e_decompress_8          ( const ucl_bytep src, ucl_uint  src_len,
154
                                        ucl_bytep dst, ucl_uintp dst_len,
155
                                        ucl_voidp wrkmem );
156
UCL_EXTERN(int)
157
ucl_nrv2e_decompress_le16       ( const ucl_bytep src, ucl_uint  src_len,
158
                                        ucl_bytep dst, ucl_uintp dst_len,
159
                                        ucl_voidp wrkmem );
160
UCL_EXTERN(int)
161
ucl_nrv2e_decompress_le32       ( const ucl_bytep src, ucl_uint  src_len,
162
                                        ucl_bytep dst, ucl_uintp dst_len,
163
                                        ucl_voidp wrkmem );
164
UCL_EXTERN(int)
165
ucl_nrv2e_decompress_safe_8     ( const ucl_bytep src, ucl_uint  src_len,
166
                                        ucl_bytep dst, ucl_uintp dst_len,
167
                                        ucl_voidp wrkmem );
168
UCL_EXTERN(int)
169
ucl_nrv2e_decompress_safe_le16  ( const ucl_bytep src, ucl_uint  src_len,
170
                                        ucl_bytep dst, ucl_uintp dst_len,
171
                                        ucl_voidp wrkmem );
172
UCL_EXTERN(int)
173
ucl_nrv2e_decompress_safe_le32  ( const ucl_bytep src, ucl_uint  src_len,
174
                                        ucl_bytep dst, ucl_uintp dst_len,
175
                                        ucl_voidp wrkmem );
176
 
177
 
178
/***********************************************************************
179
// assembler decompressors [TO BE ADDED]
180
************************************************************************/
181
 
182
 
183
/***********************************************************************
184
// test an overlapping in-place decompression within a buffer:
185
//   - try a virtual decompression from &buf[src_off] -> &buf[0]
186
//   - no data is actually written
187
//   - only the bytes at buf[src_off .. src_off+src_len] will get accessed
188
************************************************************************/
189
 
190
UCL_EXTERN(int)
191
ucl_nrv2b_test_overlap_8        ( const ucl_bytep buf, ucl_uint src_off,
192
                                        ucl_uint  src_len, ucl_uintp dst_len,
193
                                        ucl_voidp wrkmem );
194
UCL_EXTERN(int)
195
ucl_nrv2b_test_overlap_le16     ( const ucl_bytep buf, ucl_uint src_off,
196
                                        ucl_uint  src_len, ucl_uintp dst_len,
197
                                        ucl_voidp wrkmem );
198
UCL_EXTERN(int)
199
ucl_nrv2b_test_overlap_le32     ( const ucl_bytep buf, ucl_uint src_off,
200
                                        ucl_uint  src_len, ucl_uintp dst_len,
201
                                        ucl_voidp wrkmem );
202
 
203
UCL_EXTERN(int)
204
ucl_nrv2d_test_overlap_8        ( const ucl_bytep buf, ucl_uint src_off,
205
                                        ucl_uint  src_len, ucl_uintp dst_len,
206
                                        ucl_voidp wrkmem );
207
UCL_EXTERN(int)
208
ucl_nrv2d_test_overlap_le16     ( const ucl_bytep buf, ucl_uint src_off,
209
                                        ucl_uint  src_len, ucl_uintp dst_len,
210
                                        ucl_voidp wrkmem );
211
UCL_EXTERN(int)
212
ucl_nrv2d_test_overlap_le32     ( const ucl_bytep buf, ucl_uint src_off,
213
                                        ucl_uint  src_len, ucl_uintp dst_len,
214
                                        ucl_voidp wrkmem );
215
 
216
UCL_EXTERN(int)
217
ucl_nrv2e_test_overlap_8        ( const ucl_bytep buf, ucl_uint src_off,
218
                                        ucl_uint  src_len, ucl_uintp dst_len,
219
                                        ucl_voidp wrkmem );
220
UCL_EXTERN(int)
221
ucl_nrv2e_test_overlap_le16     ( const ucl_bytep buf, ucl_uint src_off,
222
                                        ucl_uint  src_len, ucl_uintp dst_len,
223
                                        ucl_voidp wrkmem );
224
UCL_EXTERN(int)
225
ucl_nrv2e_test_overlap_le32     ( const ucl_bytep buf, ucl_uint src_off,
226
                                        ucl_uint  src_len, ucl_uintp dst_len,
227
                                        ucl_voidp wrkmem );
228
 
229
 
230
#ifdef __cplusplus
231
} /* extern "C" */
232
#endif
233
 
234
#endif /* already included */
235