+++ /dev/null
-/* gzguts.h -- zlib internal header definitions for gz* operations\r
- * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler\r
- * For conditions of distribution and use, see copyright notice in zlib.h\r
- */\r
-\r
-#ifdef _LARGEFILE64_SOURCE\r
-# ifndef _LARGEFILE_SOURCE\r
-# define _LARGEFILE_SOURCE 1\r
-# endif\r
-# ifdef _FILE_OFFSET_BITS\r
-# undef _FILE_OFFSET_BITS\r
-# endif\r
-#endif\r
-\r
-#ifdef HAVE_HIDDEN\r
-# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))\r
-#else\r
-# define ZLIB_INTERNAL\r
-#endif\r
-\r
-#include <stdio.h>\r
-#include "zlib.h"\r
-#ifdef STDC\r
-# include <string.h>\r
-# include <stdlib.h>\r
-# include <limits.h>\r
-#endif\r
-#include <fcntl.h>\r
-\r
-#ifdef _WIN32\r
-# include <stddef.h>\r
-#endif\r
-\r
-#if defined(__TURBOC__) || defined(_MSC_VER) || defined(_WIN32)\r
-# include <io.h>\r
-#endif\r
-\r
-#ifdef WINAPI_FAMILY\r
-# define open _open\r
-# define read _read\r
-# define write _write\r
-# define close _close\r
-#endif\r
-\r
-#ifdef NO_DEFLATE /* for compatibility with old definition */\r
-# define NO_GZCOMPRESS\r
-#endif\r
-\r
-#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550)\r
-# ifndef HAVE_VSNPRINTF\r
-# define HAVE_VSNPRINTF\r
-# endif\r
-#endif\r
-\r
-#if defined(__CYGWIN__)\r
-# ifndef HAVE_VSNPRINTF\r
-# define HAVE_VSNPRINTF\r
-# endif\r
-#endif\r
-\r
-#if defined(MSDOS) && defined(__BORLANDC__) && (BORLANDC > 0x410)\r
-# ifndef HAVE_VSNPRINTF\r
-# define HAVE_VSNPRINTF\r
-# endif\r
-#endif\r
-\r
-#ifndef HAVE_VSNPRINTF\r
-# ifdef MSDOS\r
-/* vsnprintf may exist on some MS-DOS compilers (DJGPP?),\r
- but for now we just assume it doesn't. */\r
-# define NO_vsnprintf\r
-# endif\r
-# ifdef __TURBOC__\r
-# define NO_vsnprintf\r
-# endif\r
-# ifdef WIN32\r
-/* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */\r
-# if !defined(vsnprintf) && !defined(NO_vsnprintf)\r
-# if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 )\r
-# define vsnprintf _vsnprintf\r
-# endif\r
-# endif\r
-# endif\r
-# ifdef __SASC\r
-# define NO_vsnprintf\r
-# endif\r
-# ifdef VMS\r
-# define NO_vsnprintf\r
-# endif\r
-# ifdef __OS400__\r
-# define NO_vsnprintf\r
-# endif\r
-# ifdef __MVS__\r
-# define NO_vsnprintf\r
-# endif\r
-#endif\r
-\r
-/* unlike snprintf (which is required in C99, yet still not supported by\r
- Microsoft more than a decade later!), _snprintf does not guarantee null\r
- termination of the result -- however this is only used in gzlib.c where\r
- the result is assured to fit in the space provided */\r
-#ifdef _MSC_VER\r
-# define snprintf _snprintf\r
-#endif\r
-\r
-#ifndef local\r
-# define local static\r
-#endif\r
-/* compile with -Dlocal if your debugger can't find static symbols */\r
-\r
-/* gz* functions always use library allocation functions */\r
-#ifndef STDC\r
- extern voidp malloc OF((uInt size));\r
- extern void free OF((voidpf ptr));\r
-#endif\r
-\r
-/* get errno and strerror definition */\r
-#if defined UNDER_CE\r
-# include <windows.h>\r
-# define zstrerror() gz_strwinerror((DWORD)GetLastError())\r
-#else\r
-# ifndef NO_STRERROR\r
-# include <errno.h>\r
-# define zstrerror() strerror(errno)\r
-# else\r
-# define zstrerror() "stdio error (consult errno)"\r
-# endif\r
-#endif\r
-\r
-/* provide prototypes for these when building zlib without LFS */\r
-#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0\r
- ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));\r
- ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));\r
- ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));\r
- ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));\r
-#endif\r
-\r
-/* default memLevel */\r
-#if MAX_MEM_LEVEL >= 8\r
-# define DEF_MEM_LEVEL 8\r
-#else\r
-# define DEF_MEM_LEVEL MAX_MEM_LEVEL\r
-#endif\r
-\r
-/* default i/o buffer size -- double this for output when reading (this and\r
- twice this must be able to fit in an unsigned type) */\r
-#define GZBUFSIZE 8192\r
-\r
-/* gzip modes, also provide a little integrity check on the passed structure */\r
-#define GZ_NONE 0\r
-#define GZ_READ 7247\r
-#define GZ_WRITE 31153\r
-#define GZ_APPEND 1 /* mode set to GZ_WRITE after the file is opened */\r
-\r
-/* values for gz_state how */\r
-#define LOOK 0 /* look for a gzip header */\r
-#define COPY 1 /* copy input directly */\r
-#define GZIP 2 /* decompress a gzip stream */\r
-\r
-/* internal gzip file state data structure */\r
-typedef struct {\r
- /* exposed contents for gzgetc() macro */\r
- struct gzFile_s x; /* "x" for exposed */\r
- /* x.have: number of bytes available at x.next */\r
- /* x.next: next output data to deliver or write */\r
- /* x.pos: current position in uncompressed data */\r
- /* used for both reading and writing */\r
- int mode; /* see gzip modes above */\r
- int fd; /* file descriptor */\r
- char *path; /* path or fd for error messages */\r
- unsigned size; /* buffer size, zero if not allocated yet */\r
- unsigned want; /* requested buffer size, default is GZBUFSIZE */\r
- unsigned char *in; /* input buffer */\r
- unsigned char *out; /* output buffer (double-sized when reading) */\r
- int direct; /* 0 if processing gzip, 1 if transparent */\r
- /* just for reading */\r
- int how; /* 0: get header, 1: copy, 2: decompress */\r
- z_off64_t start; /* where the gzip data started, for rewinding */\r
- int eof; /* true if end of input file reached */\r
- int past; /* true if read requested past end */\r
- /* just for writing */\r
- int level; /* compression level */\r
- int strategy; /* compression strategy */\r
- /* seek request */\r
- z_off64_t skip; /* amount to skip (already rewound if backwards) */\r
- int seek; /* true if seek request pending */\r
- /* error information */\r
- int err; /* error code */\r
- char *msg; /* error message */\r
- /* zlib inflate or deflate stream */\r
- z_stream strm; /* stream structure in-place (not a pointer) */\r
-} gz_state;\r
-typedef gz_state FAR *gz_statep;\r
-\r
-/* shared functions */\r
-void ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *));\r
-#if defined UNDER_CE\r
-char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error));\r
-#endif\r
-\r
-/* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t\r
- value -- needed when comparing unsigned to z_off64_t, which is signed\r
- (possible z_off64_t types off_t, off64_t, and long are all signed) */\r
-#ifdef INT_MAX\r
-# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX)\r
-#else\r
-unsigned ZLIB_INTERNAL gz_intmax OF((void));\r
-# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax())\r
-#endif\r