diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2011-09-26 22:50:28 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2011-09-26 22:50:28 -0700 |
commit | acfc85772a811f4c0efec835a3087b53f83f6079 (patch) | |
tree | fda6596291da38d9d3c8eaf5c521413b2b32fcd8 /gzguts.h | |
parent | 8e0d212910a42b3f856bbaebed970e8ddc081ca3 (diff) | |
download | zlib-acfc85772a811f4c0efec835a3087b53f83f6079.tar.gz |
Change gzgetc() to a macro for speed (~40% speedup in testing).
Diffstat (limited to 'gzguts.h')
-rw-r--r-- | gzguts.h | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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 */ |