(MU_ERR_BAD_2047_INPUT): New error code.
Showing
2 changed files
with
81 additions
and
76 deletions
... | @@ -64,6 +64,8 @@ extern "C" { | ... | @@ -64,6 +64,8 @@ extern "C" { |
64 | #define MU_ERR_TCP_NO_HOST (MU_ERR_BASE | 0x018) | 64 | #define MU_ERR_TCP_NO_HOST (MU_ERR_BASE | 0x018) |
65 | #define MU_ERR_TCP_NO_PORT (MU_ERR_BASE | 0x019) | 65 | #define MU_ERR_TCP_NO_PORT (MU_ERR_BASE | 0x019) |
66 | 66 | ||
67 | #define MU_ERR_BAD_2047_INPUT (MU_ERR_BASE | 0x020) | ||
68 | |||
67 | const char* mu_errname __P((int e)); | 69 | const char* mu_errname __P((int e)); |
68 | const char* mu_strerror __P((int e)); | 70 | const char* mu_strerror __P((int e)); |
69 | 71 | ... | ... |
... | @@ -34,48 +34,49 @@ mu_errname (int e) | ... | @@ -34,48 +34,49 @@ mu_errname (int e) |
34 | { | 34 | { |
35 | switch(e) | 35 | switch(e) |
36 | { | 36 | { |
37 | #define EN(x) case x: return #x; | 37 | #define EN(x) case x: return #x |
38 | 38 | ||
39 | EN(EOK) | 39 | EN(EOK); |
40 | EN(EPERM) | 40 | EN(EPERM); |
41 | EN(ENOENT) | 41 | EN(ENOENT); |
42 | EN(ESRCH) | 42 | EN(ESRCH); |
43 | EN(EINTR) | 43 | EN(EINTR); |
44 | EN(EAGAIN) | 44 | EN(EAGAIN); |
45 | EN(ENOMEM) | 45 | EN(ENOMEM); |
46 | EN(EEXIST) | 46 | EN(EEXIST); |
47 | EN(EINVAL) | 47 | EN(EINVAL); |
48 | 48 | ||
49 | EN(MU_ERR_NO_HANDLER) | 49 | EN(MU_ERR_NO_HANDLER); |
50 | EN(MU_ERR_EMPTY_VFN) | 50 | EN(MU_ERR_EMPTY_VFN); |
51 | 51 | ||
52 | EN(MU_ERR_OUT_NULL) | 52 | EN(MU_ERR_OUT_NULL); |
53 | EN(MU_ERR_OUT_PTR_NULL) | 53 | EN(MU_ERR_OUT_PTR_NULL); |
54 | 54 | ||
55 | EN(MU_ERR_MBX_NULL) | 55 | EN(MU_ERR_MBX_NULL); |
56 | 56 | ||
57 | EN(MU_ERR_BAD_822_FORMAT) | 57 | EN(MU_ERR_BAD_822_FORMAT); |
58 | EN(MU_ERR_EMPTY_ADDRESS) | 58 | EN(MU_ERR_EMPTY_ADDRESS); |
59 | 59 | ||
60 | EN(MU_ERR_LOCKER_NULL) | 60 | EN(MU_ERR_LOCKER_NULL); |
61 | EN(MU_ERR_LOCK_CONFLICT) | 61 | EN(MU_ERR_LOCK_CONFLICT); |
62 | EN(MU_ERR_LOCK_BAD_LOCK) | 62 | EN(MU_ERR_LOCK_BAD_LOCK); |
63 | EN(MU_ERR_LOCK_BAD_FILE) | 63 | EN(MU_ERR_LOCK_BAD_FILE); |
64 | EN(MU_ERR_LOCK_NOT_HELD) | 64 | EN(MU_ERR_LOCK_NOT_HELD); |
65 | EN(MU_ERR_LOCK_EXT_FAIL) | 65 | EN(MU_ERR_LOCK_EXT_FAIL); |
66 | EN(MU_ERR_LOCK_EXT_ERR) | 66 | EN(MU_ERR_LOCK_EXT_ERR); |
67 | EN(MU_ERR_LOCK_EXT_KILLED) | 67 | EN(MU_ERR_LOCK_EXT_KILLED); |
68 | 68 | ||
69 | EN(MU_ERR_NO_SUCH_USER) | 69 | EN(MU_ERR_NO_SUCH_USER); |
70 | EN(MU_ERR_GETHOSTBYNAME) | 70 | EN(MU_ERR_GETHOSTBYNAME); |
71 | EN(MU_ERR_BAD_RESUMPTION) | 71 | EN(MU_ERR_BAD_RESUMPTION); |
72 | EN(MU_ERR_MAILER_BAD_FROM) | 72 | EN(MU_ERR_MAILER_BAD_FROM); |
73 | EN(MU_ERR_MAILER_BAD_TO) | 73 | EN(MU_ERR_MAILER_BAD_TO); |
74 | EN(MU_ERR_MAILER_BAD_URL) | 74 | EN(MU_ERR_MAILER_BAD_URL); |
75 | EN(MU_ERR_MAILER_NO_RCPT_TO) | 75 | EN(MU_ERR_MAILER_NO_RCPT_TO); |
76 | EN(MU_ERR_SMTP_RCPT_FAILED) | 76 | EN(MU_ERR_SMTP_RCPT_FAILED); |
77 | EN(MU_ERR_TCP_NO_HOST) | 77 | EN(MU_ERR_TCP_NO_HOST); |
78 | EN(MU_ERR_TCP_NO_PORT) | 78 | EN(MU_ERR_TCP_NO_PORT); |
79 | EN(MU_ERR_BAD_2047_INPUT); | ||
79 | } | 80 | } |
80 | 81 | ||
81 | return "SYSTEM ERROR"; | 82 | return "SYSTEM ERROR"; |
... | @@ -86,40 +87,42 @@ mu_strerror (int e) | ... | @@ -86,40 +87,42 @@ mu_strerror (int e) |
86 | { | 87 | { |
87 | switch(e) | 88 | switch(e) |
88 | { | 89 | { |
89 | #define ES(x, d) case x: return d; | 90 | #define ES(x, d) case x: return d |
90 | ES(EOK, _("Success")) | 91 | ES(EOK, _("Success")); |
91 | 92 | ||
92 | ES(MU_ERR_NO_HANDLER, _("No registered handler")) | 93 | ES(MU_ERR_NO_HANDLER, _("No registered handler")); |
93 | ES(MU_ERR_EMPTY_VFN, _("Empty virtual function")) | 94 | ES(MU_ERR_EMPTY_VFN, _("Empty virtual function")); |
94 | 95 | ||
95 | ES(MU_ERR_OUT_NULL, _("Pointer to output null")) | 96 | ES(MU_ERR_OUT_NULL, _("Pointer to output null")); |
96 | ES(MU_ERR_OUT_PTR_NULL, _("Pointer to output pointer null")) | 97 | ES(MU_ERR_OUT_PTR_NULL, _("Pointer to output pointer null")); |
97 | 98 | ||
98 | ES(MU_ERR_MBX_NULL, _("Mailbox null")) | 99 | ES(MU_ERR_MBX_NULL, _("Mailbox null")); |
99 | 100 | ||
100 | ES(MU_ERR_BAD_822_FORMAT, _("Format of RFC822 object is bad")) | 101 | ES(MU_ERR_BAD_822_FORMAT, _("Format of RFC822 object is bad")); |
101 | ES(MU_ERR_EMPTY_ADDRESS, _("Address contains no addr specs")) | 102 | ES(MU_ERR_EMPTY_ADDRESS, _("Address contains no addr specs")); |
102 | 103 | ||
103 | ES(MU_ERR_LOCKER_NULL, _("Locker null")) | 104 | ES(MU_ERR_LOCKER_NULL, _("Locker null")); |
104 | ES(MU_ERR_LOCK_CONFLICT, _("Conflict with previous locker")) | 105 | ES(MU_ERR_LOCK_CONFLICT, _("Conflict with previous locker")); |
105 | ES(MU_ERR_LOCK_BAD_LOCK, _("Lock file check failed")) | 106 | ES(MU_ERR_LOCK_BAD_LOCK, _("Lock file check failed")); |
106 | ES(MU_ERR_LOCK_BAD_FILE, _("File check failed")) | 107 | ES(MU_ERR_LOCK_BAD_FILE, _("File check failed")); |
107 | ES(MU_ERR_LOCK_NOT_HELD, _("Lock not held on file")) | 108 | ES(MU_ERR_LOCK_NOT_HELD, _("Lock not held on file")); |
108 | ES(MU_ERR_LOCK_EXT_FAIL, _("Failed to exec external locker")) | 109 | ES(MU_ERR_LOCK_EXT_FAIL, _("Failed to exec external locker")); |
109 | ES(MU_ERR_LOCK_EXT_ERR, _("External locker failed")) | 110 | ES(MU_ERR_LOCK_EXT_ERR, _("External locker failed")); |
110 | ES(MU_ERR_LOCK_EXT_KILLED, _("External locker killed")) | 111 | ES(MU_ERR_LOCK_EXT_KILLED, _("External locker killed")); |
111 | 112 | ||
112 | ES(MU_ERR_NO_SUCH_USER, _("No such user name")) | 113 | ES(MU_ERR_NO_SUCH_USER, _("No such user name")); |
113 | 114 | ||
114 | ES(MU_ERR_GETHOSTBYNAME, _("DNS name resolution failed")) | 115 | ES(MU_ERR_GETHOSTBYNAME, _("DNS name resolution failed")); |
115 | ES(MU_ERR_BAD_RESUMPTION, _("State busy, must resume operation")) | 116 | ES(MU_ERR_BAD_RESUMPTION, _("State busy, must resume operation")); |
116 | ES(MU_ERR_MAILER_BAD_FROM, _("Not a valid mailer from address")) | 117 | ES(MU_ERR_MAILER_BAD_FROM, _("Not a valid mailer from address")); |
117 | ES(MU_ERR_MAILER_BAD_TO, _("Not a valid mailer to address")) | 118 | ES(MU_ERR_MAILER_BAD_TO, _("Not a valid mailer to address")); |
118 | ES(MU_ERR_MAILER_NO_RCPT_TO,_("No receipt addresses found")) | 119 | ES(MU_ERR_MAILER_NO_RCPT_TO,_("No receipt addresses found")); |
119 | ES(MU_ERR_MAILER_BAD_URL, _("Malformed or unsupported mailer URL")) | 120 | ES(MU_ERR_MAILER_BAD_URL, _("Malformed or unsupported mailer URL")); |
120 | ES(MU_ERR_SMTP_RCPT_FAILED, _("SMTP rcpt to command failed")) | 121 | ES(MU_ERR_SMTP_RCPT_FAILED, _("SMTP rcpt to command failed")); |
121 | ES(MU_ERR_TCP_NO_HOST, _("Tcp connections need a host")) | 122 | ES(MU_ERR_TCP_NO_HOST, _("Tcp connections need a host")); |
122 | ES(MU_ERR_TCP_NO_PORT, _("Tcp connections need a postive port")) | 123 | ES(MU_ERR_TCP_NO_PORT, _("Tcp connections need a postive port")); |
124 | |||
125 | ES(MU_ERR_BAD_2047_INPUT, _("Input string is not RFC 2047 encoded")); | ||
123 | } | 126 | } |
124 | 127 | ||
125 | return strerror (e); | 128 | return strerror (e); | ... | ... |
-
Please register or sign in to post a comment