comparison zlib/gzguts.h @ 2690:9ef72ee5c0b0

Update vendored zlib to 1.3.1
author Michael Pavone <pavone@retrodev.com>
date Sun, 15 Jun 2025 15:39:33 -0700
parents 00d788dac91a
children
comparison
equal deleted inserted replaced
2689:bd6e33de0972 2690:9ef72ee5c0b0
1 /* gzguts.h -- zlib internal header definitions for gz* operations 1 /* gzguts.h -- zlib internal header definitions for gz* operations
2 * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013, 2016 Mark Adler 2 * Copyright (C) 2004-2024 Mark Adler
3 * For conditions of distribution and use, see copyright notice in zlib.h 3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */ 4 */
5 5
6 #ifdef _LARGEFILE64_SOURCE 6 #ifdef _LARGEFILE64_SOURCE
7 # ifndef _LARGEFILE_SOURCE 7 # ifndef _LARGEFILE_SOURCE
8 # define _LARGEFILE_SOURCE 1 8 # define _LARGEFILE_SOURCE 1
9 # endif 9 # endif
10 # ifdef _FILE_OFFSET_BITS 10 # undef _FILE_OFFSET_BITS
11 # undef _FILE_OFFSET_BITS 11 # undef _TIME_BITS
12 # endif
13 #endif 12 #endif
14 13
15 #ifdef HAVE_HIDDEN 14 #ifdef HAVE_HIDDEN
16 # define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) 15 # define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
17 #else 16 #else
37 36
38 #if defined(__TURBOC__) || defined(_MSC_VER) || defined(_WIN32) 37 #if defined(__TURBOC__) || defined(_MSC_VER) || defined(_WIN32)
39 # include <io.h> 38 # include <io.h>
40 #endif 39 #endif
41 40
42 #if defined(_WIN32) || defined(__CYGWIN__) 41 #if defined(_WIN32)
43 # define WIDECHAR 42 # define WIDECHAR
44 #endif 43 #endif
45 44
46 #ifdef WINAPI_FAMILY 45 #ifdef WINAPI_FAMILY
47 # define open _open 46 # define open _open
117 define "local" for the non-static meaning of "static", for readability 116 define "local" for the non-static meaning of "static", for readability
118 (compile with -Dlocal if your debugger can't find static symbols) */ 117 (compile with -Dlocal if your debugger can't find static symbols) */
119 118
120 /* gz* functions always use library allocation functions */ 119 /* gz* functions always use library allocation functions */
121 #ifndef STDC 120 #ifndef STDC
122 extern voidp malloc OF((uInt size)); 121 extern voidp malloc(uInt size);
123 extern void free OF((voidpf ptr)); 122 extern void free(voidpf ptr);
124 #endif 123 #endif
125 124
126 /* get errno and strerror definition */ 125 /* get errno and strerror definition */
127 #if defined UNDER_CE 126 #if defined UNDER_CE
128 # include <windows.h> 127 # include <windows.h>
136 # endif 135 # endif
137 #endif 136 #endif
138 137
139 /* provide prototypes for these when building zlib without LFS */ 138 /* provide prototypes for these when building zlib without LFS */
140 #if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0 139 #if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0
141 ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); 140 ZEXTERN gzFile ZEXPORT gzopen64(const char *, const char *);
142 ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); 141 ZEXTERN z_off64_t ZEXPORT gzseek64(gzFile, z_off64_t, int);
143 ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); 142 ZEXTERN z_off64_t ZEXPORT gztell64(gzFile);
144 ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); 143 ZEXTERN z_off64_t ZEXPORT gzoffset64(gzFile);
145 #endif 144 #endif
146 145
147 /* default memLevel */ 146 /* default memLevel */
148 #if MAX_MEM_LEVEL >= 8 147 #if MAX_MEM_LEVEL >= 8
149 # define DEF_MEM_LEVEL 8 148 # define DEF_MEM_LEVEL 8
188 int eof; /* true if end of input file reached */ 187 int eof; /* true if end of input file reached */
189 int past; /* true if read requested past end */ 188 int past; /* true if read requested past end */
190 /* just for writing */ 189 /* just for writing */
191 int level; /* compression level */ 190 int level; /* compression level */
192 int strategy; /* compression strategy */ 191 int strategy; /* compression strategy */
192 int reset; /* true if a reset is pending after a Z_FINISH */
193 /* seek request */ 193 /* seek request */
194 z_off64_t skip; /* amount to skip (already rewound if backwards) */ 194 z_off64_t skip; /* amount to skip (already rewound if backwards) */
195 int seek; /* true if seek request pending */ 195 int seek; /* true if seek request pending */
196 /* error information */ 196 /* error information */
197 int err; /* error code */ 197 int err; /* error code */
200 z_stream strm; /* stream structure in-place (not a pointer) */ 200 z_stream strm; /* stream structure in-place (not a pointer) */
201 } gz_state; 201 } gz_state;
202 typedef gz_state FAR *gz_statep; 202 typedef gz_state FAR *gz_statep;
203 203
204 /* shared functions */ 204 /* shared functions */
205 void ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *)); 205 void ZLIB_INTERNAL gz_error(gz_statep, int, const char *);
206 #if defined UNDER_CE 206 #if defined UNDER_CE
207 char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error)); 207 char ZLIB_INTERNAL *gz_strwinerror(DWORD error);
208 #endif 208 #endif
209 209
210 /* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t 210 /* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t
211 value -- needed when comparing unsigned to z_off64_t, which is signed 211 value -- needed when comparing unsigned to z_off64_t, which is signed
212 (possible z_off64_t types off_t, off64_t, and long are all signed) */ 212 (possible z_off64_t types off_t, off64_t, and long are all signed) */
213 #ifdef INT_MAX 213 unsigned ZLIB_INTERNAL gz_intmax(void);
214 # define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX) 214 #define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax())
215 #else
216 unsigned ZLIB_INTERNAL gz_intmax OF((void));
217 # define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax())
218 #endif