/* 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(file)11gzFile file;12{13#ifndef NO_GZCOMPRESS14gz_statep state;1516if (file == NULL)17return Z_STREAM_ERROR;18state = (gz_statep)file;1920return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file);21#else22return gzclose_r(file);23#endif24}252627