LZOCONF.H (7014B)
1 // 2 // Copyright 2020 Electronic Arts Inc. 3 // 4 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is free 5 // software: you can redistribute it and/or modify it under the terms of 6 // the GNU General Public License as published by the Free Software Foundation, 7 // either version 3 of the License, or (at your option) any later version. 8 9 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed 10 // in the hope that it will be useful, but with permitted additional restrictions 11 // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT 12 // distributed with this program. You should have received a copy of the 13 // GNU General Public License along with permitted additional restrictions 14 // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection 15 16 /* lzoconf.h -- configuration for the LZO real-time data compression library 17 18 This file is part of the LZO real-time data compression library. 19 20 Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer 21 22 The LZO library is free software; you can redistribute it and/or 23 modify it under the terms of the GNU Library General Public 24 License as published by the Free Software Foundation; either 25 version 2 of the License, or (at your option) any later version. 26 27 The LZO library is distributed in the hope that it will be useful, 28 but WITHOUT ANY WARRANTY; without even the implied warranty of 29 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 30 Library General Public License for more details. 31 32 You should have received a copy of the GNU Library General Public 33 License along with the LZO library; see the file COPYING.LIB. 34 If not, write to the Free Software Foundation, Inc., 35 675 Mass Ave, Cambridge, MA 02139, USA. 36 37 Markus F.X.J. Oberhumer 38 markus.oberhumer@jk.uni-linz.ac.at 39 */ 40 41 42 #ifndef __LZOCONF_H 43 #define __LZOCONF_H 44 45 #define LZO_VERSION 0x0200 46 #define LZO_VERSION_STRING "0.20" 47 #define LZO_VERSION_DATE "11 Aug 1996" 48 49 50 #include <limits.h> /* CHAR_BIT, UINT_MAX, ULONG_MAX */ 51 #if !defined(CHAR_BIT) || (CHAR_BIT != 8) 52 # error invalid CHAR_BIT 53 #endif 54 55 //#ifdef __cplusplus 56 //extern "C" { 57 //#endif 58 59 60 /*********************************************************************** 61 // defines 62 ************************************************************************/ 63 64 #if defined(__MSDOS__) || defined(MSDOS) 65 # define __LZO_MSDOS 66 # if (UINT_MAX < 0xffffffffL) 67 # define __LZO_MSDOS16 68 # endif 69 #endif 70 71 72 /*********************************************************************** 73 // integral and pointer types 74 ************************************************************************/ 75 76 /* Unsigned type with 32 bits or more */ 77 #if (UINT_MAX >= 0xffffffffL) 78 typedef unsigned int lzo_uint; 79 typedef int lzo_int; 80 # define LZO_UINT_MAX UINT_MAX 81 #elif (ULONG_MAX >= 0xffffffffL) 82 typedef unsigned long lzo_uint; 83 typedef long lzo_int; 84 # define LZO_UINT_MAX ULONG_MAX 85 #else 86 # error lzo_uint 87 #endif 88 89 90 /* Memory model that allows to access memory at offsets of lzo_uint. 91 * Huge pointers (16 bit MSDOS) are somewhat slow, but they work 92 * fine and I really don't care about 16 bit compiler 93 * optimizations nowadays. 94 */ 95 #if (LZO_UINT_MAX <= UINT_MAX) 96 # define __LZO_MMODEL 97 #elif defined(__LZO_MSDOS16) 98 # define __LZO_MMODEL huge 99 # define __LZO_ENTRY __cdecl 100 #else 101 # error __LZO_MMODEL 102 #endif 103 104 105 /* no typedef here because of const-pointer issues */ 106 #define lzo_byte unsigned char __LZO_MMODEL 107 #define lzo_voidp void __LZO_MMODEL * 108 #define lzo_bytep unsigned char __LZO_MMODEL * 109 #define lzo_uintp lzo_uint __LZO_MMODEL * 110 #define lzo_intp lzo_int __LZO_MMODEL * 111 #define lzo_voidpp lzo_voidp __LZO_MMODEL * 112 #define lzo_bytepp lzo_bytep __LZO_MMODEL * 113 114 115 /* Unsigned type that can store all bits of a lzo_voidp */ 116 typedef unsigned long lzo_ptr_t; 117 118 /* Align a pointer on a boundary that is a multiple of 'size' */ 119 #define LZO_ALIGN(ptr,size) \ 120 ((lzo_voidp) (((lzo_ptr_t)(ptr) + (size)-1) & ~((lzo_ptr_t)((size)-1)))) 121 122 123 /*********************************************************************** 124 // function types 125 ************************************************************************/ 126 127 //#ifdef __cplusplus 128 //# define LZO_EXTERN_C extern "C" 129 //#else 130 # define LZO_EXTERN_C extern 131 //#endif 132 133 134 #if !defined(__LZO_ENTRY) /* calling convention */ 135 # define __LZO_ENTRY 136 #endif 137 #if !defined(__LZO_EXPORT) /* DLL export (and maybe size) information */ 138 # define __LZO_EXPORT 139 #endif 140 141 #if !defined(LZO_EXTERN) 142 # define LZO_EXTERN(_rettype) LZO_EXTERN_C _rettype __LZO_ENTRY __LZO_EXPORT 143 #endif 144 145 146 typedef int __LZO_ENTRY 147 (__LZO_EXPORT *lzo_compress_t) ( const lzo_byte *src, lzo_uint src_len, 148 lzo_byte *dst, lzo_uint *dst_len, 149 lzo_voidp wrkmem ); 150 151 typedef int __LZO_ENTRY 152 (__LZO_EXPORT *lzo_decompress_t)( const lzo_byte *src, lzo_uint src_len, 153 lzo_byte *dst, lzo_uint *dst_len, 154 lzo_voidp wrkmem ); 155 156 157 /* a progress indicator callback function */ 158 typedef void __LZO_ENTRY 159 (__LZO_EXPORT *lzo_progress_callback_t)(lzo_uint,lzo_uint); 160 161 162 /*********************************************************************** 163 // error codes and prototypes 164 ************************************************************************/ 165 166 /* Error codes for the compression/decompression functions. Negative 167 * values are errors, positive values will be used for special but 168 * normal events. 169 */ 170 #define LZO_E_OK 0 171 #define LZO_E_ERROR (-1) 172 #define LZO_E_NOT_COMPRESSIBLE (-2) /* not used right now */ 173 #define LZO_E_EOF_NOT_FOUND (-3) 174 #define LZO_E_INPUT_OVERRUN (-4) 175 #define LZO_E_OUTPUT_OVERRUN (-5) 176 #define LZO_E_LOOKBEHIND_OVERRUN (-6) 177 #define LZO_E_OUT_OF_MEMORY (-7) /* not used right now */ 178 179 180 /* this should be the first function you call. Check the return code ! */ 181 LZO_EXTERN(int) lzo_init(void); 182 183 /* version functions (useful for shared libraries) */ 184 LZO_EXTERN(unsigned) lzo_version(void); 185 LZO_EXTERN(const char *) lzo_version_string(void); 186 187 /* string functions */ 188 LZO_EXTERN(int) 189 lzo_memcmp(const lzo_voidp _s1, const lzo_voidp _s2, lzo_uint _len); 190 LZO_EXTERN(lzo_voidp) 191 lzo_memcpy(lzo_voidp _dest, const lzo_voidp _src, lzo_uint _len); 192 LZO_EXTERN(lzo_voidp) 193 lzo_memmove(lzo_voidp _dest, const lzo_voidp _src, lzo_uint _len); 194 LZO_EXTERN(lzo_voidp) 195 lzo_memset(lzo_voidp _s, int _c, lzo_uint _len); 196 197 /* checksum functions */ 198 LZO_EXTERN(lzo_uint) 199 lzo_adler32(lzo_uint _adler, const lzo_byte *_buf, lzo_uint _len); 200 201 /* misc. */ 202 LZO_EXTERN(int) lzo_assert(int _expr); 203 LZO_EXTERN(int) _lzo_config_check(void); 204 205 206 //#ifdef __cplusplus 207 //} /* extern "C" */ 208 //#endif 209 210 #endif /* already included */ 211 212 /* 213 vi:ts=4 214 */