(MU_ERR_FAILURE): New macro
Showing
2 changed files
with
33 additions
and
28 deletions
... | @@ -26,48 +26,49 @@ extern "C" { | ... | @@ -26,48 +26,49 @@ extern "C" { |
26 | 26 | ||
27 | #define MU_ERR_BASE 0x1000 | 27 | #define MU_ERR_BASE 0x1000 |
28 | 28 | ||
29 | #define MU_ERR_NO_HANDLER (MU_ERR_BASE | 0x001) | 29 | #define MU_ERR_FAILURE (MU_ERR_BASE + 1) |
30 | #define MU_ERR_EMPTY_VFN (MU_ERR_BASE | 0x002) | 30 | #define MU_ERR_NO_HANDLER (MU_ERR_BASE + 2) |
31 | #define MU_ERR_EMPTY_VFN (MU_ERR_BASE + 3) | ||
31 | 32 | ||
32 | #define MU_ERR_OUT_NULL (MU_ERR_BASE | 0x003) | 33 | #define MU_ERR_OUT_NULL (MU_ERR_BASE + 4) |
33 | #define MU_ERR_OUT_PTR_NULL (MU_ERR_BASE | 0x004) | 34 | #define MU_ERR_OUT_PTR_NULL (MU_ERR_BASE + 5) |
34 | 35 | ||
35 | #define MU_ERR_MBX_NULL (MU_ERR_BASE | 0x005) | 36 | #define MU_ERR_MBX_NULL (MU_ERR_BASE + 6) |
36 | 37 | ||
37 | #define MU_ERR_BAD_822_FORMAT (MU_ERR_BASE | 0x006) | 38 | #define MU_ERR_BAD_822_FORMAT (MU_ERR_BASE + 7) |
38 | #define MU_ERR_EMPTY_ADDRESS (MU_ERR_BASE | 0x007) | 39 | #define MU_ERR_EMPTY_ADDRESS (MU_ERR_BASE + 8) |
39 | 40 | ||
40 | #define MU_ERR_LOCKER_NULL (MU_ERR_BASE | 0x008) | 41 | #define MU_ERR_LOCKER_NULL (MU_ERR_BASE + 9) |
41 | #define MU_ERR_LOCK_CONFLICT (MU_ERR_BASE | 0x009) | 42 | #define MU_ERR_LOCK_CONFLICT (MU_ERR_BASE + 10) |
42 | #define MU_ERR_LOCK_BAD_LOCK (MU_ERR_BASE | 0x00a) | 43 | #define MU_ERR_LOCK_BAD_LOCK (MU_ERR_BASE + 11) |
43 | #define MU_ERR_LOCK_BAD_FILE (MU_ERR_BASE | 0x00b) | 44 | #define MU_ERR_LOCK_BAD_FILE (MU_ERR_BASE + 12) |
44 | #define MU_ERR_LOCK_NOT_HELD (MU_ERR_BASE | 0x00c) | 45 | #define MU_ERR_LOCK_NOT_HELD (MU_ERR_BASE + 13) |
45 | #define MU_ERR_LOCK_EXT_FAIL (MU_ERR_BASE | 0x00d) | 46 | #define MU_ERR_LOCK_EXT_FAIL (MU_ERR_BASE + 14) |
46 | /* external program not found, or lack of system resources */ | 47 | /* external program not found, or lack of system resources */ |
47 | #define MU_ERR_LOCK_EXT_ERR (MU_ERR_BASE | 0x00e) | 48 | #define MU_ERR_LOCK_EXT_ERR (MU_ERR_BASE + 15) |
48 | /* external program failed, specific reason unknown */ | 49 | /* external program failed, specific reason unknown */ |
49 | #define MU_ERR_LOCK_EXT_KILLED (MU_ERR_BASE | 0x00f) | 50 | #define MU_ERR_LOCK_EXT_KILLED (MU_ERR_BASE + 16) |
50 | /* external program was interrupted */ | 51 | /* external program was interrupted */ |
51 | 52 | ||
52 | #define MU_ERR_NO_SUCH_USER (MU_ERR_BASE | 0x010) | 53 | #define MU_ERR_NO_SUCH_USER (MU_ERR_BASE + 17) |
53 | 54 | ||
54 | #define MU_ERR_GETHOSTBYNAME (MU_ERR_BASE | 0x011) | 55 | #define MU_ERR_GETHOSTBYNAME (MU_ERR_BASE + 18) |
55 | 56 | ||
56 | #define MU_ERR_BAD_RESUMPTION (MU_ERR_BASE | 0x012) | 57 | #define MU_ERR_BAD_RESUMPTION (MU_ERR_BASE + 19) |
57 | 58 | ||
58 | #define MU_ERR_MAILER_BAD_FROM (MU_ERR_BASE | 0x013) | 59 | #define MU_ERR_MAILER_BAD_FROM (MU_ERR_BASE + 20) |
59 | #define MU_ERR_MAILER_BAD_TO (MU_ERR_BASE | 0x014) | 60 | #define MU_ERR_MAILER_BAD_TO (MU_ERR_BASE + 21) |
60 | #define MU_ERR_MAILER_NO_RCPT_TO (MU_ERR_BASE | 0x015) | 61 | #define MU_ERR_MAILER_NO_RCPT_TO (MU_ERR_BASE + 22) |
61 | #define MU_ERR_MAILER_BAD_URL (MU_ERR_BASE | 0x016) | 62 | #define MU_ERR_MAILER_BAD_URL (MU_ERR_BASE + 23) |
62 | #define MU_ERR_SMTP_RCPT_FAILED (MU_ERR_BASE | 0x017) | 63 | #define MU_ERR_SMTP_RCPT_FAILED (MU_ERR_BASE + 24) |
63 | 64 | ||
64 | #define MU_ERR_TCP_NO_HOST (MU_ERR_BASE | 0x018) | 65 | #define MU_ERR_TCP_NO_HOST (MU_ERR_BASE + 25) |
65 | #define MU_ERR_TCP_NO_PORT (MU_ERR_BASE | 0x019) | 66 | #define MU_ERR_TCP_NO_PORT (MU_ERR_BASE + 26) |
66 | 67 | ||
67 | #define MU_ERR_BAD_2047_INPUT (MU_ERR_BASE | 0x020) | 68 | #define MU_ERR_BAD_2047_INPUT (MU_ERR_BASE + 27) |
68 | 69 | ||
69 | const char* mu_errname __P((int e)); | 70 | const char *mu_errname __P((int e)); |
70 | const char* mu_strerror __P((int e)); | 71 | const char *mu_strerror __P((int e)); |
71 | 72 | ||
72 | #ifdef __cplusplus | 73 | #ifdef __cplusplus |
73 | } | 74 | } | ... | ... |
... | @@ -46,6 +46,8 @@ mu_errname (int e) | ... | @@ -46,6 +46,8 @@ mu_errname (int e) |
46 | EN(EEXIST); | 46 | EN(EEXIST); |
47 | EN(EINVAL); | 47 | EN(EINVAL); |
48 | 48 | ||
49 | EN(MU_ERR_FAILURE); | ||
50 | |||
49 | EN(MU_ERR_NO_HANDLER); | 51 | EN(MU_ERR_NO_HANDLER); |
50 | EN(MU_ERR_EMPTY_VFN); | 52 | EN(MU_ERR_EMPTY_VFN); |
51 | 53 | ||
... | @@ -90,6 +92,8 @@ mu_strerror (int e) | ... | @@ -90,6 +92,8 @@ mu_strerror (int e) |
90 | #define ES(x, d) case x: return d | 92 | #define ES(x, d) case x: return d |
91 | ES(EOK, _("Success")); | 93 | ES(EOK, _("Success")); |
92 | 94 | ||
95 | ES(MU_ERR_FAILURE, _("Operation failed")); | ||
96 | |||
93 | ES(MU_ERR_NO_HANDLER, _("No registered handler")); | 97 | ES(MU_ERR_NO_HANDLER, _("No registered handler")); |
94 | ES(MU_ERR_EMPTY_VFN, _("Empty virtual function")); | 98 | ES(MU_ERR_EMPTY_VFN, _("Empty virtual function")); |
95 | 99 | ... | ... |
-
Please register or sign in to post a comment