diff options
author | cvs2git <rtems-devel@rtems.org> | 2011-03-18 10:11:30 +0000 |
---|---|---|
committer | cvs2git <rtems-devel@rtems.org> | 2011-03-18 10:11:30 +0000 |
commit | b40c451c061d0e5bfd030d12556b5ac2d702064f (patch) | |
tree | 5e7d6f4154396a53d6aa5ba54a426648d38de786 /cpukit/zlib/gzclose.c | |
parent | Import from zlib-1.2.4 (diff) | |
download | rtems-b40c451c061d0e5bfd030d12556b5ac2d702064f.tar.bz2 |
This commit was manufactured by cvs2svn to create branch 'zlib'.
Cherrypick from master 2011-03-18 10:11:29 UTC Joel Sherrill <joel.sherrill@OARcorp.com> '2010-03-22 Joel Sherrill <joel.sherrill@oarcorp.com>':
cpukit/zlib/doc/algorithm.txt
cpukit/zlib/gzclose.c
cpukit/zlib/gzguts.h
cpukit/zlib/gzlib.c
cpukit/zlib/gzread.c
cpukit/zlib/gzwrite.c
Diffstat (limited to 'cpukit/zlib/gzclose.c')
-rw-r--r-- | cpukit/zlib/gzclose.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/cpukit/zlib/gzclose.c b/cpukit/zlib/gzclose.c new file mode 100644 index 0000000000..caeb99a317 --- /dev/null +++ b/cpukit/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 +} |