|
|
1.1 root 1: /*
2: * Copyright 1987 by MIT Student Information Processing Board
3: *
4: * For copyright info, see mit-sipb-copyright.h.
5: */
6:
7: #include "error_table.h"
8: #include "mit-sipb-copyright.h"
9:
10: static char copyright[] = "Copyright 1987 by MIT Student Information Processing Board";
11:
12: char *malloc();
13:
14: char *
15: error_table_name(num)
16: int num;
17: {
18: register int ch;
19: register int i;
20: register char *buf, *p;
21:
22: /* num = aa aaa abb bbb bcc ccc cdd ddd d?? ??? ??? */
23: buf = malloc(5);
24: p = buf;
25: num >>= ERRCODE_RANGE;
26: /* num = ?? ??? ??? aaa aaa bbb bbb ccc ccc ddd ddd */
27: num &= 077777777;
28: /* num = 00 000 000 aaa aaa bbb bbb ccc ccc ddd ddd */
29: for (i = 0; i < 5; i++) {
30: ch = (num >> 24-6*i) & 077;
31: if (ch == 0)
32: continue;
33: else if (ch < 27)
34: *p++ = ch - 1 + 'A';
35: else if (ch < 53)
36: *p++ = ch - 27 + 'a';
37: else if (ch < 63)
38: *p++ = ch - 53 + '0';
39: else /* ch == 63 */
40: *p++ = '_';
41: }
42: return(buf);
43: }
44:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.