mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-07 23:13:34 +00:00
28 lines
795 B
C
28 lines
795 B
C
|
#include "third_party/zlib/gz/gzguts.inc"
|
||
|
// clang-format off
|
||
|
|
||
|
/* gzclose.c -- zlib gzclose() function
|
||
|
* Copyright (C) 2004, 2010 Mark Adler
|
||
|
* For conditions of distribution and use, see copyright notice in zlib.h
|
||
|
*/
|
||
|
|
||
|
asm(".ident\t\"\\n\\n\
|
||
|
zlib (zlib License)\\n\
|
||
|
Copyright 1995-2017 Jean-loup Gailly and Mark Adler\"");
|
||
|
asm(".include \"libc/disclaimer.inc\"");
|
||
|
|
||
|
/* gzclose() is in a separate file so that it is linked in only if it is used.
|
||
|
That way the other gzclose functions can be used instead to avoid linking in
|
||
|
unneeded compression or decompression routines. */
|
||
|
int gzclose(file)
|
||
|
gzFile file;
|
||
|
{
|
||
|
gz_statep state;
|
||
|
|
||
|
if (file == NULL)
|
||
|
return Z_STREAM_ERROR;
|
||
|
state = (gz_statep)file;
|
||
|
|
||
|
return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file);
|
||
|
}
|