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