New file
Showing
1 changed file
with
58 additions
and
0 deletions
lib/strexit.c
0 → 100644
1 | /* GNU Mailutils -- a suite of utilities for electronic mail | ||
2 | Copyright (C) 2008 Free Software Foundation, Inc. | ||
3 | |||
4 | GNU Mailutils is free software; you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation; either version 3, or (at your option) | ||
7 | any later version. | ||
8 | |||
9 | GNU Mailutils is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License | ||
15 | along with GNU Mailutils; if not, write to the Free Software | ||
16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
17 | MA 02110-1301 USA */ | ||
18 | |||
19 | #ifdef HAVE_CONFIG_H | ||
20 | # include <config.h> | ||
21 | #endif | ||
22 | |||
23 | #include <stdlib.h> | ||
24 | #include <sysexits.h> | ||
25 | #include <mailutils/kwd.h> | ||
26 | #include <mailutils/nls.h> | ||
27 | |||
28 | struct mu_kwd exittab[] = { | ||
29 | { N_("Normal termination"), EX_OK }, | ||
30 | { N_("Unspecified error"), EXIT_FAILURE }, | ||
31 | { N_("Usage error"), EX_USAGE }, | ||
32 | { N_("Incorrect input data"), EX_DATAERR }, | ||
33 | { N_("No input data"), EX_NOINPUT }, | ||
34 | { N_("User does not exist"), EX_NOUSER }, | ||
35 | { N_("Host does not exist"), EX_NOHOST }, | ||
36 | { N_("Service unavailable"), EX_UNAVAILABLE }, | ||
37 | { N_("Software error"), EX_SOFTWARE }, | ||
38 | { N_("Operating system error"), EX_OSERR }, | ||
39 | { N_("Required system file does not exist or cannot be opened"), EX_OSFILE }, | ||
40 | { N_("Output file cannot be created"), EX_CANTCREAT }, | ||
41 | { N_("I/O error"), EX_IOERR }, | ||
42 | { N_("Temporary failure"), EX_TEMPFAIL }, | ||
43 | { N_("Remote protocol error"), EX_PROTOCOL }, | ||
44 | { N_("Insufficient permissions"), EX_NOPERM }, | ||
45 | { N_("Configuration error"), EX_CONFIG }, | ||
46 | { 0 } | ||
47 | }; | ||
48 | |||
49 | const char * | ||
50 | mu_strexit (int code) | ||
51 | { | ||
52 | const char *str; | ||
53 | if (mu_kwd_xlat_tok (exittab, code, &str)) | ||
54 | str = N_("Unknown exit code"); | ||
55 | return gettext (str); | ||
56 | } | ||
57 | |||
58 |
-
Please register or sign in to post a comment