lemon-project-template-glpk
view 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 source
1 /* zutil.h (internal interface of the zlib compression library) */
3 /* Modified by Andrew Makhorin <mao@gnu.org>, April 2011 */
5 /* Copyright (C) 1995-2010 Jean-loup Gailly
6 * For conditions of distribution and use, see copyright notice in
7 * zlib.h */
9 /* WARNING: this file should *not* be used by applications. It is
10 part of the implementation of the compression library and is
11 subject to change. Applications should only use zlib.h. */
13 #ifndef ZUTIL_H
14 #define ZUTIL_H
16 #define ZLIB_INTERNAL
18 #include "zlib.h"
20 #include <stddef.h>
21 #include <string.h>
22 #include <stdlib.h>
24 #define local static
26 typedef unsigned char uch;
27 typedef uch uchf;
28 typedef unsigned short ush;
29 typedef ush ushf;
30 typedef unsigned long ulg;
32 extern const char * const z_errmsg[10];
34 #define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
36 #define ERR_RETURN(strm, err) \
37 return (strm->msg = (char *)ERR_MSG(err), (err))
39 #define DEF_WBITS MAX_WBITS
41 #if MAX_MEM_LEVEL >= 8
42 #define DEF_MEM_LEVEL 8
43 #else
44 #define DEF_MEM_LEVEL MAX_MEM_LEVEL
45 #endif
47 #define STORED_BLOCK 0
48 #define STATIC_TREES 1
49 #define DYN_TREES 2
51 #define MIN_MATCH 3
52 #define MAX_MATCH 258
54 #define PRESET_DICT 0x20
56 #define OS_CODE 0x03 /* assume Unix */
58 #define HAVE_MEMCPY 1
59 #define zmemcpy memcpy
60 #define zmemzero(dest, len) memset(dest, 0, len)
62 #ifdef DEBUG
63 #include <stdio.h>
64 extern int ZLIB_INTERNAL z_verbose;
65 extern void ZLIB_INTERNAL z_error OF((char *m));
66 #define Assert(cond, msg) { if(!(cond)) z_error(msg); }
67 #define Trace(x) { if (z_verbose >= 0) fprintf x; }
68 #define Tracev(x) { if (z_verbose > 0) fprintf x; }
69 #define Tracevv(x) {if (z_verbose > 1) fprintf x; }
70 #define Tracec(c, x) {if (z_verbose > 0 && (c)) fprintf x; }
71 #define Tracecv(c, x) {if (z_verbose > 1 && (c)) fprintf x; }
72 #else
73 #define Assert(cond, msg)
74 #define Trace(x)
75 #define Tracev(x)
76 #define Tracevv(x)
77 #define Tracec(c, x)
78 #define Tracecv(c, x)
79 #endif
81 voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items,
82 unsigned size));
83 void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr));
85 #define ZALLOC(strm, items, size) \
86 (*((strm)->zalloc))((strm)->opaque, (items), (size))
87 #define ZFREE(strm, addr) \
88 (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
89 #define TRY_FREE(s, p) { if (p) ZFREE(s, p); }
91 #endif
93 /* eof */