123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218 |
- #ifdef _LARGEFILE64_SOURCE
- # ifndef _LARGEFILE_SOURCE
- # define _LARGEFILE_SOURCE 1
- # endif
- # ifdef _FILE_OFFSET_BITS
- # undef _FILE_OFFSET_BITS
- # endif
- #endif
- #ifdef HAVE_HIDDEN
- # define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
- #else
- # define ZLIB_INTERNAL
- #endif
- #include <stdio.h>
- #include "zlib.h"
- #ifdef STDC
- # include <string.h>
- # include <stdlib.h>
- # include <limits.h>
- #endif
- #ifndef _POSIX_SOURCE
- # define _POSIX_SOURCE
- #endif
- #include <fcntl.h>
- #ifdef _WIN32
- # include <stddef.h>
- #endif
- #if defined(__TURBOC__) || defined(_MSC_VER) || defined(_WIN32)
- # include <io.h>
- #endif
- #if defined(_WIN32) || defined(__CYGWIN__)
- # define WIDECHAR
- #endif
- #ifdef WINAPI_FAMILY
- # define open _open
- # define read _read
- # define write _write
- # define close _close
- #endif
- #ifdef NO_DEFLATE
- # define NO_GZCOMPRESS
- #endif
- #if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550)
- # ifndef HAVE_VSNPRINTF
- # define HAVE_VSNPRINTF
- # endif
- #endif
- #if defined(__CYGWIN__)
- # ifndef HAVE_VSNPRINTF
- # define HAVE_VSNPRINTF
- # endif
- #endif
- #if defined(MSDOS) && defined(__BORLANDC__) && (BORLANDC > 0x410)
- # ifndef HAVE_VSNPRINTF
- # define HAVE_VSNPRINTF
- # endif
- #endif
- #ifndef HAVE_VSNPRINTF
- # ifdef MSDOS
- # define NO_vsnprintf
- # endif
- # ifdef __TURBOC__
- # define NO_vsnprintf
- # endif
- # ifdef WIN32
- # if !defined(vsnprintf) && !defined(NO_vsnprintf)
- # if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 )
- # define vsnprintf _vsnprintf
- # endif
- # endif
- # endif
- # ifdef __SASC
- # define NO_vsnprintf
- # endif
- # ifdef VMS
- # define NO_vsnprintf
- # endif
- # ifdef __OS400__
- # define NO_vsnprintf
- # endif
- # ifdef __MVS__
- # define NO_vsnprintf
- # endif
- #endif
- #if defined(_MSC_VER) && _MSC_VER < 1900
- # define snprintf _snprintf
- #endif
- #ifndef local
- # define local static
- #endif
- #ifndef STDC
- extern voidp malloc OF((uInt size));
- extern void free OF((voidpf ptr));
- #endif
- #if defined UNDER_CE
- # include <windows.h>
- # define zstrerror() gz_strwinerror((DWORD)GetLastError())
- #else
- # ifndef NO_STRERROR
- # include <errno.h>
- # define zstrerror() strerror(errno)
- # else
- # define zstrerror() "stdio error (consult errno)"
- # endif
- #endif
- #if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0
- ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
- ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
- ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
- ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
- #endif
- #if MAX_MEM_LEVEL >= 8
- # define DEF_MEM_LEVEL 8
- #else
- # define DEF_MEM_LEVEL MAX_MEM_LEVEL
- #endif
- #define GZBUFSIZE 8192
- #define GZ_NONE 0
- #define GZ_READ 7247
- #define GZ_WRITE 31153
- #define GZ_APPEND 1
- #define LOOK 0
- #define COPY 1
- #define GZIP 2
- typedef struct {
-
- struct gzFile_s x;
-
-
-
-
- int mode;
- int fd;
- char *path;
- unsigned size;
- unsigned want;
- unsigned char *in;
- unsigned char *out;
- int direct;
-
- int how;
- z_off64_t start;
- int eof;
- int past;
-
- int level;
- int strategy;
-
- z_off64_t skip;
- int seek;
-
- int err;
- char *msg;
-
- z_stream strm;
- } gz_state;
- typedef gz_state FAR *gz_statep;
- void ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *));
- #if defined UNDER_CE
- char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error));
- #endif
- #ifdef INT_MAX
- # define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX)
- #else
- unsigned ZLIB_INTERNAL gz_intmax OF((void));
- # define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax())
- #endif
|