Files
rtems/cpukit/zlib/gzclose.c
cvs2git b40c451c06 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
2011-03-18 10:11:30 +00:00

26 lines
678 B
C

/* 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
}