mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-22 17:34:54 +01:00
85d9219a62
The idea is to provide a more or less drop in replacement for readline to read from zlib/gzip streams. Take the opportunity to replace malloc with talloc.
24 lines
517 B
C
24 lines
517 B
C
#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);
|
|
}
|
|
}
|