Imported from ../bash-4.0-rc1.tar.gz.
[platform/upstream/bash.git] / CWRU / misc / errlist.c
1 /*
2  * If necessary, link with lib/sh/libsh.a
3  */
4
5 /* Copyright (C) 1998-2009 Free Software Foundation, Inc.
6
7    This file is part of GNU Bash, the Bourne Again SHell.
8
9    Bash is free software: you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation, either version 3 of the License, or
12    (at your option) any later version.
13
14    Bash is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18
19    You should have received a copy of the GNU General Public License
20    along with Bash.  If not, see <http://www.gnu.org/licenses/>.
21 */
22
23 #include <stdio.h>
24 #include <errno.h>
25
26 extern char *strerror();
27
28 extern int sys_nerr;
29
30 int
31 main(c, v)
32 int     c;
33 char    **v;
34 {
35         int     i, n;
36
37         if (c == 1) {
38                 for (i = 1; i < sys_nerr; i++)
39                         printf("%d --> %s\n", i, strerror(i));
40         } else {
41                 for (i = 1; i < c; i++) {
42                         n = atoi(v[i]);
43                         printf("%d --> %s\n", n, strerror(n));
44                 }
45         }
46         exit (0);
47 }
48
49 programming_error(a, b)
50 char    *a;
51 int     b;
52 {
53 }
54
55 fatal_error()
56 {
57 }