642cd955b44a16871e07e946324fcf5851cb54e7
[openafs.git] / src / comerr / error_table.h
1 /*
2  * Copyright 1988 by the Student Information Processing Board of the
3  * Massachusetts Institute of Technology.
4  *
5  * For copyright info, see mit-sipb-cr.h.
6  */
7
8 #include <afs/param.h>
9
10 #include <errno.h>
11
12 #ifndef _AFS_ET_H
13
14 struct error_table {
15     char const *const *msgs;
16     afs_int32 base;
17     int n_msgs;
18 };
19 struct et_list {
20     struct et_list *next;
21     const struct error_table *table;
22 };
23
24
25 #define ERRCODE_RANGE   8       /* # of bits to shift table number */
26 #define BITS_PER_CHAR   6       /* # bits to shift per character in name */
27
28 extern char const *afs_error_table_name(afs_int32 num);
29 extern void afs_add_to_error_table(struct et_list *new_table);
30 extern const char *afs_com_right(struct et_list *list, long code);
31 extern const char *afs_com_right_r(struct et_list *list, long code, char *str, size_t len);
32
33 #ifdef AFS_OLD_COM_ERR
34 #define error_table_name        afs_error_table_name
35 #define add_to_error_table(X) afs_add_to_error_table(X)
36 #endif /* AFS_OLD_COM_ERR */
37 #define _AFS_ET_H
38 #endif