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