afsconfig-and-rcsid-all-around-20010705
[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 #include <afs/param.h>
11 #include <afsconfig.h>
12
13 RCSID("$Header$");
14
15 #include <afs/com_err.h>
16 #include <rx/rxkad.h>
17 #include <afs/kautils.h>
18 #include <afs/auth.h>
19 #include <afs/cellconfig.h>
20 #include <afs/cmd.h>
21 #include <afs/vlserver.h>
22 #include <afs/pterror.h>
23 #include <afs/bnode.h>
24 #include <afs/volser.h>
25 #include <ubik.h>
26 #ifdef  AFS_AIX32_ENV
27 #include <signal.h>
28 #endif
29
30
31 #define ERRCODE_RANGE 8                 /* from error_table.h */
32
33 #include "AFS_component_version_number.c"
34
35 int
36 main (argc, argv)
37   int   argc;
38   char *argv[];
39 {
40     int  i;
41     afs_int32 code;
42     afs_int32 offset;
43
44 #ifdef  AFS_AIX32_ENV
45     /*
46      * The following signal action for AIX is necessary so that in case of a 
47      * crash (i.e. core is generated) we can include the user's data section 
48      * in the core dump. Unfortunately, by default, only a partial core is
49      * generated which, in many cases, isn't too useful.
50      */
51     struct sigaction nsa;
52     
53     sigemptyset(&nsa.sa_mask);
54     nsa.sa_handler = SIG_DFL;
55     nsa.sa_flags = SA_FULLDUMP;
56     sigaction(SIGSEGV, &nsa, NULL);
57 #endif
58     initialize_ka_error_table();
59     initialize_rxk_error_table();
60     initialize_ktc_error_table();
61     initialize_acfg_error_table();
62     initialize_cmd_error_table();
63     initialize_vl_error_table();
64     initialize_pt_error_table();
65     initialize_bz_error_table();
66     initialize_u_error_table();
67     initialize_vols_error_table();
68
69     if (argc < 2) {
70         fprintf (stderr, "Usage is: %s [<code>]+\n", argv[0]);
71         exit (1);
72     }
73
74     for (i=1; i<argc; i++) {
75         code = atoi(argv[i]);
76         offset = code & ((1<<ERRCODE_RANGE)-1);
77
78         printf ("%d (%s).%d = %s\n", (int) code, error_table_name (code), (int) offset,
79                 error_message (code));
80     }
81     return 0;
82 }
83