lemon-project-template-glpk
annotate deps/glpk/src/zlib/gzclose.c @ 11:4fc6ad2fb8a6
Test GLPK in src/main.cc
author | Alpar Juttner <alpar@cs.elte.hu> |
---|---|
date | Sun, 06 Nov 2011 21:43:29 +0100 |
parents | |
children |
rev | line source |
---|---|
alpar@9 | 1 /* gzclose.c -- zlib gzclose() function |
alpar@9 | 2 * Copyright (C) 2004, 2010 Mark Adler |
alpar@9 | 3 * For conditions of distribution and use, see copyright notice in zlib.h |
alpar@9 | 4 */ |
alpar@9 | 5 |
alpar@9 | 6 #include "gzguts.h" |
alpar@9 | 7 |
alpar@9 | 8 /* gzclose() is in a separate file so that it is linked in only if it is used. |
alpar@9 | 9 That way the other gzclose functions can be used instead to avoid linking in |
alpar@9 | 10 unneeded compression or decompression routines. */ |
alpar@9 | 11 int ZEXPORT gzclose(file) |
alpar@9 | 12 gzFile file; |
alpar@9 | 13 { |
alpar@9 | 14 #ifndef NO_GZCOMPRESS |
alpar@9 | 15 gz_statep state; |
alpar@9 | 16 |
alpar@9 | 17 if (file == NULL) |
alpar@9 | 18 return Z_STREAM_ERROR; |
alpar@9 | 19 state = (gz_statep)file; |
alpar@9 | 20 |
alpar@9 | 21 return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); |
alpar@9 | 22 #else |
alpar@9 | 23 return gzclose_r(file); |
alpar@9 | 24 #endif |
alpar@9 | 25 } |