version 1.1.1.1, 2012/02/21 16:23:02
|
version 1.1.1.2, 2013/07/22 10:46:14
|
Line 1
|
Line 1
|
/* gzguts.h -- zlib internal header definitions for gz* operations |
/* gzguts.h -- zlib internal header definitions for gz* operations |
* Copyright (C) 2004, 2005, 2010 Mark Adler | * Copyright (C) 2004, 2005, 2010, 2011, 2012 Mark Adler |
* For conditions of distribution and use, see copyright notice in zlib.h |
* For conditions of distribution and use, see copyright notice in zlib.h |
*/ |
*/ |
|
|
Line 27
|
Line 27
|
#endif |
#endif |
#include <fcntl.h> |
#include <fcntl.h> |
|
|
|
#ifdef __TURBOC__ |
|
# include <io.h> |
|
#endif |
|
|
#ifdef NO_DEFLATE /* for compatibility with old definition */ |
#ifdef NO_DEFLATE /* for compatibility with old definition */ |
# define NO_GZCOMPRESS |
# define NO_GZCOMPRESS |
#endif |
#endif |
|
|
#ifdef _MSC_VER | #if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550) |
# include <io.h> | # ifndef HAVE_VSNPRINTF |
# define vsnprintf _vsnprintf | # define HAVE_VSNPRINTF |
| # endif |
#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 |
|
/* vsnprintf may exist on some MS-DOS compilers (DJGPP?), |
|
but for now we just assume it doesn't. */ |
|
# define NO_vsnprintf |
|
# endif |
|
# ifdef __TURBOC__ |
|
# define NO_vsnprintf |
|
# endif |
|
# ifdef WIN32 |
|
/* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */ |
|
# if !defined(vsnprintf) && !defined(NO_vsnprintf) |
|
# if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 ) |
|
# include <io.h> |
|
# 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 |
|
|
#ifndef local |
#ifndef local |
# define local static |
# define local static |
#endif |
#endif |
Line 68
|
Line 117
|
ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); |
ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); |
#endif |
#endif |
|
|
|
/* default memLevel */ |
|
#if MAX_MEM_LEVEL >= 8 |
|
# define DEF_MEM_LEVEL 8 |
|
#else |
|
# define DEF_MEM_LEVEL MAX_MEM_LEVEL |
|
#endif |
|
|
/* default i/o buffer size -- double this for output when reading */ |
/* default i/o buffer size -- double this for output when reading */ |
#define GZBUFSIZE 8192 |
#define GZBUFSIZE 8192 |
|
|
Line 84
|
Line 140
|
|
|
/* internal gzip file state data structure */ |
/* internal gzip file state data structure */ |
typedef struct { |
typedef struct { |
|
/* exposed contents for gzgetc() macro */ |
|
struct gzFile_s x; /* "x" for exposed */ |
|
/* x.have: number of bytes available at x.next */ |
|
/* x.next: next output data to deliver or write */ |
|
/* x.pos: current position in uncompressed data */ |
/* used for both reading and writing */ |
/* used for both reading and writing */ |
int mode; /* see gzip modes above */ |
int mode; /* see gzip modes above */ |
int fd; /* file descriptor */ |
int fd; /* file descriptor */ |
char *path; /* path or fd for error messages */ |
char *path; /* path or fd for error messages */ |
z_off64_t pos; /* current position in uncompressed data */ |
|
unsigned size; /* buffer size, zero if not allocated yet */ |
unsigned size; /* buffer size, zero if not allocated yet */ |
unsigned want; /* requested buffer size, default is GZBUFSIZE */ |
unsigned want; /* requested buffer size, default is GZBUFSIZE */ |
unsigned char *in; /* input buffer */ |
unsigned char *in; /* input buffer */ |
unsigned char *out; /* output buffer (double-sized when reading) */ |
unsigned char *out; /* output buffer (double-sized when reading) */ |
unsigned char *next; /* next output data to deliver or write */ | int direct; /* 0 if processing gzip, 1 if transparent */ |
/* just for reading */ |
/* just for reading */ |
unsigned have; /* amount of output data unused at next */ |
|
int eof; /* true if end of input file reached */ |
|
z_off64_t start; /* where the gzip data started, for rewinding */ |
|
z_off64_t raw; /* where the raw data started, for seeking */ |
|
int how; /* 0: get header, 1: copy, 2: decompress */ |
int how; /* 0: get header, 1: copy, 2: decompress */ |
int direct; /* true if last read direct, false if gzip */ | z_off64_t start; /* where the gzip data started, for rewinding */ |
| int eof; /* true if end of input file reached */ |
| int past; /* true if read requested past end */ |
/* just for writing */ |
/* just for writing */ |
int level; /* compression level */ |
int level; /* compression level */ |
int strategy; /* compression strategy */ |
int strategy; /* compression strategy */ |