Standardize License information
[openafs.git] / src / finale / translate_et.c
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 /*
11  * Revision 1.8  90/03/02  12:00:19
12  * Add bos error codes.
13  * Print usage message when called w/o arguments.
14  * If given multiple arguments, loop and translate each.
15  * 
16  * Revision 1.7  89/12/30  00:31:06
17  * renamed initialize_pr_error_table -> initialize_pt_error_table
18  * 
19  * Revision 1.6  89/12/29  16:49:05
20  * replaced all references of prserver/pr* -> ptserver/pt*
21  * 
22  * Revision 1.5  89/05/12  09:44:36
23  * Added prserver and ubik to list.
24  * 
25  * Revision 1.4  89/03/13  12:30:38
26  * Simplify code to call error_table_name a little.
27  * 
28  * Revision 1.3  89/02/19  19:31:17
29  * added the vlserver error package
30  * 
31  * Revision 1.2  89/02/03  15:28:10
32  * Added copyright, added cmd to list of known error_tables.
33  *  */
34 #include <afs/param.h>
35 #include <afs/com_err.h>
36 #include <rx/rxkad.h>
37 #include <afs/kautils.h>
38 #include <afs/auth.h>
39 #include <afs/cellconfig.h>
40 #include <afs/cmd.h>
41 #include <afs/vlserver.h>
42 #include <afs/pterror.h>
43 #include <afs/bnode.h>
44 #include <ubik.h>
45 #ifdef  AFS_AIX32_ENV
46 #include <signal.h>
47 #endif
48
49
50 #define ERRCODE_RANGE 8                 /* from error_table.h */
51
52 #include "AFS_component_version_number.c"
53
54 main (argc, argv)
55   int   argc;
56   char *argv[];
57 {
58     int  i;
59     afs_int32 code;
60     afs_int32 offset;
61
62 #ifdef  AFS_AIX32_ENV
63     /*
64      * The following signal action for AIX is necessary so that in case of a 
65      * crash (i.e. core is generated) we can include the user's data section 
66      * in the core dump. Unfortunately, by default, only a partial core is
67      * generated which, in many cases, isn't too useful.
68      */
69     struct sigaction nsa;
70     
71     sigemptyset(&nsa.sa_mask);
72     nsa.sa_handler = SIG_DFL;
73     nsa.sa_flags = SA_FULLDUMP;
74     sigaction(SIGSEGV, &nsa, NULL);
75 #endif
76     initialize_ka_error_table();
77     initialize_rxk_error_table();
78     initialize_ktc_error_table();
79     initialize_acfg_error_table();
80     initialize_cmd_error_table();
81     initialize_vl_error_table();
82     initialize_pt_error_table();
83     initialize_bz_error_table();
84     initialize_u_error_table();
85     initialize_vols_error_table();
86
87     if (argc < 2) {
88         fprintf (stderr, "Usage is: %s [<code>]+\n", argv[0]);
89         exit (1);
90     }
91
92     for (i=1; i<argc; i++) {
93         code = atoi(argv[i]);
94         offset = code & ((1<<ERRCODE_RANGE)-1);
95
96         printf ("%d (%s).%d = %s\n", code, error_table_name (code), offset,
97                 error_message (code));
98     }
99     return 0;
100 }
101