diff options
| author | David Bremner <bremner@debian.org> | 2018-06-12 22:39:33 -0300 |
|---|---|---|
| committer | David Bremner <bremner@debian.org> | 2018-06-12 22:39:33 -0300 |
| commit | 045f0e455ac94e2393d0d729c9bbdf3459a4860f (patch) | |
| tree | 8d8b46ecba2c3c128365f16ece54377b987dbe58 /util/util.c | |
Import notmuch_0.27.orig.tar.gz
[dgit import orig notmuch_0.27.orig.tar.gz]
Diffstat (limited to 'util/util.c')
| -rw-r--r-- | util/util.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/util/util.c b/util/util.c new file mode 100644 index 00000000..06659b35 --- /dev/null +++ b/util/util.c @@ -0,0 +1,24 @@ +#include "util.h" +#include "error_util.h" +#include <string.h> +#include <errno.h> + +const char * +util_error_string (util_status_t errnum) +{ + switch (errnum) { + case UTIL_SUCCESS: + return "success"; + case UTIL_OUT_OF_MEMORY: + return "out of memory"; + case UTIL_EOF: + return "end of file"; + case UTIL_ERRNO: + return strerror (errno); + case UTIL_GZERROR: + /* we lack context to be more informative here */ + return "zlib error"; + default: + INTERNAL_ERROR("unexpected error status %d", errnum); + } +} |
