]> git.notmuchmail.org Git - notmuch/blob - util/zlib-extra.h
209fa9989437d8cf77bf9ac60c739cb9fcb47a8f
[notmuch] / util / zlib-extra.h
1 #ifndef _ZLIB_EXTRA_H
2 #define _ZLIB_EXTRA_H
3
4 #include "util.h"
5 #include <zlib.h>
6
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10
11 /* Like getline, but read from a gzFile. Allocation is with talloc.
12  * Returns:
13  *
14  *   UTIL_SUCCESS, UTIL_OUT_OF_MEMORY, UTIL_ERRNO, UTIL_GZERROR
15  *                      Consult util.h for description
16  *
17  *   UTIL_EOF           End of file encountered before
18  *                      any characters read
19  */
20 util_status_t
21 gz_getline (void *ctx, char **lineptr, ssize_t *bytes_read, gzFile stream);
22
23 /* return a suitable error string based on the return status
24  *  from gz_readline
25  */
26
27 const char *
28 gz_error_string (util_status_t status, gzFile stream);
29
30 #ifdef __cplusplus
31 }
32 #endif
33
34 #endif