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