lemon-project-template-glpk
diff deps/glpk/src/zlib/gzclose.c @ 9:33de93886c88
Import GLPK 4.47
author | Alpar Juttner <alpar@cs.elte.hu> |
---|---|
date | Sun, 06 Nov 2011 20:59:10 +0100 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/deps/glpk/src/zlib/gzclose.c Sun Nov 06 20:59:10 2011 +0100 1.3 @@ -0,0 +1,25 @@ 1.4 +/* gzclose.c -- zlib gzclose() function 1.5 + * Copyright (C) 2004, 2010 Mark Adler 1.6 + * For conditions of distribution and use, see copyright notice in zlib.h 1.7 + */ 1.8 + 1.9 +#include "gzguts.h" 1.10 + 1.11 +/* gzclose() is in a separate file so that it is linked in only if it is used. 1.12 + That way the other gzclose functions can be used instead to avoid linking in 1.13 + unneeded compression or decompression routines. */ 1.14 +int ZEXPORT gzclose(file) 1.15 + gzFile file; 1.16 +{ 1.17 +#ifndef NO_GZCOMPRESS 1.18 + gz_statep state; 1.19 + 1.20 + if (file == NULL) 1.21 + return Z_STREAM_ERROR; 1.22 + state = (gz_statep)file; 1.23 + 1.24 + return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); 1.25 +#else 1.26 + return gzclose_r(file); 1.27 +#endif 1.28 +}