(gz)
| 295 | int gzclose OF((gzFile)); |
| 296 | |
| 297 | int gzclose(gz) |
| 298 | gzFile gz; |
| 299 | { |
| 300 | z_stream *strm; |
| 301 | unsigned char out[BUFLEN]; |
| 302 | |
| 303 | if (gz == NULL) |
| 304 | return Z_STREAM_ERROR; |
| 305 | strm = &(gz->strm); |
| 306 | if (gz->write) { |
| 307 | strm->next_in = Z_NULL; |
| 308 | strm->avail_in = 0; |
| 309 | do { |
| 310 | strm->next_out = out; |
| 311 | strm->avail_out = BUFLEN; |
| 312 | (void)deflate(strm, Z_FINISH); |
| 313 | fwrite(out, 1, BUFLEN - strm->avail_out, gz->file); |
| 314 | } while (strm->avail_out == 0); |
| 315 | deflateEnd(strm); |
| 316 | } |
| 317 | else |
| 318 | inflateEnd(strm); |
| 319 | fclose(gz->file); |
| 320 | free(gz); |
| 321 | return Z_OK; |
| 322 | } |
| 323 | |
| 324 | const char *gzerror OF((gzFile, int *)); |
| 325 |
no test coverage detected