]> git.notmuchmail.org Git - notmuch/blobdiff - util/util.h
util: add gz_readline
[notmuch] / util / util.h
diff --git a/util/util.h b/util/util.h
new file mode 100644 (file)
index 0000000..d12fadb
--- /dev/null
@@ -0,0 +1,29 @@
+#ifndef _UTIL_H
+#define _UTIL_H
+
+typedef enum util_status {
+    /**
+     * No error occurred.
+     */
+    UTIL_SUCCESS = 0,
+    /**
+     * Out of memory.
+     */
+    UTIL_OUT_OF_MEMORY,
+    /**
+     * End of stream reached while attempting to read.
+     */
+    UTIL_EOF,
+    /**
+     * Low level error occured, consult errno.
+     */
+    UTIL_ERRNO,
+    /**
+     * Zlib error occured, call gzerror for details.
+     */
+    UTIL_GZERROR
+} util_status_t;
+
+const char *
+util_error_string (util_status_t status);
+#endif