diff options
Diffstat (limited to 'zlib.h')
-rw-r--r-- | zlib.h | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -1297,6 +1297,18 @@ ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); | |||
1297 | If something other than a gzip stream is encountered after a gzip stream, | 1297 | If something other than a gzip stream is encountered after a gzip stream, |
1298 | that remaining trailing garbage is ignored (and no error is returned). | 1298 | that remaining trailing garbage is ignored (and no error is returned). |
1299 | 1299 | ||
1300 | gzread can be used to read a gzip file that is being concurrently written. | ||
1301 | Upon reaching the end of the input, gzread will return with the available | ||
1302 | data. If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then | ||
1303 | gzclearerr can be used to clear the end of file indicator in order to permit | ||
1304 | gzread to be tried again. Z_OK indicates that a gzip stream was completed | ||
1305 | on the last gzread. Z_BUF_ERROR indicates that the input file ended in the | ||
1306 | middle of a gzip stream. Note that gzread does not return -1 in the event | ||
1307 | of an incomplete gzip stream. This error is deferred until gzclose(), which | ||
1308 | will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip | ||
1309 | stream. Alternatively, gzerror can be used before gzclose to detect this | ||
1310 | case. | ||
1311 | |||
1300 | gzread returns the number of uncompressed bytes actually read, less than | 1312 | gzread returns the number of uncompressed bytes actually read, less than |
1301 | len for end of file, or -1 for error. | 1313 | len for end of file, or -1 for error. |
1302 | */ | 1314 | */ |
@@ -1480,7 +1492,8 @@ ZEXTERN int ZEXPORT gzclose OF((gzFile file)); | |||
1480 | must not be called more than once on the same allocation. | 1492 | must not be called more than once on the same allocation. |
1481 | 1493 | ||
1482 | gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a | 1494 | gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a |
1483 | file operation error, Z_MEM_ERROR if out of memory, or Z_OK on success. | 1495 | file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the |
1496 | last read ended in the middle of a gzip stream, or Z_OK on success. | ||
1484 | */ | 1497 | */ |
1485 | 1498 | ||
1486 | ZEXTERN int ZEXPORT gzclose_r OF((gzFile file)); | 1499 | ZEXTERN int ZEXPORT gzclose_r OF((gzFile file)); |