ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
gzclose.c
Go to the documentation of this file.
1/* gzclose.c -- zlib gzclose() function
2 * Copyright (C) 2004, 2010 Mark Adler
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */
5
6#include <stdio.h>
7#include <stdlib.h>
8#include <string.h>
10
11#include "gzguts.h"
12
14
15/* gzclose() is in a separate file so that it is linked in only if it is used.
16 That way the other gzclose functions can be used instead to avoid linking in
17 unneeded compression or decompression routines. */
19{
20#ifndef NO_GZCOMPRESS
21 gz_statep state;
22
23 if (file == NULL)
24 return Z_STREAM_ERROR;
25 state = (gz_statep)file;
26
27 return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file);
28#else
29 return gzclose_r(file);
30#endif
31}
32
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
ABC_NAMESPACE_IMPL_START int ZEXPORT gzclose(gzFile file)
Definition gzclose.c:18
gz_state FAR * gz_statep
Definition gzguts.h:129
#define GZ_READ
Definition gzguts.h:89
int ZEXPORT gzclose_r(gzFile file)
Definition gzread.c:612
int ZEXPORT gzclose_w(gzFile file)
Definition gzwrite.c:486
Definition file.h:23
#define ZEXPORT
Definition zconf.h:322
#define Z_STREAM_ERROR
Definition zlib.h:185
voidp gzFile
Definition zlib.h:1173