The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/contrib/zlib/gzclose.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    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 "gzguts.h"
    7 
    8 /* gzclose() is in a separate file so that it is linked in only if it is used.
    9    That way the other gzclose functions can be used instead to avoid linking in
   10    unneeded compression or decompression routines. */
   11 int ZEXPORT gzclose(file)
   12     gzFile file;
   13 {
   14 #ifndef NO_GZCOMPRESS
   15     gz_statep state;
   16 
   17     if (file == NULL)
   18         return Z_STREAM_ERROR;
   19     state = (gz_statep)file;
   20 
   21     return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file);
   22 #else
   23     return gzclose_r(file);
   24 #endif
   25 }

Cache object: d86a95bce5ab0451be99892adf7e3e8f


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.