Debian Codegraph @

Source/zlib/ZUTIL.H

raw
1 /*
2 * This file is a part of the zlib compression module for NSIS.
3 *
4 * Copyright and license information can be found below.
5 * Modifications Copyright (C) 1999-2026 Nullsoft and Contributors
6 *
7 * The original zlib source code is available at
8 * http://www.zlib.net/
9 *
10 * This software is provided 'as-is', without any express or implied
11 * warranty.
12 *
13 * Reviewed for Unicode support by Jim Park -- 08/27/2007
14 * The messages generated here are mostly #def'ed out, but are used
15 * when debugging. So in order for the messages to be viewable in
16 * Unicode version, using TCHAR macros.
17 */
18
19 /* zutil.h -- internal interface and configuration of the compression library
20 * Copyright (C) 1995-1998 Jean-loup Gailly.
21 * For conditions of distribution and use, see copyright notice in zlib.h
22 */
23
24 /* WARNING: this file should *not* be used by applications. It is
25 part of the implementation of the compression library and is
26 subject to change. Applications should only use zlib.h.
27 */
28
29 /* @(#) $Id: ZUTIL.H,v 1.6 2007/01/25 18:07:40 kichik Exp $ */
30
31 #ifndef _Z_UTIL_H
32 #define _Z_UTIL_H
33
34 #include "../Platform.h"
35 #include "ZLIB.H"
36 #include "../tchar.h"
37
38 #ifndef local
39 # define local static
40 #endif
41
42 typedef unsigned char uch;
43 typedef uch FAR uchf;
44 typedef unsigned short ush;
45 typedef ush FAR ushf;
46 typedef unsigned long ulg;
47
48 #ifndef DEF_WBITS
49 # define DEF_WBITS MAX_WBITS
50 #endif
51 /* default windowBits for decompression. MAX_WBITS is for compression only */
52
53 #define DEF_MEM_LEVEL MAX_MEM_LEVEL
54
55 #define STORED_BLOCK 0
56 #define STATIC_TREES 1
57 #define DYN_TREES 2
58 /* The three kinds of block type */
59
60 #define MIN_MATCH 3
61 #define MAX_MATCH 258
62 /* The minimum and maximum match lengths */
63
64 #define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
65
66
67 #ifdef EXEHEAD
68 # ifdef _WIN32
69 # include "../exehead/util.h"
70 # define zmemcpy mini_memcpy
71 # else
72 # include <string.h> // Avoid "incompatible implicit declaration of built-in function"
73 # define zmemcpy memcpy
74 # endif
75 #else
76 # define zmemcpy memcpy
77 # define zmemzero(a,b) memset(a,0,b)
78 #endif
79
80 #define Assert(cond,msg)
81 #define Trace(x)
82 #define Tracev(x)
83 #define Tracevv(x)
84 #define Tracec(c,x)
85 #define Tracecv(c,x)
86
87 #define ZALLOC(strm, items, size) malloc((items)*(size))
88 #define ZFREE(strm, addr) { if (addr) free(addr); }
89 #define TRY_FREE(s, p) { ZFREE(s, p); }
90 #define ERR_RETURN(strm,err) return (err)
91
92 #endif /* _Z_UTIL_H */