summaryrefslogtreecommitdiff
path: root/gzclose.c
diff options
context:
space:
mode:
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 */