2 * Copyright 1987 by MIT Student Information Processing Board
4 * For copyright info, see mit-sipb-cr.h.
9 #include <afs/afsutil.h>
12 #include "error_table.h"
13 #include "mit-sipb-cr.h"
17 static const char copyright[] =
18 "Copyright 1987,1988 by Student Information Processing Board, Massachusetts Institute of Technology";
21 static const char char_set[] =
22 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_";
27 afs_error_table_name(afs_int32 num)
33 /* num = aa aaa abb bbb bcc ccc cdd ddd d?? ??? ??? */
35 num >>= ERRCODE_RANGE;
36 /* num = ?? ??? ??? aaa aaa bbb bbb ccc ccc ddd ddd */
38 /* num = 00 000 000 aaa aaa bbb bbb ccc ccc ddd ddd */
39 for (i = 4; i >= 0; i--) {
40 ch = (num >> BITS_PER_CHAR * i) & ((1 << BITS_PER_CHAR) - 1);
42 *p++ = char_set[ch - 1];
45 return (lcstring(buf, buf, sizeof(buf)));