tron@2186: /* $Id$ */ tron@2186: truelight@0: /* lzoconf.h -- configuration for the LZO real-time data compression library truelight@0: truelight@0: This file is part of the LZO real-time data compression library. truelight@0: truelight@0: Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer truelight@0: Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer truelight@0: Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer truelight@0: Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer truelight@0: Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer truelight@0: Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer truelight@0: Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer truelight@0: All Rights Reserved. truelight@0: truelight@0: The LZO library is free software; you can redistribute it and/or truelight@0: modify it under the terms of the GNU General Public License as truelight@0: published by the Free Software Foundation; either version 2 of truelight@0: the License, or (at your option) any later version. truelight@0: truelight@0: The LZO library is distributed in the hope that it will be useful, truelight@0: but WITHOUT ANY WARRANTY; without even the implied warranty of truelight@0: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the truelight@0: GNU General Public License for more details. truelight@0: truelight@0: You should have received a copy of the GNU General Public License truelight@0: along with the LZO library; see the file COPYING. truelight@0: If not, write to the Free Software Foundation, Inc., truelight@0: 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. truelight@0: truelight@0: Markus F.X.J. Oberhumer truelight@0: truelight@0: http://www.oberhumer.com/opensource/lzo/ truelight@0: */ truelight@0: truelight@0: Darkvater@2436: #ifndef LZOCONF_H Darkvater@2436: #define LZOCONF_H truelight@0: truelight@0: #define LZO_VERSION 0x1080 truelight@0: #define LZO_VERSION_STRING "1.08" truelight@0: #define LZO_VERSION_DATE "Jul 12 2002" truelight@0: truelight@0: /* internal Autoconf configuration file - only used when building LZO */ truelight@0: #if defined(LZO_HAVE_CONFIG_H) truelight@0: # include truelight@0: #endif truelight@0: #include truelight@0: truelight@0: #ifdef __cplusplus truelight@0: extern "C" { truelight@0: #endif truelight@0: truelight@0: truelight@0: /*********************************************************************** truelight@0: // LZO requires a conforming truelight@0: ************************************************************************/ truelight@0: truelight@0: #if !defined(CHAR_BIT) || (CHAR_BIT != 8) truelight@0: # error "invalid CHAR_BIT" truelight@0: #endif truelight@0: #if !defined(UCHAR_MAX) || !defined(UINT_MAX) || !defined(ULONG_MAX) truelight@0: # error "check your compiler installation" truelight@0: #endif truelight@0: #if (USHRT_MAX < 1) || (UINT_MAX < 1) || (ULONG_MAX < 1) truelight@0: # error "your limits.h macros are broken" truelight@0: #endif truelight@0: truelight@0: /* workaround a cpp bug under hpux 10.20 */ truelight@0: #define LZO_0xffffffffL 4294967295ul truelight@0: truelight@0: #if !defined(LZO_UINT32_C) truelight@0: # if (UINT_MAX < LZO_0xffffffffL) truelight@0: # define LZO_UINT32_C(c) c ## UL truelight@0: # else truelight@0: # define LZO_UINT32_C(c) c ## U truelight@0: # endif truelight@0: #endif truelight@0: truelight@0: truelight@0: /*********************************************************************** truelight@0: // architecture defines truelight@0: ************************************************************************/ truelight@0: truelight@0: #if !defined(__LZO_WIN) && !defined(__LZO_DOS) && !defined(__LZO_OS2) truelight@0: # if defined(__WINDOWS__) || defined(_WINDOWS) || defined(_Windows) truelight@0: # define __LZO_WIN truelight@0: # elif defined(__WIN32__) || defined(_WIN32) || defined(WIN32) truelight@0: # define __LZO_WIN truelight@0: # elif defined(__NT__) || defined(__NT_DLL__) || defined(__WINDOWS_386__) truelight@0: # define __LZO_WIN truelight@0: # elif defined(__DOS__) || defined(__MSDOS__) || defined(MSDOS) truelight@0: # define __LZO_DOS truelight@0: # elif defined(__OS2__) || defined(__OS2V2__) || defined(OS2) truelight@0: # define __LZO_OS2 truelight@0: # elif defined(__palmos__) truelight@0: # define __LZO_PALMOS truelight@0: # elif defined(__TOS__) || defined(__atarist__) truelight@0: # define __LZO_TOS truelight@0: # endif truelight@0: #endif truelight@0: truelight@0: #if (UINT_MAX < LZO_0xffffffffL) truelight@0: # if defined(__LZO_WIN) truelight@0: # define __LZO_WIN16 truelight@0: # elif defined(__LZO_DOS) truelight@0: # define __LZO_DOS16 truelight@0: # elif defined(__LZO_PALMOS) truelight@0: # define __LZO_PALMOS16 truelight@0: # elif defined(__LZO_TOS) truelight@0: # define __LZO_TOS16 truelight@0: # elif defined(__C166__) truelight@0: # else truelight@0: /* porting hint: for pure 16-bit architectures try compiling truelight@0: * everything with -D__LZO_STRICT_16BIT */ truelight@0: # error "16-bit target not supported - contact me for porting hints" truelight@0: # endif truelight@0: #endif truelight@0: truelight@0: #if !defined(__LZO_i386) truelight@0: # if defined(__LZO_DOS) || defined(__LZO_WIN16) truelight@0: # define __LZO_i386 truelight@0: # elif defined(__i386__) || defined(__386__) || defined(_M_IX86) truelight@0: # define __LZO_i386 truelight@0: # endif truelight@0: #endif truelight@0: truelight@0: #if defined(__LZO_STRICT_16BIT) truelight@0: # if (UINT_MAX < LZO_0xffffffffL) truelight@0: # include truelight@0: # endif truelight@0: #endif truelight@0: truelight@0: /* memory checkers */ truelight@0: #if !defined(__LZO_CHECKER) truelight@0: # if defined(__BOUNDS_CHECKING_ON) truelight@0: # define __LZO_CHECKER truelight@0: # elif defined(__CHECKER__) truelight@0: # define __LZO_CHECKER truelight@0: # elif defined(__INSURE__) truelight@0: # define __LZO_CHECKER truelight@0: # elif defined(__PURIFY__) truelight@0: # define __LZO_CHECKER truelight@0: # endif truelight@0: #endif truelight@0: truelight@0: truelight@0: /*********************************************************************** truelight@0: // integral and pointer types truelight@0: ************************************************************************/ truelight@0: truelight@0: /* Integral types with 32 bits or more */ truelight@0: #if !defined(LZO_UINT32_MAX) truelight@0: # if (UINT_MAX >= LZO_0xffffffffL) truelight@0: typedef unsigned int lzo_uint32; truelight@0: typedef int lzo_int32; truelight@0: # define LZO_UINT32_MAX UINT_MAX truelight@0: # define LZO_INT32_MAX INT_MAX truelight@0: # define LZO_INT32_MIN INT_MIN truelight@0: # elif (ULONG_MAX >= LZO_0xffffffffL) truelight@0: typedef unsigned long lzo_uint32; truelight@0: typedef long lzo_int32; truelight@0: # define LZO_UINT32_MAX ULONG_MAX truelight@0: # define LZO_INT32_MAX LONG_MAX truelight@0: # define LZO_INT32_MIN LONG_MIN truelight@0: # else truelight@0: # error "lzo_uint32" truelight@0: # endif truelight@0: #endif truelight@0: truelight@0: /* lzo_uint is used like size_t */ truelight@0: #if !defined(LZO_UINT_MAX) truelight@0: # if (UINT_MAX >= LZO_0xffffffffL) truelight@0: typedef unsigned int lzo_uint; truelight@0: typedef int lzo_int; truelight@0: # define LZO_UINT_MAX UINT_MAX truelight@0: # define LZO_INT_MAX INT_MAX truelight@0: # define LZO_INT_MIN INT_MIN truelight@0: # elif (ULONG_MAX >= LZO_0xffffffffL) truelight@0: typedef unsigned long lzo_uint; truelight@0: typedef long lzo_int; truelight@0: # define LZO_UINT_MAX ULONG_MAX truelight@0: # define LZO_INT_MAX LONG_MAX truelight@0: # define LZO_INT_MIN LONG_MIN truelight@0: # else truelight@0: # error "lzo_uint" truelight@0: # endif truelight@0: #endif truelight@0: truelight@0: typedef int lzo_bool; truelight@0: truelight@0: truelight@0: /*********************************************************************** truelight@0: // memory models truelight@0: ************************************************************************/ truelight@0: truelight@0: /* Memory model for the public code segment. */ truelight@0: #if !defined(__LZO_CMODEL) truelight@0: # if defined(__LZO_DOS16) || defined(__LZO_WIN16) truelight@0: # define __LZO_CMODEL __far truelight@0: # elif defined(__LZO_i386) && defined(__WATCOMC__) truelight@0: # define __LZO_CMODEL __near truelight@0: # else truelight@0: # define __LZO_CMODEL truelight@0: # endif truelight@0: #endif truelight@0: truelight@0: /* Memory model for the public data segment. */ truelight@0: #if !defined(__LZO_DMODEL) truelight@0: # if defined(__LZO_DOS16) || defined(__LZO_WIN16) truelight@0: # define __LZO_DMODEL __far truelight@0: # elif defined(__LZO_i386) && defined(__WATCOMC__) truelight@0: # define __LZO_DMODEL __near truelight@0: # else truelight@0: # define __LZO_DMODEL truelight@0: # endif truelight@0: #endif truelight@0: truelight@0: /* Memory model that allows to access memory at offsets of lzo_uint. */ truelight@0: #if !defined(__LZO_MMODEL) truelight@0: # if (LZO_UINT_MAX <= UINT_MAX) truelight@0: # define __LZO_MMODEL truelight@0: # elif defined(__LZO_DOS16) || defined(__LZO_WIN16) truelight@0: # define __LZO_MMODEL __huge truelight@0: # define LZO_999_UNSUPPORTED truelight@0: # elif defined(__LZO_PALMOS16) || defined(__LZO_TOS16) truelight@0: # define __LZO_MMODEL truelight@0: # else truelight@0: # error "__LZO_MMODEL" truelight@0: # endif truelight@0: #endif truelight@0: truelight@0: /* no typedef here because of const-pointer issues */ truelight@0: #define lzo_byte unsigned char __LZO_MMODEL truelight@0: #define lzo_bytep unsigned char __LZO_MMODEL * truelight@0: #define lzo_charp char __LZO_MMODEL * truelight@0: #define lzo_voidp void __LZO_MMODEL * truelight@0: #define lzo_shortp short __LZO_MMODEL * truelight@0: #define lzo_ushortp unsigned short __LZO_MMODEL * truelight@0: #define lzo_uint32p lzo_uint32 __LZO_MMODEL * truelight@0: #define lzo_int32p lzo_int32 __LZO_MMODEL * truelight@0: #define lzo_uintp lzo_uint __LZO_MMODEL * truelight@0: #define lzo_intp lzo_int __LZO_MMODEL * truelight@0: #define lzo_voidpp lzo_voidp __LZO_MMODEL * truelight@0: #define lzo_bytepp lzo_bytep __LZO_MMODEL * truelight@0: truelight@0: #ifndef lzo_sizeof_dict_t truelight@0: # define lzo_sizeof_dict_t sizeof(lzo_bytep) truelight@0: #endif truelight@0: truelight@0: truelight@0: /*********************************************************************** truelight@0: // calling conventions and function types truelight@0: ************************************************************************/ truelight@0: truelight@0: /* linkage */ truelight@0: #if !defined(__LZO_EXTERN_C) truelight@0: # ifdef __cplusplus truelight@0: # define __LZO_EXTERN_C extern "C" truelight@0: # else truelight@0: # define __LZO_EXTERN_C extern truelight@0: # endif truelight@0: #endif truelight@0: truelight@0: /* calling convention */ truelight@0: #if !defined(__LZO_CDECL) truelight@0: # if defined(__LZO_DOS16) || defined(__LZO_WIN16) truelight@0: # define __LZO_CDECL __LZO_CMODEL __cdecl truelight@0: # elif defined(__LZO_i386) && defined(_MSC_VER) truelight@0: # define __LZO_CDECL __LZO_CMODEL __cdecl truelight@0: # elif defined(__LZO_i386) && defined(__WATCOMC__) truelight@0: # define __LZO_CDECL __LZO_CMODEL __cdecl truelight@0: # else truelight@0: # define __LZO_CDECL __LZO_CMODEL truelight@0: # endif truelight@0: #endif truelight@0: #if !defined(__LZO_ENTRY) truelight@0: # define __LZO_ENTRY __LZO_CDECL truelight@0: #endif truelight@0: truelight@0: /* C++ exception specification for extern "C" function types */ truelight@0: #if !defined(__cplusplus) truelight@0: # undef LZO_NOTHROW truelight@0: # define LZO_NOTHROW truelight@0: #elif !defined(LZO_NOTHROW) truelight@0: # define LZO_NOTHROW truelight@0: #endif truelight@0: truelight@0: truelight@0: typedef int truelight@0: (__LZO_ENTRY *lzo_compress_t) ( const lzo_byte *src, lzo_uint src_len, truelight@0: lzo_byte *dst, lzo_uintp dst_len, truelight@0: lzo_voidp wrkmem ); truelight@0: truelight@0: typedef int truelight@0: (__LZO_ENTRY *lzo_decompress_t) ( const lzo_byte *src, lzo_uint src_len, truelight@0: lzo_byte *dst, lzo_uintp dst_len, truelight@0: lzo_voidp wrkmem ); truelight@0: truelight@0: typedef int truelight@0: (__LZO_ENTRY *lzo_optimize_t) ( lzo_byte *src, lzo_uint src_len, truelight@0: lzo_byte *dst, lzo_uintp dst_len, truelight@0: lzo_voidp wrkmem ); truelight@0: truelight@0: typedef int truelight@0: (__LZO_ENTRY *lzo_compress_dict_t)(const lzo_byte *src, lzo_uint src_len, truelight@0: lzo_byte *dst, lzo_uintp dst_len, truelight@0: lzo_voidp wrkmem, truelight@0: const lzo_byte *dict, lzo_uint dict_len ); truelight@0: truelight@0: typedef int truelight@0: (__LZO_ENTRY *lzo_decompress_dict_t)(const lzo_byte *src, lzo_uint src_len, truelight@0: lzo_byte *dst, lzo_uintp dst_len, truelight@0: lzo_voidp wrkmem, truelight@0: const lzo_byte *dict, lzo_uint dict_len ); truelight@0: truelight@0: truelight@0: /* assembler versions always use __cdecl */ truelight@0: typedef int truelight@0: (__LZO_CDECL *lzo_compress_asm_t)( const lzo_byte *src, lzo_uint src_len, truelight@0: lzo_byte *dst, lzo_uintp dst_len, truelight@0: lzo_voidp wrkmem ); truelight@0: truelight@0: typedef int truelight@0: (__LZO_CDECL *lzo_decompress_asm_t)( const lzo_byte *src, lzo_uint src_len, truelight@0: lzo_byte *dst, lzo_uintp dst_len, truelight@0: lzo_voidp wrkmem ); truelight@0: truelight@0: truelight@0: /* a progress indicator callback function */ truelight@0: typedef void (__LZO_ENTRY *lzo_progress_callback_t) (lzo_uint, lzo_uint); truelight@0: truelight@0: truelight@0: /*********************************************************************** truelight@0: // export information truelight@0: ************************************************************************/ truelight@0: truelight@0: /* DLL export information */ truelight@0: #if !defined(__LZO_EXPORT1) truelight@0: # define __LZO_EXPORT1 truelight@0: #endif truelight@0: #if !defined(__LZO_EXPORT2) truelight@0: # define __LZO_EXPORT2 truelight@0: #endif truelight@0: truelight@0: /* exported calling convention for C functions */ truelight@0: #if !defined(LZO_PUBLIC) truelight@0: # define LZO_PUBLIC(_rettype) \ truelight@0: __LZO_EXPORT1 _rettype __LZO_EXPORT2 __LZO_ENTRY truelight@0: #endif truelight@0: #if !defined(LZO_EXTERN) truelight@0: # define LZO_EXTERN(_rettype) __LZO_EXTERN_C LZO_PUBLIC(_rettype) truelight@0: #endif truelight@0: #if !defined(LZO_PRIVATE) truelight@0: # define LZO_PRIVATE(_rettype) static _rettype __LZO_ENTRY truelight@0: #endif truelight@0: truelight@0: /* exported __cdecl calling convention for assembler functions */ truelight@0: #if !defined(LZO_PUBLIC_CDECL) truelight@0: # define LZO_PUBLIC_CDECL(_rettype) \ truelight@0: __LZO_EXPORT1 _rettype __LZO_EXPORT2 __LZO_CDECL truelight@0: #endif truelight@0: #if !defined(LZO_EXTERN_CDECL) truelight@0: # define LZO_EXTERN_CDECL(_rettype) __LZO_EXTERN_C LZO_PUBLIC_CDECL(_rettype) truelight@0: #endif truelight@0: truelight@0: /* exported global variables (LZO currently uses no static variables and truelight@0: * is fully thread safe) */ truelight@0: #if !defined(LZO_PUBLIC_VAR) truelight@0: # define LZO_PUBLIC_VAR(_type) \ truelight@0: __LZO_EXPORT1 _type __LZO_EXPORT2 __LZO_DMODEL truelight@0: #endif truelight@0: #if !defined(LZO_EXTERN_VAR) truelight@0: # define LZO_EXTERN_VAR(_type) extern LZO_PUBLIC_VAR(_type) truelight@0: #endif truelight@0: truelight@0: truelight@0: /*********************************************************************** truelight@0: // error codes and prototypes truelight@0: ************************************************************************/ truelight@0: truelight@0: /* Error codes for the compression/decompression functions. Negative truelight@0: * values are errors, positive values will be used for special but truelight@0: * normal events. truelight@0: */ truelight@0: #define LZO_E_OK 0 truelight@0: #define LZO_E_ERROR (-1) truelight@0: #define LZO_E_OUT_OF_MEMORY (-2) /* not used right now */ truelight@0: #define LZO_E_NOT_COMPRESSIBLE (-3) /* not used right now */ truelight@0: #define LZO_E_INPUT_OVERRUN (-4) truelight@0: #define LZO_E_OUTPUT_OVERRUN (-5) truelight@0: #define LZO_E_LOOKBEHIND_OVERRUN (-6) truelight@0: #define LZO_E_EOF_NOT_FOUND (-7) truelight@0: #define LZO_E_INPUT_NOT_CONSUMED (-8) truelight@0: truelight@0: truelight@0: /* lzo_init() should be the first function you call. truelight@0: * Check the return code ! truelight@0: * truelight@0: * lzo_init() is a macro to allow checking that the library and the truelight@0: * compiler's view of various types are consistent. truelight@0: */ truelight@0: #define lzo_init() __lzo_init2(LZO_VERSION,(int)sizeof(short),(int)sizeof(int),\ truelight@0: (int)sizeof(long),(int)sizeof(lzo_uint32),(int)sizeof(lzo_uint),\ truelight@0: (int)lzo_sizeof_dict_t,(int)sizeof(char *),(int)sizeof(lzo_voidp),\ truelight@0: (int)sizeof(lzo_compress_t)) truelight@0: LZO_EXTERN(int) __lzo_init2(unsigned,int,int,int,int,int,int,int,int,int); truelight@0: truelight@0: /* version functions (useful for shared libraries) */ truelight@0: LZO_EXTERN(unsigned) lzo_version(void); truelight@0: LZO_EXTERN(const char *) lzo_version_string(void); truelight@0: LZO_EXTERN(const char *) lzo_version_date(void); truelight@0: LZO_EXTERN(const lzo_charp) _lzo_version_string(void); truelight@0: LZO_EXTERN(const lzo_charp) _lzo_version_date(void); truelight@0: truelight@0: /* string functions */ truelight@0: LZO_EXTERN(int) truelight@0: lzo_memcmp(const lzo_voidp _s1, const lzo_voidp _s2, lzo_uint _len); truelight@0: LZO_EXTERN(lzo_voidp) truelight@0: lzo_memcpy(lzo_voidp _dest, const lzo_voidp _src, lzo_uint _len); truelight@0: LZO_EXTERN(lzo_voidp) truelight@0: lzo_memmove(lzo_voidp _dest, const lzo_voidp _src, lzo_uint _len); truelight@0: LZO_EXTERN(lzo_voidp) truelight@0: lzo_memset(lzo_voidp _s, int _c, lzo_uint _len); truelight@0: truelight@0: /* checksum functions */ truelight@0: LZO_EXTERN(lzo_uint32) truelight@0: lzo_adler32(lzo_uint32 _adler, const lzo_byte *_buf, lzo_uint _len); truelight@0: LZO_EXTERN(lzo_uint32) truelight@0: lzo_crc32(lzo_uint32 _c, const lzo_byte *_buf, lzo_uint _len); truelight@0: truelight@0: /* misc. */ truelight@0: LZO_EXTERN(lzo_bool) lzo_assert(int _expr); truelight@0: LZO_EXTERN(int) _lzo_config_check(void); truelight@0: typedef union { lzo_bytep p; lzo_uint u; } __lzo_pu_u; truelight@0: typedef union { lzo_bytep p; lzo_uint32 u32; } __lzo_pu32_u; truelight@0: typedef union { void *vp; lzo_bytep bp; lzo_uint32 u32; long l; } lzo_align_t; truelight@0: truelight@0: /* align a char pointer on a boundary that is a multiple of `size' */ truelight@0: LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp _ptr, lzo_uint _size); truelight@0: #define LZO_PTR_ALIGN_UP(_ptr,_size) \ truelight@0: ((_ptr) + (lzo_uint) __lzo_align_gap((const lzo_voidp)(_ptr),(lzo_uint)(_size))) truelight@0: truelight@0: /* deprecated - only for backward compatibility */ truelight@0: #define LZO_ALIGN(_ptr,_size) LZO_PTR_ALIGN_UP(_ptr,_size) truelight@0: truelight@0: truelight@0: #ifdef __cplusplus truelight@0: } /* extern "C" */ truelight@0: #endif truelight@0: Darkvater@2436: #endif /* LZOCONF_H */