ReactOS 0.4.15-dev-8116-gf69e256
zlib.h
Go to the documentation of this file.
1/* zlib.h -- interface of the 'zlib' general purpose compression library
2 * version 1.2.11, January 15th, 2017
3 *
4 * Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
5 *
6 * This software is provided 'as-is', without any express or implied
7 * warranty. In no event will the authors be held liable for any damages
8 * arising from the use of this software.
9 *
10 * Permission is granted to anyone to use this software for any purpose,
11 * including commercial applications, and to alter it and redistribute it
12 * freely, subject to the following restrictions:
13 *
14 * 1. The origin of this software must not be misrepresented; you must not
15 * claim that you wrote the original software. If you use this software
16 * in a product, an acknowledgment in the product documentation would be
17 * appreciated but is not required.
18 * 2. Altered source versions must be plainly marked as such, and must not be
19 * misrepresented as being the original software.
20 * 3. This notice may not be removed or altered from any source distribution.
21 *
22 * Jean-loup Gailly Mark Adler
23 * jloup@gzip.org madler@alumni.caltech.edu
24 */
25
26#ifndef ZLIB_H
27#define ZLIB_H
28
29#ifndef DBGHELP_STATIC_LIB
30#include "windef.h"
31#endif
32
33#undef FAR
34#define FAR
35#define z_const const
36
37typedef unsigned char Byte; /* 8 bits */
38typedef unsigned int uInt; /* 16 bits or more */
39typedef unsigned long uLong; /* 32 bits or more */
40
41typedef Byte FAR Bytef;
42typedef void FAR *voidpf;
43
44typedef char FAR charf;
45typedef int FAR intf;
46
47typedef unsigned char uch;
48typedef uch FAR uchf;
49typedef unsigned short ush;
50typedef ush FAR ushf;
51typedef unsigned long ulg;
52
53typedef voidpf (*alloc_func)(voidpf opaque, uInt items, uInt size);
54typedef void (*free_func)(voidpf opaque, voidpf address);
55
56struct internal_state;
57
58typedef struct z_stream_s {
59 z_const Bytef *next_in; /* next input byte */
60 uInt avail_in; /* number of bytes available at next_in */
61 uLong total_in; /* total number of input bytes read so far */
62
63 Bytef *next_out; /* next output byte will go here */
64 uInt avail_out; /* remaining free space at next_out */
65 uLong total_out; /* total number of bytes output so far */
66
67 z_const char *msg; /* last error message, NULL if no error */
68 struct internal_state FAR *state; /* not visible by applications */
69
70 alloc_func zalloc; /* used to allocate the internal state */
71 free_func zfree; /* used to free the internal state */
72 voidpf opaque; /* private data object passed to zalloc and zfree */
73
74 int data_type; /* best guess about the data type: binary or text
75 for deflate, or the decoding state for inflate */
76 uLong adler; /* Adler-32 or CRC-32 value of the uncompressed data */
77 uLong reserved; /* reserved for future use */
79
81
82/*
83 gzip header information passed to and from zlib routines. See RFC 1952
84 for more details on the meanings of these fields.
85*/
86typedef struct gz_header_s {
87 int text; /* true if compressed data believed to be text */
88 uLong time; /* modification time */
89 int xflags; /* extra flags (not used when writing a gzip file) */
90 int os; /* operating system */
91 Bytef *extra; /* pointer to extra field or Z_NULL if none */
92 uInt extra_len; /* extra field length (valid if extra != Z_NULL) */
93 uInt extra_max; /* space at extra (only when reading header) */
94 Bytef *name; /* pointer to zero-terminated file name or Z_NULL */
95 uInt name_max; /* space at name (only when reading header) */
96 Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */
97 uInt comm_max; /* space at comment (only when reading header) */
98 int hcrc; /* true if there was or will be a header crc */
99 int done; /* true when done reading gzip header (not used
100 when writing a gzip file) */
102
104
105#define Z_NO_FLUSH 0
106#define Z_PARTIAL_FLUSH 1
107#define Z_SYNC_FLUSH 2
108#define Z_FULL_FLUSH 3
109#define Z_FINISH 4
110#define Z_BLOCK 5
111#define Z_TREES 6
112/* Allowed flush values; see deflate() and inflate() below for details */
113
114#define Z_OK 0
115#define Z_STREAM_END 1
116#define Z_NEED_DICT 2
117#define Z_ERRNO (-1)
118#define Z_STREAM_ERROR (-2)
119#define Z_DATA_ERROR (-3)
120#define Z_MEM_ERROR (-4)
121#define Z_BUF_ERROR (-5)
122#define Z_VERSION_ERROR (-6)
123/* Return codes for the compression/decompression functions. Negative values
124 * are errors, positive values are used for special but normal events.
125 */
126
127#define Z_NO_COMPRESSION 0
128#define Z_BEST_SPEED 1
129#define Z_BEST_COMPRESSION 9
130#define Z_DEFAULT_COMPRESSION (-1)
131/* compression levels */
132
133#define Z_FILTERED 1
134#define Z_HUFFMAN_ONLY 2
135#define Z_RLE 3
136#define Z_FIXED 4
137#define Z_DEFAULT_STRATEGY 0
138/* compression strategy; see deflateInit2() below for details */
139
140#define Z_BINARY 0
141#define Z_TEXT 1
142#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */
143#define Z_UNKNOWN 2
144/* Possible values of the data_type field for deflate() */
145
146#define Z_DEFLATED 8
147/* The deflate compression method (the only one supported in this version) */
148
149#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
150
151#define MAX_WBITS 15 /* 32K LZ77 window */
152#define MAX_MEM_LEVEL 9
153
154extern int inflateInit(z_streamp strm) DECLSPEC_HIDDEN;
156extern int inflate(z_streamp strm, int flush) DECLSPEC_HIDDEN;
157extern int inflateEnd(z_streamp strm) DECLSPEC_HIDDEN;
158
160extern int deflateInit2(z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy) DECLSPEC_HIDDEN;
161extern int deflate(z_streamp strm, int flush) DECLSPEC_HIDDEN;
162extern int deflateEnd(z_streamp strm) DECLSPEC_HIDDEN;
163
164#endif /* ZLIB_H */
#define DECLSPEC_HIDDEN
Definition: precomp.h:8
void(* free_func)(voidpf opaque, voidpf address)
Definition: zlib.h:54
char FAR charf
Definition: zlib.h:44
unsigned long uLong
Definition: zlib.h:39
int inflateEnd(z_streamp strm) DECLSPEC_HIDDEN
Definition: inflate.c:1910
unsigned short ush
Definition: zlib.h:49
gz_header FAR * gz_headerp
Definition: zlib.h:103
voidpf(* alloc_func)(voidpf opaque, uInt items, uInt size)
Definition: zlib.h:53
z_stream FAR * z_streamp
Definition: zlib.h:80
void FAR * voidpf
Definition: zlib.h:42
unsigned int uInt
Definition: zlib.h:38
#define z_const
Definition: zlib.h:35
int deflate(z_streamp strm, int flush) DECLSPEC_HIDDEN
Definition: deflate.c:815
struct z_stream_s z_stream
int FAR intf
Definition: zlib.h:45
uch FAR uchf
Definition: zlib.h:48
struct gz_header_s gz_header
ush FAR ushf
Definition: zlib.h:50
unsigned long ulg
Definition: zlib.h:51
int deflateEnd(z_streamp strm) DECLSPEC_HIDDEN
Definition: deflate.c:1130
unsigned char Byte
Definition: zlib.h:37
int inflate(z_streamp strm, int flush) DECLSPEC_HIDDEN
Definition: inflate.c:1257
Byte FAR Bytef
Definition: zlib.h:41
#define FAR
Definition: zlib.h:34
unsigned char uch
Definition: zlib.h:47
method
Definition: dragdrop.c:54
GLint level
Definition: gl.h:1546
GLsizeiptr size
Definition: glext.h:5919
GLuint address
Definition: glext.h:9393
static TCHAR * items[]
Definition: page1.c:45
#define deflateInit2(strm, level, method, windowBits, memLevel, strategy)
Definition: zlib.h:1814
#define inflateInit2(strm, windowBits)
Definition: zlib.h:1817
#define inflateInit(strm)
Definition: zlib.h:1812
#define deflateInit(strm, level)
Definition: zlib.h:1810
int windowBits
Definition: zlib.h:813
Bytef * name
Definition: zlib.h:94
int os
Definition: zlib.h:90
uInt extra_len
Definition: zlib.h:92
int hcrc
Definition: zlib.h:98
int xflags
Definition: zlib.h:89
Bytef * comment
Definition: zlib.h:96
uLong time
Definition: zlib.h:88
Bytef * extra
Definition: zlib.h:91
uInt comm_max
Definition: zlib.h:97
int done
Definition: zlib.h:99
uInt extra_max
Definition: zlib.h:93
uInt name_max
Definition: zlib.h:95
int text
Definition: zlib.h:87
uInt avail_in
Definition: zlib.h:60
z_const Bytef * next_in
Definition: zlib.h:59
alloc_func zalloc
Definition: zlib.h:70
uInt avail_out
Definition: zlib.h:64
Bytef * next_out
Definition: zlib.h:63
z_const char * msg
Definition: zlib.h:67
free_func zfree
Definition: zlib.h:71
int data_type
Definition: zlib.h:74
uLong total_in
Definition: zlib.h:61
voidpf opaque
Definition: zlib.h:72
uLong total_out
Definition: zlib.h:65
struct internal_state FAR * state
Definition: zlib.h:68
uLong reserved
Definition: zlib.h:77
uLong adler
Definition: zlib.h:76