=========================================================================== Flushes all pending output if necessary, closes the compressed file and deallocates all the (de)compression state. */
(file)
| 956 | and deallocates all the (de)compression state. |
| 957 | */ |
| 958 | int ZEXPORT gzclose (file) |
| 959 | gzFile file; |
| 960 | { |
| 961 | gz_stream *s = (gz_stream*)file; |
| 962 | |
| 963 | if (s == NULL) return Z_STREAM_ERROR; |
| 964 | |
| 965 | if (s->mode == 'w') { |
| 966 | #ifdef NO_GZCOMPRESS |
| 967 | return Z_STREAM_ERROR; |
| 968 | #else |
| 969 | if (do_flush (file, Z_FINISH) != Z_OK) |
| 970 | return destroy((gz_stream*)file); |
| 971 | |
| 972 | putLong (s->file, s->crc); |
| 973 | putLong (s->file, (uLong)(s->in & 0xffffffff)); |
| 974 | #endif |
| 975 | } |
| 976 | return destroy((gz_stream*)file); |
| 977 | } |
| 978 | |
| 979 | #ifdef STDC |
| 980 | # define zstrerror(errnum) strerror(errnum) |