lemon-project-template-glpk
diff deps/glpk/src/zlib/zutil.h @ 9:33de93886c88
Import GLPK 4.47
author | Alpar Juttner <alpar@cs.elte.hu> |
---|---|
date | Sun, 06 Nov 2011 20:59:10 +0100 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/deps/glpk/src/zlib/zutil.h Sun Nov 06 20:59:10 2011 +0100 1.3 @@ -0,0 +1,93 @@ 1.4 +/* zutil.h (internal interface of the zlib compression library) */ 1.5 + 1.6 +/* Modified by Andrew Makhorin <mao@gnu.org>, April 2011 */ 1.7 + 1.8 +/* Copyright (C) 1995-2010 Jean-loup Gailly 1.9 + * For conditions of distribution and use, see copyright notice in 1.10 + * zlib.h */ 1.11 + 1.12 +/* WARNING: this file should *not* be used by applications. It is 1.13 + part of the implementation of the compression library and is 1.14 + subject to change. Applications should only use zlib.h. */ 1.15 + 1.16 +#ifndef ZUTIL_H 1.17 +#define ZUTIL_H 1.18 + 1.19 +#define ZLIB_INTERNAL 1.20 + 1.21 +#include "zlib.h" 1.22 + 1.23 +#include <stddef.h> 1.24 +#include <string.h> 1.25 +#include <stdlib.h> 1.26 + 1.27 +#define local static 1.28 + 1.29 +typedef unsigned char uch; 1.30 +typedef uch uchf; 1.31 +typedef unsigned short ush; 1.32 +typedef ush ushf; 1.33 +typedef unsigned long ulg; 1.34 + 1.35 +extern const char * const z_errmsg[10]; 1.36 + 1.37 +#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] 1.38 + 1.39 +#define ERR_RETURN(strm, err) \ 1.40 + return (strm->msg = (char *)ERR_MSG(err), (err)) 1.41 + 1.42 +#define DEF_WBITS MAX_WBITS 1.43 + 1.44 +#if MAX_MEM_LEVEL >= 8 1.45 +#define DEF_MEM_LEVEL 8 1.46 +#else 1.47 +#define DEF_MEM_LEVEL MAX_MEM_LEVEL 1.48 +#endif 1.49 + 1.50 +#define STORED_BLOCK 0 1.51 +#define STATIC_TREES 1 1.52 +#define DYN_TREES 2 1.53 + 1.54 +#define MIN_MATCH 3 1.55 +#define MAX_MATCH 258 1.56 + 1.57 +#define PRESET_DICT 0x20 1.58 + 1.59 +#define OS_CODE 0x03 /* assume Unix */ 1.60 + 1.61 +#define HAVE_MEMCPY 1 1.62 +#define zmemcpy memcpy 1.63 +#define zmemzero(dest, len) memset(dest, 0, len) 1.64 + 1.65 +#ifdef DEBUG 1.66 +#include <stdio.h> 1.67 +extern int ZLIB_INTERNAL z_verbose; 1.68 +extern void ZLIB_INTERNAL z_error OF((char *m)); 1.69 +#define Assert(cond, msg) { if(!(cond)) z_error(msg); } 1.70 +#define Trace(x) { if (z_verbose >= 0) fprintf x; } 1.71 +#define Tracev(x) { if (z_verbose > 0) fprintf x; } 1.72 +#define Tracevv(x) {if (z_verbose > 1) fprintf x; } 1.73 +#define Tracec(c, x) {if (z_verbose > 0 && (c)) fprintf x; } 1.74 +#define Tracecv(c, x) {if (z_verbose > 1 && (c)) fprintf x; } 1.75 +#else 1.76 +#define Assert(cond, msg) 1.77 +#define Trace(x) 1.78 +#define Tracev(x) 1.79 +#define Tracevv(x) 1.80 +#define Tracec(c, x) 1.81 +#define Tracecv(c, x) 1.82 +#endif 1.83 + 1.84 +voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items, 1.85 + unsigned size)); 1.86 +void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr)); 1.87 + 1.88 +#define ZALLOC(strm, items, size) \ 1.89 + (*((strm)->zalloc))((strm)->opaque, (items), (size)) 1.90 +#define ZFREE(strm, addr) \ 1.91 + (*((strm)->zfree))((strm)->opaque, (voidpf)(addr)) 1.92 +#define TRY_FREE(s, p) { if (p) ZFREE(s, p); } 1.93 + 1.94 +#endif 1.95 + 1.96 +/* eof */