2N/A/* lzoconf.h -- configuration of the LZO data compression library
2N/A
2N/A This file is part of the LZO real-time data compression library.
2N/A
2N/A Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
2N/A Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
2N/A Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
2N/A Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
2N/A Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
2N/A Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
2N/A Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
2N/A Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
2N/A Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
2N/A Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
2N/A Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
2N/A Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
2N/A Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
2N/A Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
2N/A Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
2N/A Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
2N/A All Rights Reserved.
2N/A
2N/A The LZO library is free software; you can redistribute it and/or
2N/A modify it under the terms of the GNU General Public License as
2N/A published by the Free Software Foundation; either version 2 of
2N/A the License, or (at your option) any later version.
2N/A
2N/A The LZO library is distributed in the hope that it will be useful,
2N/A but WITHOUT ANY WARRANTY; without even the implied warranty of
2N/A MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2N/A GNU General Public License for more details.
2N/A
2N/A You should have received a copy of the GNU General Public License
2N/A along with the LZO library; see the file COPYING.
2N/A If not, write to the Free Software Foundation, Inc.,
2N/A 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2N/A
2N/A Markus F.X.J. Oberhumer
2N/A <markus@oberhumer.com>
2N/A http://www.oberhumer.com/opensource/lzo/
2N/A */
2N/A
2N/A
2N/A#ifndef __LZOCONF_H_INCLUDED
2N/A#define __LZOCONF_H_INCLUDED 1
2N/A
2N/A#define LZO_VERSION 0x2050
2N/A#define LZO_VERSION_STRING "2.05"
2N/A#define LZO_VERSION_DATE "Apr 23 2011"
2N/A
2N/A/* internal Autoconf configuration file - only used when building LZO */
2N/A#if defined(LZO_HAVE_CONFIG_H)
2N/A# include <config.h>
2N/A#endif
2N/A#include <limits.h>
2N/A#include <stddef.h>
2N/A
2N/A
2N/A/***********************************************************************
2N/A// LZO requires a conforming <limits.h>
2N/A************************************************************************/
2N/A
2N/A#if !defined(CHAR_BIT) || (CHAR_BIT != 8)
2N/A# error "invalid CHAR_BIT"
2N/A#endif
2N/A#if !defined(UCHAR_MAX) || !defined(UINT_MAX) || !defined(ULONG_MAX)
2N/A# error "check your compiler installation"
2N/A#endif
2N/A#if (USHRT_MAX < 1) || (UINT_MAX < 1) || (ULONG_MAX < 1)
2N/A# error "your limits.h macros are broken"
2N/A#endif
2N/A
2N/A/* get OS and architecture defines */
2N/A#ifndef __LZODEFS_H_INCLUDED
2N/A#include "lzodefs.h"
2N/A#endif
2N/A
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A
2N/A/***********************************************************************
2N/A// some core defines
2N/A************************************************************************/
2N/A
2N/A#if !defined(LZO_UINT32_C)
2N/A# if (UINT_MAX < LZO_0xffffffffL)
2N/A# define LZO_UINT32_C(c) c ## UL
2N/A# else
2N/A# define LZO_UINT32_C(c) ((c) + 0U)
2N/A# endif
2N/A#endif
2N/A
2N/A/* memory checkers */
2N/A#if !defined(__LZO_CHECKER)
2N/A# if defined(__BOUNDS_CHECKING_ON)
2N/A# define __LZO_CHECKER 1
2N/A# elif defined(__CHECKER__)
2N/A# define __LZO_CHECKER 1
2N/A# elif defined(__INSURE__)
2N/A# define __LZO_CHECKER 1
2N/A# elif defined(__PURIFY__)
2N/A# define __LZO_CHECKER 1
2N/A# endif
2N/A#endif
2N/A
2N/A
2N/A/***********************************************************************
2N/A// integral and pointer types
2N/A************************************************************************/
2N/A
2N/A/* lzo_uint should match size_t */
2N/A#if !defined(LZO_UINT_MAX)
2N/A# if defined(LZO_ABI_LLP64) /* WIN64 */
2N/A# if defined(LZO_OS_WIN64)
2N/A typedef unsigned __int64 lzo_uint;
2N/A typedef __int64 lzo_int;
2N/A# else
2N/A typedef unsigned long long lzo_uint;
2N/A typedef long long lzo_int;
2N/A# endif
2N/A# define LZO_UINT_MAX 0xffffffffffffffffull
2N/A# define LZO_INT_MAX 9223372036854775807LL
2N/A# define LZO_INT_MIN (-1LL - LZO_INT_MAX)
2N/A# elif defined(LZO_ABI_IP32L64) /* MIPS R5900 */
2N/A typedef unsigned int lzo_uint;
2N/A typedef int lzo_int;
2N/A# define LZO_UINT_MAX UINT_MAX
2N/A# define LZO_INT_MAX INT_MAX
2N/A# define LZO_INT_MIN INT_MIN
2N/A# elif (ULONG_MAX >= LZO_0xffffffffL)
2N/A typedef unsigned long lzo_uint;
2N/A typedef long lzo_int;
2N/A# define LZO_UINT_MAX ULONG_MAX
2N/A# define LZO_INT_MAX LONG_MAX
2N/A# define LZO_INT_MIN LONG_MIN
2N/A# else
2N/A# error "lzo_uint"
2N/A# endif
2N/A#endif
2N/A
2N/A/* Integral types with 32 bits or more. */
2N/A#if !defined(LZO_UINT32_MAX)
2N/A# if (UINT_MAX >= LZO_0xffffffffL)
2N/A typedef unsigned int lzo_uint32;
2N/A typedef int lzo_int32;
2N/A# define LZO_UINT32_MAX UINT_MAX
2N/A# define LZO_INT32_MAX INT_MAX
2N/A# define LZO_INT32_MIN INT_MIN
2N/A# elif (ULONG_MAX >= LZO_0xffffffffL)
2N/A typedef unsigned long lzo_uint32;
2N/A typedef long lzo_int32;
2N/A# define LZO_UINT32_MAX ULONG_MAX
2N/A# define LZO_INT32_MAX LONG_MAX
2N/A# define LZO_INT32_MIN LONG_MIN
2N/A# else
2N/A# error "lzo_uint32"
2N/A# endif
2N/A#endif
2N/A
2N/A/* Integral types with exactly 64 bits. */
2N/A#if !defined(LZO_UINT64_MAX)
2N/A# if (LZO_UINT_MAX >= LZO_0xffffffffL)
2N/A# if ((((LZO_UINT_MAX) >> 31) >> 31) == 3)
2N/A# define lzo_uint64 lzo_uint
2N/A# define lzo_int64 lzo_int
2N/A# define LZO_UINT64_MAX LZO_UINT_MAX
2N/A# define LZO_INT64_MAX LZO_INT_MAX
2N/A# define LZO_INT64_MIN LZO_INT_MIN
2N/A# endif
2N/A# elif (ULONG_MAX >= LZO_0xffffffffL)
2N/A# if ((((ULONG_MAX) >> 31) >> 31) == 3)
2N/A typedef unsigned long lzo_uint64;
2N/A typedef long lzo_int64;
2N/A# define LZO_UINT64_MAX ULONG_MAX
2N/A# define LZO_INT64_MAX LONG_MAX
2N/A# define LZO_INT64_MIN LONG_MIN
2N/A# endif
2N/A# endif
2N/A#endif
2N/A
2N/A/* The larger type of lzo_uint and lzo_uint32. */
2N/A#if (LZO_UINT_MAX >= LZO_UINT32_MAX)
2N/A# define lzo_xint lzo_uint
2N/A#else
2N/A# define lzo_xint lzo_uint32
2N/A#endif
2N/A
2N/A/* Memory model that allows to access memory at offsets of lzo_uint. */
2N/A#if !defined(__LZO_MMODEL)
2N/A# if (LZO_UINT_MAX <= UINT_MAX)
2N/A# define __LZO_MMODEL /*empty*/
2N/A# elif defined(LZO_HAVE_MM_HUGE_PTR)
2N/A# define __LZO_MMODEL_HUGE 1
2N/A# define __LZO_MMODEL __huge
2N/A# else
2N/A# define __LZO_MMODEL /*empty*/
2N/A# endif
2N/A#endif
2N/A
2N/A/* no typedef here because of const-pointer issues */
2N/A#define lzo_bytep unsigned char __LZO_MMODEL *
2N/A#define lzo_charp char __LZO_MMODEL *
2N/A#define lzo_voidp void __LZO_MMODEL *
2N/A#define lzo_shortp short __LZO_MMODEL *
2N/A#define lzo_ushortp unsigned short __LZO_MMODEL *
2N/A#define lzo_uint32p lzo_uint32 __LZO_MMODEL *
2N/A#define lzo_int32p lzo_int32 __LZO_MMODEL *
2N/A#if defined(LZO_UINT64_MAX)
2N/A#define lzo_uint64p lzo_uint64 __LZO_MMODEL *
2N/A#define lzo_int64p lzo_int64 __LZO_MMODEL *
2N/A#endif
2N/A#define lzo_uintp lzo_uint __LZO_MMODEL *
2N/A#define lzo_intp lzo_int __LZO_MMODEL *
2N/A#define lzo_xintp lzo_xint __LZO_MMODEL *
2N/A#define lzo_voidpp lzo_voidp __LZO_MMODEL *
2N/A#define lzo_bytepp lzo_bytep __LZO_MMODEL *
2N/A/* deprecated - use 'lzo_bytep' instead of 'lzo_byte *' */
2N/A#define lzo_byte unsigned char __LZO_MMODEL
2N/A
2N/Atypedef int lzo_bool;
2N/A
2N/A
2N/A/***********************************************************************
2N/A// function types
2N/A************************************************************************/
2N/A
2N/A/* name mangling */
2N/A#if !defined(__LZO_EXTERN_C)
2N/A# ifdef __cplusplus
2N/A# define __LZO_EXTERN_C extern "C"
2N/A# else
2N/A# define __LZO_EXTERN_C extern
2N/A# endif
2N/A#endif
2N/A
2N/A/* calling convention */
2N/A#if !defined(__LZO_CDECL)
2N/A# define __LZO_CDECL __lzo_cdecl
2N/A#endif
2N/A
2N/A/* DLL export information */
2N/A#if !defined(__LZO_EXPORT1)
2N/A# define __LZO_EXPORT1 /*empty*/
2N/A#endif
2N/A#if !defined(__LZO_EXPORT2)
2N/A# define __LZO_EXPORT2 /*empty*/
2N/A#endif
2N/A
2N/A/* __cdecl calling convention for public C and assembly functions */
2N/A#if !defined(LZO_PUBLIC)
2N/A# define LZO_PUBLIC(_rettype) __LZO_EXPORT1 _rettype __LZO_EXPORT2 __LZO_CDECL
2N/A#endif
2N/A#if !defined(LZO_EXTERN)
2N/A# define LZO_EXTERN(_rettype) __LZO_EXTERN_C LZO_PUBLIC(_rettype)
2N/A#endif
2N/A#if !defined(LZO_PRIVATE)
2N/A# define LZO_PRIVATE(_rettype) static _rettype __LZO_CDECL
2N/A#endif
2N/A
2N/A/* function types */
2N/Atypedef int
2N/A(__LZO_CDECL *lzo_compress_t) ( const lzo_bytep src, lzo_uint src_len,
2N/A lzo_bytep dst, lzo_uintp dst_len,
2N/A lzo_voidp wrkmem );
2N/A
2N/Atypedef int
2N/A(__LZO_CDECL *lzo_decompress_t) ( const lzo_bytep src, lzo_uint src_len,
2N/A lzo_bytep dst, lzo_uintp dst_len,
2N/A lzo_voidp wrkmem );
2N/A
2N/Atypedef int
2N/A(__LZO_CDECL *lzo_optimize_t) ( lzo_bytep src, lzo_uint src_len,
2N/A lzo_bytep dst, lzo_uintp dst_len,
2N/A lzo_voidp wrkmem );
2N/A
2N/Atypedef int
2N/A(__LZO_CDECL *lzo_compress_dict_t)(const lzo_bytep src, lzo_uint src_len,
2N/A lzo_bytep dst, lzo_uintp dst_len,
2N/A lzo_voidp wrkmem,
2N/A const lzo_bytep dict, lzo_uint dict_len );
2N/A
2N/Atypedef int
2N/A(__LZO_CDECL *lzo_decompress_dict_t)(const lzo_bytep src, lzo_uint src_len,
2N/A lzo_bytep dst, lzo_uintp dst_len,
2N/A lzo_voidp wrkmem,
2N/A const lzo_bytep dict, lzo_uint dict_len );
2N/A
2N/A
2N/A/* Callback interface. Currently only the progress indicator ("nprogress")
2N/A * is used, but this may change in a future release. */
2N/A
2N/Astruct lzo_callback_t;
2N/Atypedef struct lzo_callback_t lzo_callback_t;
2N/A#define lzo_callback_p lzo_callback_t __LZO_MMODEL *
2N/A
2N/A/* malloc & free function types */
2N/Atypedef lzo_voidp (__LZO_CDECL *lzo_alloc_func_t)
2N/A (lzo_callback_p self, lzo_uint items, lzo_uint size);
2N/Atypedef void (__LZO_CDECL *lzo_free_func_t)
2N/A (lzo_callback_p self, lzo_voidp ptr);
2N/A
2N/A/* a progress indicator callback function */
2N/Atypedef void (__LZO_CDECL *lzo_progress_func_t)
2N/A (lzo_callback_p, lzo_uint, lzo_uint, int);
2N/A
2N/Astruct lzo_callback_t
2N/A{
2N/A /* custom allocators (set to 0 to disable) */
2N/A lzo_alloc_func_t nalloc; /* [not used right now] */
2N/A lzo_free_func_t nfree; /* [not used right now] */
2N/A
2N/A /* a progress indicator callback function (set to 0 to disable) */
2N/A lzo_progress_func_t nprogress;
2N/A
2N/A /* NOTE: the first parameter "self" of the nalloc/nfree/nprogress
2N/A * callbacks points back to this struct, so you are free to store
2N/A * some extra info in the following variables. */
2N/A lzo_voidp user1;
2N/A lzo_xint user2;
2N/A lzo_xint user3;
2N/A};
2N/A
2N/A
2N/A/***********************************************************************
2N/A// error codes and prototypes
2N/A************************************************************************/
2N/A
2N/A/* Error codes for the compression/decompression functions. Negative
2N/A * values are errors, positive values will be used for special but
2N/A * normal events.
2N/A */
2N/A#define LZO_E_OK 0
2N/A#define LZO_E_ERROR (-1)
2N/A#define LZO_E_OUT_OF_MEMORY (-2) /* [lzo_alloc_func_t failure] */
2N/A#define LZO_E_NOT_COMPRESSIBLE (-3) /* [not used right now] */
2N/A#define LZO_E_INPUT_OVERRUN (-4)
2N/A#define LZO_E_OUTPUT_OVERRUN (-5)
2N/A#define LZO_E_LOOKBEHIND_OVERRUN (-6)
2N/A#define LZO_E_EOF_NOT_FOUND (-7)
2N/A#define LZO_E_INPUT_NOT_CONSUMED (-8)
2N/A#define LZO_E_NOT_YET_IMPLEMENTED (-9) /* [not used right now] */
2N/A#define LZO_E_INVALID_ARGUMENT (-10)
2N/A
2N/A
2N/A#ifndef lzo_sizeof_dict_t
2N/A# define lzo_sizeof_dict_t ((unsigned)sizeof(lzo_bytep))
2N/A#endif
2N/A
2N/A/* lzo_init() should be the first function you call.
2N/A * Check the return code !
2N/A *
2N/A * lzo_init() is a macro to allow checking that the library and the
2N/A * compiler's view of various types are consistent.
2N/A */
2N/A#define lzo_init() __lzo_init_v2(LZO_VERSION,(int)sizeof(short),(int)sizeof(int),\
2N/A (int)sizeof(long),(int)sizeof(lzo_uint32),(int)sizeof(lzo_uint),\
2N/A (int)lzo_sizeof_dict_t,(int)sizeof(char *),(int)sizeof(lzo_voidp),\
2N/A (int)sizeof(lzo_callback_t))
2N/ALZO_EXTERN(int) __lzo_init_v2(unsigned,int,int,int,int,int,int,int,int,int);
2N/A
2N/A/* version functions (useful for shared libraries) */
2N/ALZO_EXTERN(unsigned) lzo_version(void);
2N/ALZO_EXTERN(const char *) lzo_version_string(void);
2N/ALZO_EXTERN(const char *) lzo_version_date(void);
2N/ALZO_EXTERN(const lzo_charp) _lzo_version_string(void);
2N/ALZO_EXTERN(const lzo_charp) _lzo_version_date(void);
2N/A
2N/A/* string functions */
2N/ALZO_EXTERN(int)
2N/A lzo_memcmp(const lzo_voidp a, const lzo_voidp b, lzo_uint len);
2N/ALZO_EXTERN(lzo_voidp)
2N/A lzo_memcpy(lzo_voidp dst, const lzo_voidp src, lzo_uint len);
2N/ALZO_EXTERN(lzo_voidp)
2N/A lzo_memmove(lzo_voidp dst, const lzo_voidp src, lzo_uint len);
2N/ALZO_EXTERN(lzo_voidp)
2N/A lzo_memset(lzo_voidp buf, int c, lzo_uint len);
2N/A
2N/A/* checksum functions */
2N/ALZO_EXTERN(lzo_uint32)
2N/A lzo_adler32(lzo_uint32 c, const lzo_bytep buf, lzo_uint len);
2N/ALZO_EXTERN(lzo_uint32)
2N/A lzo_crc32(lzo_uint32 c, const lzo_bytep buf, lzo_uint len);
2N/ALZO_EXTERN(const lzo_uint32p)
2N/A lzo_get_crc32_table(void);
2N/A
2N/A/* misc. */
2N/ALZO_EXTERN(int) _lzo_config_check(void);
2N/Atypedef union { lzo_bytep p; lzo_uint u; } __lzo_pu_u;
2N/Atypedef union { lzo_bytep p; lzo_uint32 u32; } __lzo_pu32_u;
2N/Atypedef union { void *vp; lzo_bytep bp; lzo_uint u; lzo_uint32 u32; unsigned long l; } lzo_align_t;
2N/A
2N/A/* align a char pointer on a boundary that is a multiple of 'size' */
2N/ALZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp p, lzo_uint size);
2N/A#define LZO_PTR_ALIGN_UP(p,size) \
2N/A ((p) + (lzo_uint) __lzo_align_gap((const lzo_voidp)(p),(lzo_uint)(size)))
2N/A
2N/A
2N/A/***********************************************************************
2N/A// deprecated macros - only for backward compatibility with LZO v1.xx
2N/A************************************************************************/
2N/A
2N/A#if defined(LZO_CFG_COMPAT)
2N/A
2N/A#define __LZOCONF_H 1
2N/A
2N/A#if defined(LZO_ARCH_I086)
2N/A# define __LZO_i386 1
2N/A#elif defined(LZO_ARCH_I386)
2N/A# define __LZO_i386 1
2N/A#endif
2N/A
2N/A#if defined(LZO_OS_DOS16)
2N/A# define __LZO_DOS 1
2N/A# define __LZO_DOS16 1
2N/A#elif defined(LZO_OS_DOS32)
2N/A# define __LZO_DOS 1
2N/A#elif defined(LZO_OS_WIN16)
2N/A# define __LZO_WIN 1
2N/A# define __LZO_WIN16 1
2N/A#elif defined(LZO_OS_WIN32)
2N/A# define __LZO_WIN 1
2N/A#endif
2N/A
2N/A#define __LZO_CMODEL /*empty*/
2N/A#define __LZO_DMODEL /*empty*/
2N/A#define __LZO_ENTRY __LZO_CDECL
2N/A#define LZO_EXTERN_CDECL LZO_EXTERN
2N/A#define LZO_ALIGN LZO_PTR_ALIGN_UP
2N/A
2N/A#define lzo_compress_asm_t lzo_compress_t
2N/A#define lzo_decompress_asm_t lzo_decompress_t
2N/A
2N/A#endif /* LZO_CFG_COMPAT */
2N/A
2N/A
2N/A#ifdef __cplusplus
2N/A} /* extern "C" */
2N/A#endif
2N/A
2N/A#endif /* already included */
2N/A
2N/A
2N/A/* vim:set ts=4 et: */