aboutsummaryrefslogtreecommitdiff
path: root/gzclose.c
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2011-09-09 23:26:49 -0700
committerMark Adler <madler@alumni.caltech.edu>2011-09-09 23:26:49 -0700
commitd004b047838a7e803818b4973a2e39e0ff8c1fa2 (patch)
tree9e8c804f78d73152c70d4ff24c6a7531a0d46782 /gzclose.c
parentf6194ef39af5864f792412460c354cc339dde7d1 (diff)
downloadzlib-d004b047838a7e803818b4973a2e39e0ff8c1fa2.tar.gz
zlib-d004b047838a7e803818b4973a2e39e0ff8c1fa2.tar.bz2
zlib-d004b047838a7e803818b4973a2e39e0ff8c1fa2.zip
zlib 1.2.3.5v1.2.3.5
Diffstat (limited to 'gzclose.c')
-rw-r--r--gzclose.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/gzclose.c b/gzclose.c
new file mode 100644
index 0000000..2cf2843
--- /dev/null
+++ b/gzclose.c
@@ -0,0 +1,29 @@
1/* gzclose.c -- zlib gzclose() function
2 * Copyright (C) 2004, 2010 Mark Adler
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */
5
6#ifndef OLD_GZIO
7
8#include "gzguts.h"
9
10/* gzclose() is in a separate file so that it is linked in only if it is used.
11 That way the other gzclose functions can be used instead to avoid linking in
12 unneeded compression or decompression routines. */
13int ZEXPORT gzclose(file)
14 gzFile file;
15{
16#ifndef NO_GZCOMPRESS
17 gz_statep state;
18
19 if (file == NULL)
20 return EOF;
21 state = (gz_statep)file;
22
23 return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file);
24#else
25 return gzclose_r(file);
26#endif
27}
28
29#endif /* !OLD_GZIO */