2014-03-29 18:53:17 +01:00
|
|
|
#ifndef _ZLIB_EXTRA_H
|
|
|
|
#define _ZLIB_EXTRA_H
|
|
|
|
|
|
|
|
#include "util.h"
|
|
|
|
#include <zlib.h>
|
|
|
|
|
2019-03-02 21:26:06 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2014-03-29 18:53:17 +01:00
|
|
|
/* Like getline, but read from a gzFile. Allocation is with talloc.
|
|
|
|
* Returns:
|
|
|
|
*
|
|
|
|
* UTIL_SUCCESS, UTIL_OUT_OF_MEMORY, UTIL_ERRNO, UTIL_GZERROR
|
|
|
|
* Consult util.h for description
|
|
|
|
*
|
|
|
|
* UTIL_EOF End of file encountered before
|
|
|
|
* any characters read
|
|
|
|
*/
|
|
|
|
util_status_t
|
|
|
|
gz_getline (void *ctx, char **lineptr, ssize_t *bytes_read, gzFile stream);
|
|
|
|
|
|
|
|
/* return a suitable error string based on the return status
|
|
|
|
* from gz_readline
|
|
|
|
*/
|
|
|
|
|
|
|
|
const char *
|
|
|
|
gz_error_string (util_status_t status, gzFile stream);
|
2019-03-02 21:26:06 +01:00
|
|
|
|
2020-04-13 01:00:31 +02:00
|
|
|
/* Call gzerror with a dummy errno argument, the docs don't promise to
|
|
|
|
* support the NULL case */
|
2020-04-27 14:24:22 +02:00
|
|
|
const char *
|
|
|
|
gzerror_str(gzFile file);
|
2020-04-13 01:00:31 +02:00
|
|
|
|
2019-03-02 21:26:06 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2014-03-29 18:53:17 +01:00
|
|
|
#endif
|