summaryrefslogtreecommitdiff
path: root/core/src/fxcodec/fx_zlib/zlib_v128/gzclose.c
diff options
context:
space:
mode:
authorJohn Abd-El-Malek <jabdelmalek@google.com>2014-05-17 22:33:34 -0700
committerJohn Abd-El-Malek <jabdelmalek@google.com>2014-05-17 22:33:34 -0700
commit5110c4743751145c4ae1934cd1d83bc6c55bb43f (patch)
treeb141608096b73163182764c25b895d3df4b2c182 /core/src/fxcodec/fx_zlib/zlib_v128/gzclose.c
parent76b563d2feed92ed328afb1f15e3466a9536b11b (diff)
downloadpdfium-5110c4743751145c4ae1934cd1d83bc6c55bb43f.tar.xz
Initial commit.
Diffstat (limited to 'core/src/fxcodec/fx_zlib/zlib_v128/gzclose.c')
-rw-r--r--core/src/fxcodec/fx_zlib/zlib_v128/gzclose.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/core/src/fxcodec/fx_zlib/zlib_v128/gzclose.c b/core/src/fxcodec/fx_zlib/zlib_v128/gzclose.c
new file mode 100644
index 0000000000..0f010b84c8
--- /dev/null
+++ b/core/src/fxcodec/fx_zlib/zlib_v128/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(
+ 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
+}