diff options
author | Björn Gustavsson <[email protected]> | 2014-01-10 12:52:20 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2014-01-14 09:30:34 +0100 |
commit | 8a147a73651713efebb9ac973f618a6d66685eca (patch) | |
tree | 7c766bdaeec0957e4847a8762d1e47685ecc507e /erts/emulator/drivers/common/gzio.h | |
parent | 9205b6671892e7516e8571e4ecf19bfa2ade1130 (diff) | |
download | otp-8a147a73651713efebb9ac973f618a6d66685eca.tar.gz otp-8a147a73651713efebb9ac973f618a6d66685eca.tar.bz2 otp-8a147a73651713efebb9ac973f618a6d66685eca.zip |
Don't make gzio.c dependent on the zutil.h header file
gzio.c is our own replacement for zlib's gzopen() etc
(based on a version of gzio.c that was included in an old version
of zlib).
Unfortunately, gzio.c still depends on the *internal* zlib header file
zutil.h which is not supposed to be used outside of the zlib source
code. The dependencies are the use of the gzFile typedef and the
F_OPEN() macro.
Instead of gzFile, define and use our own ErtsGzFile.
To get rid of the F_OPEN() macro, call open() of _wfopen() directly.
Diffstat (limited to 'erts/emulator/drivers/common/gzio.h')
-rw-r--r-- | erts/emulator/drivers/common/gzio.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/erts/emulator/drivers/common/gzio.h b/erts/emulator/drivers/common/gzio.h index 3f1e546140..ea50d922ec 100644 --- a/erts/emulator/drivers/common/gzio.h +++ b/erts/emulator/drivers/common/gzio.h @@ -17,11 +17,15 @@ * %CopyrightEnd% */ -gzFile erts_gzopen (const char *path, const char *mode); -int erts_gzread(gzFile file, voidp buf, unsigned len); -int erts_gzwrite(gzFile file, voidp buf, unsigned len); -int erts_gzseek(gzFile, int, int); -int erts_gzflush(gzFile file, int flush); -int erts_gzclose(gzFile file); +#include "zlib.h" + +typedef struct erts_gzFile* ErtsGzFile; + +ErtsGzFile erts_gzopen (const char *path, const char *mode); +int erts_gzread(ErtsGzFile file, voidp buf, unsigned len); +int erts_gzwrite(ErtsGzFile file, voidp buf, unsigned len); +int erts_gzseek(ErtsGzFile, int, int); +int erts_gzflush(ErtsGzFile file, int flush); +int erts_gzclose(ErtsGzFile file); ErlDrvBinary* erts_gzinflate_buffer(char*, uLong); ErlDrvBinary* erts_gzdeflate_buffer(char*, uLong); |