summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/mailutils/errno.h8
-rw-r--r--mailbox/Makefile.am1
-rw-r--r--mailbox/muerrno.c43
3 files changed, 43 insertions, 9 deletions
diff --git a/include/mailutils/errno.h b/include/mailutils/errno.h
index 154ba14a9..627ab2d37 100644
--- a/include/mailutils/errno.h
+++ b/include/mailutils/errno.h
@@ -45,8 +45,14 @@ extern "C" {
#define MU_ERR_BAD_822_FORMAT (MU_ERR_BASE | 0x006)
#define MU_ERR_EMPTY_ADDRESS (MU_ERR_BASE | 0x007)
+#define MU_ERR_LOCKER_NULL (MU_ERR_BASE | 0x008)
+#define MU_ERR_LOCK_CONFLICT (MU_ERR_BASE | 0x009)
+#define MU_ERR_LOCK_BAD_LOCK (MU_ERR_BASE | 0x00a)
+#define MU_ERR_LOCK_BAD_FILE (MU_ERR_BASE | 0x00b)
+#define MU_ERR_LOCK_NOT_HELD (MU_ERR_BASE | 0x00c)
+
const char* mu_errname __P((int e));
-const char* mu_errstr __P((int e));
+const char* mu_errstring __P((int e));
#ifdef __cplusplus
}
diff --git a/mailbox/Makefile.am b/mailbox/Makefile.am
index 79edd72fa..3ffda3773 100644
--- a/mailbox/Makefile.am
+++ b/mailbox/Makefile.am
@@ -48,6 +48,7 @@ mime.c \
monitor.c \
mutil.c \
muerror.c \
+muerrno.c \
observer.c \
parse822.c \
property.c \
diff --git a/mailbox/muerrno.c b/mailbox/muerrno.c
index fe3feff6a..1004c5e21 100644
--- a/mailbox/muerrno.c
+++ b/mailbox/muerrno.c
@@ -19,10 +19,15 @@
# include <config.h>
#endif
+#include <errno.h>
#include <string.h>
#include <mailutils/errno.h>
+#ifndef EOK
+# define EOK 0
+#endif
+
const char*
mu_errname (int e)
{
@@ -42,26 +47,48 @@ mu_errname (int e)
EN(MU_ERR_NO_HANDLER)
EN(MU_ERR_EMPTY_VFN)
- EN(MU_ERR_NO_PTR)
+
+ EN(MU_ERR_OUT_NULL)
+ EN(MU_ERR_OUT_PTR_NULL)
EN(MU_ERR_MBX_NULL)
- EN(MU_ERR_MBX_PTR_NULL)
+
+ EN(MU_ERR_BAD_822_FORMAT)
+ EN(MU_ERR_EMPTY_ADDRESS)
+
+ EN(MU_ERR_LOCKER_NULL)
+ EN(MU_ERR_LOCK_CONFLICT)
+ EN(MU_ERR_LOCK_BAD_LOCK)
+ EN(MU_ERR_LOCK_BAD_FILE)
+ EN(MU_ERR_LOCK_NOT_HELD)
}
return "SYSTEM ERROR";
}
-const char* mu_errstr (int e)
+const char* mu_errstring (int e)
{
switch(e)
{
#define ES(x, d) case x: return d;
- ES(MU_ERR_NO_HANDLER, "No registered handler")
- ES(MU_ERR_EMPTY_VFN, "Empty virtual function")
- ES(MU_ERR_NO_PTR, "No pointer")
+ ES(EOK, "Success")
+
+ ES(MU_ERR_NO_HANDLER, "No registered handler")
+ ES(MU_ERR_EMPTY_VFN, "Empty virtual function")
+
+ ES(MU_ERR_OUT_NULL, "Pointer to output null")
+ ES(MU_ERR_OUT_PTR_NULL, "Pointer to output pointer null")
+
+ ES(MU_ERR_MBX_NULL, "Mailbox null")
+
+ ES(MU_ERR_BAD_822_FORMAT, "Format of RFC822 object is bad")
+ ES(MU_ERR_EMPTY_ADDRESS, "Address contains no addr specs")
- ES(MU_ERR_MBX_NULL, "Mailbox null")
- ES(MU_ERR_MBX_PTR_NULL, "Mailbox pointer null")
+ ES(MU_ERR_LOCKER_NULL, "Locker null")
+ ES(MU_ERR_LOCK_CONFLICT, "Conflict with previous locker")
+ ES(MU_ERR_LOCK_BAD_LOCK, "Lock file check failed")
+ ES(MU_ERR_LOCK_BAD_FILE, "File check failed")
+ ES(MU_ERR_LOCK_NOT_HELD, "Lock not held on file")
}
return strerror(e);

Return to:

Send suggestions and report system problems to the System administrator.