ยปCore Development>Code coverage>Modules/zlib/gzclose.c

Python code coverage for Modules/zlib/gzclose.c

#countcontent
1n/a/* gzclose.c -- zlib gzclose() function
2n/a * Copyright (C) 2004, 2010 Mark Adler
3n/a * For conditions of distribution and use, see copyright notice in zlib.h
4n/a */
5n/a
6n/a#include "gzguts.h"
7n/a
8n/a/* gzclose() is in a separate file so that it is linked in only if it is used.
9n/a That way the other gzclose functions can be used instead to avoid linking in
10n/a unneeded compression or decompression routines. */
11n/aint ZEXPORT gzclose(file)
12n/a gzFile file;
13n/a{
14n/a#ifndef NO_GZCOMPRESS
15n/a gz_statep state;
16n/a
17n/a if (file == NULL)
18n/a return Z_STREAM_ERROR;
19n/a state = (gz_statep)file;
20n/a
21n/a return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file);
22n/a#else
23n/a return gzclose_r(file);
24n/a#endif
25n/a}