Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 26 | pmbaty | 1 | /* minilzo.h -- mini subset of the LZO real-time data compression library |
| 2 | |||
| 3 | This file is part of the LZO real-time data compression library. |
||
| 4 | |||
| 5 | Copyright (C) 1996-2017 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 | * NOTE: |
||
| 30 | * the full LZO package can be found at |
||
| 31 | * http://www.oberhumer.com/opensource/lzo/ |
||
| 32 | */ |
||
| 33 | |||
| 34 | |||
| 35 | #ifndef __MINILZO_H_INCLUDED |
||
| 36 | #define __MINILZO_H_INCLUDED 1 |
||
| 37 | |||
| 38 | #define MINILZO_VERSION 0x20a0 /* 2.10 */ |
||
| 39 | |||
| 40 | #if defined(__LZOCONF_H_INCLUDED) |
||
| 41 | # error "you cannot use both LZO and miniLZO" |
||
| 42 | #endif |
||
| 43 | |||
| 44 | /* internal Autoconf configuration file - only used when building miniLZO */ |
||
| 45 | #ifdef MINILZO_HAVE_CONFIG_H |
||
| 46 | # include <config.h> |
||
| 47 | #endif |
||
| 48 | #include <limits.h> |
||
| 49 | #include <stddef.h> |
||
| 50 | |||
| 51 | #ifndef __LZODEFS_H_INCLUDED |
||
| 52 | #include "lzodefs.h" |
||
| 53 | #endif |
||
| 54 | #undef LZO_HAVE_CONFIG_H |
||
| 55 | #include "lzoconf.h" |
||
| 56 | |||
| 57 | #if !defined(LZO_VERSION) || (LZO_VERSION != MINILZO_VERSION) |
||
| 58 | # error "version mismatch in header files" |
||
| 59 | #endif |
||
| 60 | |||
| 61 | |||
| 62 | #ifdef __cplusplus |
||
| 63 | extern "C" { |
||
| 64 | #endif |
||
| 65 | |||
| 66 | |||
| 67 | /*********************************************************************** |
||
| 68 | // |
||
| 69 | ************************************************************************/ |
||
| 70 | |||
| 71 | /* Memory required for the wrkmem parameter. |
||
| 72 | * When the required size is 0, you can also pass a NULL pointer. |
||
| 73 | */ |
||
| 74 | |||
| 75 | #define LZO1X_MEM_COMPRESS LZO1X_1_MEM_COMPRESS |
||
| 76 | #define LZO1X_1_11_MEM_COMPRESS ((lzo_uint32_t) (2048L * lzo_sizeof_dict_t)) // Pierre-Marie Baty -- added definition |
||
| 77 | #define LZO1X_1_12_MEM_COMPRESS ((lzo_uint32_t) (4096L * lzo_sizeof_dict_t)) // Pierre-Marie Baty -- added definition |
||
| 78 | #define LZO1X_1_MEM_COMPRESS ((lzo_uint32_t) (16384L * lzo_sizeof_dict_t)) |
||
| 79 | #define LZO1X_1_15_MEM_COMPRESS ((lzo_uint32_t) (32768L * lzo_sizeof_dict_t)) // Pierre-Marie Baty -- added definition |
||
| 80 | #define LZO1X_999_MEM_COMPRESS ((lzo_uint32_t) (14 * 16384L * sizeof(short))) // Pierre-Marie Baty -- added definition |
||
| 81 | #define LZO1X_MEM_DECOMPRESS (0) |
||
| 82 | |||
| 83 | |||
| 84 | /* compression */ |
||
| 85 | LZO_EXTERN(int) |
||
| 86 | lzo1x_1_compress ( const lzo_bytep src, lzo_uint src_len, |
||
| 87 | lzo_bytep dst, lzo_uintp dst_len, |
||
| 88 | lzo_voidp wrkmem ); |
||
| 89 | |||
| 90 | /* decompression */ |
||
| 91 | LZO_EXTERN(int) |
||
| 92 | lzo1x_decompress ( const lzo_bytep src, lzo_uint src_len, |
||
| 93 | lzo_bytep dst, lzo_uintp dst_len, |
||
| 94 | lzo_voidp wrkmem /* NOT USED */ ); |
||
| 95 | |||
| 96 | /* safe decompression with overrun testing */ |
||
| 97 | LZO_EXTERN(int) |
||
| 98 | lzo1x_decompress_safe ( const lzo_bytep src, lzo_uint src_len, |
||
| 99 | lzo_bytep dst, lzo_uintp dst_len, |
||
| 100 | lzo_voidp wrkmem /* NOT USED */ ); |
||
| 101 | |||
| 102 | |||
| 103 | #ifdef __cplusplus |
||
| 104 | } /* extern "C" */ |
||
| 105 | #endif |
||
| 106 | |||
| 107 | #endif /* already included */ |
||
| 108 | |||
| 109 | |||
| 110 | /* vim:set ts=4 sw=4 et: */ |