Chris@43: /* gzclose.c -- zlib gzclose() function Chris@43: * Copyright (C) 2004, 2010 Mark Adler Chris@43: * For conditions of distribution and use, see copyright notice in zlib.h Chris@43: */ Chris@43: Chris@43: #include "gzguts.h" Chris@43: Chris@43: /* gzclose() is in a separate file so that it is linked in only if it is used. Chris@43: That way the other gzclose functions can be used instead to avoid linking in Chris@43: unneeded compression or decompression routines. */ Chris@43: int ZEXPORT gzclose(file) Chris@43: gzFile file; Chris@43: { Chris@43: #ifndef NO_GZCOMPRESS Chris@43: gz_statep state; Chris@43: Chris@43: if (file == NULL) Chris@43: return Z_STREAM_ERROR; Chris@43: state = (gz_statep)file; Chris@43: Chris@43: return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); Chris@43: #else Chris@43: return gzclose_r(file); Chris@43: #endif Chris@43: }