/* gzclose.c -- zlib gzclose() function1* Copyright (C) 2004, 2010 Mark Adler2* For conditions of distribution and use, see copyright notice in zlib.h3*/45#include "gzguts.h"67/* gzclose() is in a separate file so that it is linked in only if it is used.8That way the other gzclose functions can be used instead to avoid linking in9unneeded compression or decompression routines. */10int ZEXPORT gzclose(gzFile file) {11#ifndef NO_GZCOMPRESS12gz_statep state;1314if (file == NULL)15return Z_STREAM_ERROR;16state = (gz_statep)file;1718return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file);19#else20return gzclose_r(file);21#endif22}232425