From acfc85772a811f4c0efec835a3087b53f83f6079 Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Mon, 26 Sep 2011 22:50:28 -0700 Subject: Change gzgetc() to a macro for speed (~40% speedup in testing). --- gzguts.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gzguts.h') diff --git a/gzguts.h b/gzguts.h index 63b0c3f..ab3313a 100644 --- a/gzguts.h +++ b/gzguts.h @@ -84,18 +84,20 @@ /* internal gzip file state data structure */ 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 */ int mode; /* see gzip modes above */ int fd; /* file descriptor */ 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 want; /* requested buffer size, default is GZBUFSIZE */ unsigned char *in; /* input buffer */ unsigned char *out; /* output buffer (double-sized when reading) */ - unsigned char *next; /* next output data to deliver or write */ /* 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 */ int how; /* 0: get header, 1: copy, 2: decompress */ -- cgit v1.2.3-55-g6feb