X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=util%2Fzlib-extra.h;h=296dc91441be04e0c32fbacd7938819750930c9b;hb=2c1f783f5f4ad28d89f2e83d7253bae7bba98440;hp=aedfd48fcb06b73e52ff3514e9fb152dec1b831e;hpb=f7130468d27c4f37d45e6aa60baacfc3329ccff4;p=notmuch diff --git a/util/zlib-extra.h b/util/zlib-extra.h index aedfd48f..296dc914 100644 --- a/util/zlib-extra.h +++ b/util/zlib-extra.h @@ -4,6 +4,10 @@ #include "util.h" #include +#ifdef __cplusplus +extern "C" { +#endif + /* Like getline, but read from a gzFile. Allocation is with talloc. * Returns: * @@ -22,4 +26,14 @@ gz_getline (void *ctx, char **lineptr, ssize_t *bytes_read, gzFile stream); const char * gz_error_string (util_status_t status, gzFile stream); + +/* Call gzerror with a dummy errno argument, the docs don't promise to + * support the NULL case */ +inline const char * +gzerror_str(gzFile file) { int dummy; return gzerror (file, &dummy); } + +#ifdef __cplusplus +} +#endif + #endif