notmuch/util/zlib-extra.h
David Bremner 152b6cac5d util: make remaining headers includable from C++
libnotmuch_util.a is supposed to be usable from the library and the
CLI, but much the library is compiled as C++. Add in appropriate
wrapping to prevent symbol mangling. These wrappers already existed in
string-util.h; it seems better to be consistent.
2019-03-11 22:26:50 -03:00

34 lines
666 B
C

#ifndef _ZLIB_EXTRA_H
#define _ZLIB_EXTRA_H
#include "util.h"
#include <zlib.h>
#ifdef __cplusplus
extern "C" {
#endif
/* 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);
#ifdef __cplusplus
}
#endif
#endif