Introducing zlib as shared library.
[AROS.git] / compiler / include / libraries / z_au.h
blob7114bdf4dd3f9ba2fdf1534c1f3304efb8577820
1 #ifndef LIBRARIES_Z_H
2 #define LIBRARIES_Z_H
4 #include <unistd.h>
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
10 #define ZLIB_VERSION "1.2.7"
11 #define ZLIB_VERNUM 0x1270
12 #define ZLIB_VER_MAJOR 1
13 #define ZLIB_VER_MINOR 2
14 #define ZLIB_VER_REVISION 7
15 #define ZLIB_VER_SUBREVISION 0
17 #define z_const const
18 #define z_off_t off_t
19 #define z_off64_t z_off_t
21 typedef unsigned char Byte; /* 8 bits */
22 typedef unsigned int uInt; /* 16 bits or more */
23 typedef unsigned long uLong; /* 32 bits or more */
24 typedef Byte Bytef;
26 typedef char charf;
27 typedef int intf;
28 typedef uInt uIntf;
29 typedef uLong uLongf;
31 typedef void const *voidpc;
32 typedef void *voidpf;
33 typedef void *voidp;
35 typedef unsigned long z_crc_t;
37 typedef voidpf (*alloc_func)(voidpf opaque, uInt items, uInt size);
38 typedef void (*free_func)(voidpf opaque, voidpf address);
40 typedef unsigned (*blast_in)(void *how, unsigned char **buf);
41 typedef int (*blast_out)(void *how, unsigned char *buf, unsigned len);
43 typedef unsigned (*in_func)(void *, unsigned char **);
44 typedef int (*out_func)(void *, unsigned char *, unsigned);
46 typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */
48 struct internal_state;
50 typedef struct z_stream_s {
51 z_const Bytef *next_in; /* next input byte */
52 uInt avail_in; /* number of bytes available at next_in */
53 uLong total_in; /* total number of input bytes read so far */
55 Bytef *next_out; /* next output byte should be put there */
56 uInt avail_out; /* remaining free space at next_out */
57 uLong total_out; /* total number of bytes output so far */
59 z_const char *msg; /* last error message, NULL if no error */
60 struct internal_state *state; /* not visible by applications */
62 alloc_func zalloc; /* used to allocate the internal state */
63 free_func zfree; /* used to free the internal state */
64 voidpf opaque; /* private data object passed to zalloc and zfree */
66 int data_type; /* best guess about the data type: binary or text */
67 uLong adler; /* adler32 value of the uncompressed data */
68 uLong reserved; /* reserved for future use */
69 } z_stream;
71 typedef z_stream *z_streamp;
74 gzip header information passed to and from zlib routines. See RFC 1952
75 for more details on the meanings of these fields.
77 typedef struct gz_header_s {
78 int text; /* true if compressed data believed to be text */
79 uLong time; /* modification time */
80 int xflags; /* extra flags (not used when writing a gzip file) */
81 int os; /* operating system */
82 Bytef *extra; /* pointer to extra field or Z_NULL if none */
83 uInt extra_len; /* extra field length (valid if extra != Z_NULL) */
84 uInt extra_max; /* space at extra (only when reading header) */
85 Bytef *name; /* pointer to zero-terminated file name or Z_NULL */
86 uInt name_max; /* space at name (only when reading header) */
87 Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */
88 uInt comm_max; /* space at comment (only when reading header) */
89 int hcrc; /* true if there was or will be a header crc */
90 int done; /* true when done reading gzip header (not used
91 when writing a gzip file) */
92 } gz_header;
94 typedef gz_header *gz_headerp;
96 /* constants */
98 #define Z_NO_FLUSH 0
99 #define Z_PARTIAL_FLUSH 1
100 #define Z_SYNC_FLUSH 2
101 #define Z_FULL_FLUSH 3
102 #define Z_FINISH 4
103 #define Z_BLOCK 5
104 #define Z_TREES 6
105 /* Allowed flush values; see deflate() and inflate() below for details */
107 #define Z_OK 0
108 #define Z_STREAM_END 1
109 #define Z_NEED_DICT 2
110 #define Z_ERRNO (-1)
111 #define Z_STREAM_ERROR (-2)
112 #define Z_DATA_ERROR (-3)
113 #define Z_MEM_ERROR (-4)
114 #define Z_BUF_ERROR (-5)
115 #define Z_VERSION_ERROR (-6)
116 /* Return codes for the compression/decompression functions. Negative values
117 * are errors, positive values are used for special but normal events.
120 #define Z_NO_COMPRESSION 0
121 #define Z_BEST_SPEED 1
122 #define Z_BEST_COMPRESSION 9
123 #define Z_DEFAULT_COMPRESSION (-1)
124 /* compression levels */
126 #define Z_FILTERED 1
127 #define Z_HUFFMAN_ONLY 2
128 #define Z_RLE 3
129 #define Z_FIXED 4
130 #define Z_DEFAULT_STRATEGY 0
131 /* compression strategy; see deflateInit2() below for details */
133 #define Z_BINARY 0
134 #define Z_TEXT 1
135 #define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */
136 #define Z_UNKNOWN 2
137 /* Possible values of the data_type field (though see inflate()) */
139 #define Z_DEFLATED 8
140 /* The deflate compression method (the only one supported in this version) */
142 #define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
144 #define zlib_version zlibVersion()
145 /* for compatibility with versions < 1.0.2 */
148 #define deflateInit(strm, level) \
149 deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
150 #define inflateInit(strm) \
151 inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
152 #define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
153 deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
154 (strategy), ZLIB_VERSION, (int)sizeof(z_stream))
155 #define inflateInit2(strm, windowBits) \
156 inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
157 (int)sizeof(z_stream))
158 #define inflateBackInit(strm, windowBits, window) \
159 inflateBackInit_((strm), (windowBits), (window), \
160 ZLIB_VERSION, (int)sizeof(z_stream))
163 #ifdef __cplusplus
165 #endif
167 #endif /* LIBRARIES_Z_H */