Imported from ../bash-2.05b.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-2002 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 it under
10    the terms of the GNU General Public License as published by the Free
11    Software Foundation; either version 2, or (at your option) any later
12    version.
13
14    Bash is distributed in the hope that it will be useful, but WITHOUT ANY
15    WARRANTY; without even the implied warranty of MERCHANTABILITY or
16    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
17    for more details.
18
19    You should have received a copy of the GNU General Public License along
20    with Bash; see the file COPYING.  If not, write to the Free Software
21    Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
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 }