Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 26 | pmbaty | 1 | /* ucl.h -- prototypes for the UCL data compression library |
| 2 | |||
| 3 | This file is part of the UCL data compression library. |
||
| 4 | |||
| 5 | Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer |
||
| 6 | Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer |
||
| 7 | Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer |
||
| 8 | Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer |
||
| 9 | Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer |
||
| 10 | Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer |
||
| 11 | Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer |
||
| 12 | Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer |
||
| 13 | Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer |
||
| 14 | All Rights Reserved. |
||
| 15 | |||
| 16 | The UCL library is free software; you can redistribute it and/or |
||
| 17 | modify it under the terms of the GNU General Public License as |
||
| 18 | published by the Free Software Foundation; either version 2 of |
||
| 19 | the License, or (at your option) any later version. |
||
| 20 | |||
| 21 | The UCL 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 UCL library; see the file COPYING. |
||
| 28 | If not, write to the Free Software Foundation, Inc., |
||
| 29 | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
||
| 30 | |||
| 31 | Markus F.X.J. Oberhumer |
||
| 32 | <markus@oberhumer.com> |
||
| 33 | http://www.oberhumer.com/opensource/ucl/ |
||
| 34 | */ |
||
| 35 | |||
| 36 | |||
| 37 | #ifndef __UCL_H_INCLUDED |
||
| 38 | #define __UCL_H_INCLUDED |
||
| 39 | |||
| 40 | #ifndef __UCLCONF_H_INCLUDED |
||
| 41 | #include <ucl/uclconf.h> |
||
| 42 | #endif |
||
| 43 | |||
| 44 | #ifdef __cplusplus |
||
| 45 | extern "C" { |
||
| 46 | #endif |
||
| 47 | |||
| 48 | |||
| 49 | /*********************************************************************** |
||
| 50 | // Compression fine-tuning configuration. |
||
| 51 | // |
||
| 52 | // Pass a NULL pointer to the compression functions for default values. |
||
| 53 | // Otherwise set all values to -1 [i.e. initialize the struct by a |
||
| 54 | // `memset(x,0xff,sizeof(x))'] and then set the required values. |
||
| 55 | ************************************************************************/ |
||
| 56 | |||
| 57 | struct ucl_compress_config_t |
||
| 58 | { |
||
| 59 | int bb_endian; |
||
| 60 | int bb_size; |
||
| 61 | ucl_uint max_offset; |
||
| 62 | ucl_uint max_match; |
||
| 63 | int s_level; |
||
| 64 | int h_level; |
||
| 65 | int p_level; |
||
| 66 | int c_flags; |
||
| 67 | ucl_uint m_size; |
||
| 68 | }; |
||
| 69 | |||
| 70 | #define ucl_compress_config_p ucl_compress_config_t __UCL_MMODEL * |
||
| 71 | |||
| 72 | |||
| 73 | /*********************************************************************** |
||
| 74 | // compressors |
||
| 75 | // |
||
| 76 | // Pass NULL for `cb' (no progress callback), `conf' (default compression |
||
| 77 | // configuration) and `result' (no statistical result). |
||
| 78 | ************************************************************************/ |
||
| 79 | |||
| 80 | UCL_EXTERN(int) |
||
| 81 | ucl_nrv2b_99_compress ( const ucl_bytep src, ucl_uint src_len, |
||
| 82 | ucl_bytep dst, ucl_uintp dst_len, |
||
| 83 | ucl_progress_callback_p cb, |
||
| 84 | int level, |
||
| 85 | const struct ucl_compress_config_p conf, |
||
| 86 | ucl_uintp result ); |
||
| 87 | |||
| 88 | UCL_EXTERN(int) |
||
| 89 | ucl_nrv2d_99_compress ( const ucl_bytep src, ucl_uint src_len, |
||
| 90 | ucl_bytep dst, ucl_uintp dst_len, |
||
| 91 | ucl_progress_callback_p cb, |
||
| 92 | int level, |
||
| 93 | const struct ucl_compress_config_p conf, |
||
| 94 | ucl_uintp result ); |
||
| 95 | |||
| 96 | UCL_EXTERN(int) |
||
| 97 | ucl_nrv2e_99_compress ( const ucl_bytep src, ucl_uint src_len, |
||
| 98 | ucl_bytep dst, ucl_uintp dst_len, |
||
| 99 | ucl_progress_callback_p cb, |
||
| 100 | int level, |
||
| 101 | const struct ucl_compress_config_p conf, |
||
| 102 | ucl_uintp result ); |
||
| 103 | |||
| 104 | |||
| 105 | /*********************************************************************** |
||
| 106 | // decompressors |
||
| 107 | // |
||
| 108 | // Always pass NULL for `wrkmem'. This parameter is for symetry |
||
| 109 | // with my other compression libaries and is not used in UCL - |
||
| 110 | // UCL does not need any additional memory (or even local stack space) |
||
| 111 | // for decompression. |
||
| 112 | ************************************************************************/ |
||
| 113 | |||
| 114 | UCL_EXTERN(int) |
||
| 115 | ucl_nrv2b_decompress_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_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_le32 ( const ucl_bytep src, ucl_uint src_len, |
||
| 124 | ucl_bytep dst, ucl_uintp dst_len, |
||
| 125 | ucl_voidp wrkmem ); |
||
| 126 | UCL_EXTERN(int) |
||
| 127 | ucl_nrv2b_decompress_safe_8 ( const ucl_bytep src, ucl_uint src_len, |
||
| 128 | ucl_bytep dst, ucl_uintp dst_len, |
||
| 129 | ucl_voidp wrkmem ); |
||
| 130 | UCL_EXTERN(int) |
||
| 131 | ucl_nrv2b_decompress_safe_le16 ( const ucl_bytep src, ucl_uint src_len, |
||
| 132 | ucl_bytep dst, ucl_uintp dst_len, |
||
| 133 | ucl_voidp wrkmem ); |
||
| 134 | UCL_EXTERN(int) |
||
| 135 | ucl_nrv2b_decompress_safe_le32 ( const ucl_bytep src, ucl_uint src_len, |
||
| 136 | ucl_bytep dst, ucl_uintp dst_len, |
||
| 137 | ucl_voidp wrkmem ); |
||
| 138 | |||
| 139 | UCL_EXTERN(int) |
||
| 140 | ucl_nrv2d_decompress_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_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_le32 ( const ucl_bytep src, ucl_uint src_len, |
||
| 149 | ucl_bytep dst, ucl_uintp dst_len, |
||
| 150 | ucl_voidp wrkmem ); |
||
| 151 | UCL_EXTERN(int) |
||
| 152 | ucl_nrv2d_decompress_safe_8 ( const ucl_bytep src, ucl_uint src_len, |
||
| 153 | ucl_bytep dst, ucl_uintp dst_len, |
||
| 154 | ucl_voidp wrkmem ); |
||
| 155 | UCL_EXTERN(int) |
||
| 156 | ucl_nrv2d_decompress_safe_le16 ( const ucl_bytep src, ucl_uint src_len, |
||
| 157 | ucl_bytep dst, ucl_uintp dst_len, |
||
| 158 | ucl_voidp wrkmem ); |
||
| 159 | UCL_EXTERN(int) |
||
| 160 | ucl_nrv2d_decompress_safe_le32 ( const ucl_bytep src, ucl_uint src_len, |
||
| 161 | ucl_bytep dst, ucl_uintp dst_len, |
||
| 162 | ucl_voidp wrkmem ); |
||
| 163 | |||
| 164 | UCL_EXTERN(int) |
||
| 165 | ucl_nrv2e_decompress_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_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_le32 ( const ucl_bytep src, ucl_uint src_len, |
||
| 174 | ucl_bytep dst, ucl_uintp dst_len, |
||
| 175 | ucl_voidp wrkmem ); |
||
| 176 | UCL_EXTERN(int) |
||
| 177 | ucl_nrv2e_decompress_safe_8 ( const ucl_bytep src, ucl_uint src_len, |
||
| 178 | ucl_bytep dst, ucl_uintp dst_len, |
||
| 179 | ucl_voidp wrkmem ); |
||
| 180 | UCL_EXTERN(int) |
||
| 181 | ucl_nrv2e_decompress_safe_le16 ( const ucl_bytep src, ucl_uint src_len, |
||
| 182 | ucl_bytep dst, ucl_uintp dst_len, |
||
| 183 | ucl_voidp wrkmem ); |
||
| 184 | UCL_EXTERN(int) |
||
| 185 | ucl_nrv2e_decompress_safe_le32 ( const ucl_bytep src, ucl_uint src_len, |
||
| 186 | ucl_bytep dst, ucl_uintp dst_len, |
||
| 187 | ucl_voidp wrkmem ); |
||
| 188 | |||
| 189 | |||
| 190 | /*********************************************************************** |
||
| 191 | // assembler decompressors [TO BE ADDED] |
||
| 192 | ************************************************************************/ |
||
| 193 | |||
| 194 | |||
| 195 | /*********************************************************************** |
||
| 196 | // test an overlapping in-place decompression within a buffer: |
||
| 197 | // - try a virtual decompression from &buf[src_off] -> &buf[0] |
||
| 198 | // - no data is actually written |
||
| 199 | // - only the bytes at buf[src_off..src_off+src_len-1] will get accessed |
||
| 200 | // |
||
| 201 | // NOTE: always pass NULL for `wrkmem' - see above. |
||
| 202 | ************************************************************************/ |
||
| 203 | |||
| 204 | UCL_EXTERN(int) |
||
| 205 | ucl_nrv2b_test_overlap_8 ( const ucl_bytep buf, ucl_uint src_off, |
||
| 206 | ucl_uint src_len, ucl_uintp dst_len, |
||
| 207 | ucl_voidp wrkmem ); |
||
| 208 | UCL_EXTERN(int) |
||
| 209 | ucl_nrv2b_test_overlap_le16 ( const ucl_bytep buf, ucl_uint src_off, |
||
| 210 | ucl_uint src_len, ucl_uintp dst_len, |
||
| 211 | ucl_voidp wrkmem ); |
||
| 212 | UCL_EXTERN(int) |
||
| 213 | ucl_nrv2b_test_overlap_le32 ( const ucl_bytep buf, ucl_uint src_off, |
||
| 214 | ucl_uint src_len, ucl_uintp dst_len, |
||
| 215 | ucl_voidp wrkmem ); |
||
| 216 | |||
| 217 | UCL_EXTERN(int) |
||
| 218 | ucl_nrv2d_test_overlap_8 ( const ucl_bytep buf, ucl_uint src_off, |
||
| 219 | ucl_uint src_len, ucl_uintp dst_len, |
||
| 220 | ucl_voidp wrkmem ); |
||
| 221 | UCL_EXTERN(int) |
||
| 222 | ucl_nrv2d_test_overlap_le16 ( const ucl_bytep buf, ucl_uint src_off, |
||
| 223 | ucl_uint src_len, ucl_uintp dst_len, |
||
| 224 | ucl_voidp wrkmem ); |
||
| 225 | UCL_EXTERN(int) |
||
| 226 | ucl_nrv2d_test_overlap_le32 ( const ucl_bytep buf, ucl_uint src_off, |
||
| 227 | ucl_uint src_len, ucl_uintp dst_len, |
||
| 228 | ucl_voidp wrkmem ); |
||
| 229 | |||
| 230 | UCL_EXTERN(int) |
||
| 231 | ucl_nrv2e_test_overlap_8 ( const ucl_bytep buf, ucl_uint src_off, |
||
| 232 | ucl_uint src_len, ucl_uintp dst_len, |
||
| 233 | ucl_voidp wrkmem ); |
||
| 234 | UCL_EXTERN(int) |
||
| 235 | ucl_nrv2e_test_overlap_le16 ( const ucl_bytep buf, ucl_uint src_off, |
||
| 236 | ucl_uint src_len, ucl_uintp dst_len, |
||
| 237 | ucl_voidp wrkmem ); |
||
| 238 | UCL_EXTERN(int) |
||
| 239 | ucl_nrv2e_test_overlap_le32 ( const ucl_bytep buf, ucl_uint src_off, |
||
| 240 | ucl_uint src_len, ucl_uintp dst_len, |
||
| 241 | ucl_voidp wrkmem ); |
||
| 242 | |||
| 243 | |||
| 244 | #ifdef __cplusplus |
||
| 245 | } /* extern "C" */ |
||
| 246 | #endif |
||
| 247 | |||
| 248 | #endif /* already included */ |
||
| 249 |