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>
9
#include "
misc/util/abc_global.h
"
10
11
#include "
gzguts.h
"
12
13
ABC_NAMESPACE_IMPL_START
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. */
18
int
ZEXPORT
gzclose
(
gzFile
file
)
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
33
ABC_NAMESPACE_IMPL_END
abc_global.h
ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_START
Definition
abc_namespaces.h:54
ABC_NAMESPACE_IMPL_END
#define ABC_NAMESPACE_IMPL_END
Definition
abc_namespaces.h:55
gzclose
ABC_NAMESPACE_IMPL_START int ZEXPORT gzclose(gzFile file)
Definition
gzclose.c:18
gzguts.h
gz_statep
gz_state FAR * gz_statep
Definition
gzguts.h:129
GZ_READ
#define GZ_READ
Definition
gzguts.h:89
gzclose_r
int ZEXPORT gzclose_r(gzFile file)
Definition
gzread.c:612
gzclose_w
int ZEXPORT gzclose_w(gzFile file)
Definition
gzwrite.c:486
file
Definition
file.h:23
ZEXPORT
#define ZEXPORT
Definition
zconf.h:322
Z_STREAM_ERROR
#define Z_STREAM_ERROR
Definition
zlib.h:185
gzFile
voidp gzFile
Definition
zlib.h:1173
src
misc
zlib
gzclose.c
Generated by Doxygen 1.13.2 © 2025 EPTansuo. All rights reserved.
鲁ICP备2021046540号