Debian Codegraph @

src/lib/util.h

raw symbols SCIP
1 /* zutil.h -- internal interface and configuration of the compression library
2 * Copyright (C) 1995-2022 Jean-loup Gailly, Mark Adler
3 */
4
5 #ifndef ZUTIL_H
6 #define ZUTIL_H
7
8 #include "inflate64_config.h"
9
10 /* functions */
11
12 extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
13 /* (size given to avoid silly warnings with Visual C++) */
14
15 #define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
16
17 #define ERR_RETURN(strm,err) \
18 return (strm->msg = ERR_MSG(err), (err))
19 /* To be used only when the state is known to be valid */
20
21 #if defined(pyr) || defined(Z_SOLO)
22 # define NO_MEMCPY
23 #endif
24 #if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
25 # define HAVE_MEMCPY
26 #endif
27
28 #ifdef HAVE_MEMCPY
29 # define zmemcpy memcpy
30 # define zmemcmp memcmp
31 # define zmemzero(dest, len) memset(dest, 0, len)
32 #else
33 void ZLIB_INTERNAL zmemcpy OF((Byte FAR* dest, const Byte FAR* source, uInt len));
34 int ZLIB_INTERNAL zmemcmp OF((const Byte FAR* s1, const Byte FAR* s2, uInt len));
35 void ZLIB_INTERNAL zmemzero OF((Byte FAR* dest, uInt len));
36 #endif
37
38 /* Diagnostic functions */
39 #ifdef ZLIB_DEBUG
40 # include <stdio.h>
41 extern int ZLIB_INTERNAL z_verbose;
42 extern void ZLIB_INTERNAL z_error OF((char *m));
43 # define Assert(cond,msg) {if(!(cond)) z_error(msg);}
44 # define Tracev(x) {if (z_verbose>0) fprintf x ;}
45 # define Tracevv(x) {if (z_verbose>1) fprintf x ;}
46 # define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
47 #else
48 # define Assert(cond,msg)
49 # define Tracev(x)
50 # define Tracevv(x)
51 # define Tracecv(c,x)
52 #endif
53
54 #define ZALLOC(strm, items, size) \
55 (*((strm)->zalloc))((strm)->opaque, (items), (size))
56 #define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
57 #define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
58
59 #endif /* ZUTIL_H */