diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2014-06-11 18:36:34 +0400 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2014-06-11 18:36:34 +0400 |
commit | bb54fad0452fbcc876c4cfcb42f4590a2cb23be6 (patch) | |
tree | 1d357b0baf9652c1b35dbacef6c11bb81a1107e3 /deps/zlib/gzclose.c | |
parent | 7064cdafbd25f66de016467b381d9f4474fba40a (diff) | |
parent | 7cead31eddd36b6fd5ed6f166f64eb2a15aa23e7 (diff) |
Merge branch 'cmn/zlib-update' into cmn/update-zlib
Diffstat (limited to 'deps/zlib/gzclose.c')
-rw-r--r-- | deps/zlib/gzclose.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/deps/zlib/gzclose.c b/deps/zlib/gzclose.c new file mode 100644 index 000000000..caeb99a31 --- /dev/null +++ b/deps/zlib/gzclose.c @@ -0,0 +1,25 @@ +/* gzclose.c -- zlib gzclose() function + * Copyright (C) 2004, 2010 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "gzguts.h" + +/* gzclose() is in a separate file so that it is linked in only if it is used. + That way the other gzclose functions can be used instead to avoid linking in + unneeded compression or decompression routines. */ +int ZEXPORT gzclose(file) + gzFile file; +{ +#ifndef NO_GZCOMPRESS + gz_statep state; + + if (file == NULL) + return Z_STREAM_ERROR; + state = (gz_statep)file; + + return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); +#else + return gzclose_r(file); +#endif +} |