]> andersk Git - moira.git/blame - util/et/et_name.c
Command line printer manipulation client, and build goo.
[moira.git] / util / et / et_name.c
CommitLineData
d1b2a10e 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"
d1b2a10e 9
d1b2a10e 10static const char copyright[] =
11 "Copyright 1987,1988 by Student Information Processing Board, Massachusetts Institute of Technology";
a91a6d50 12static const char rcsid_et[] = "$Id$";
d1b2a10e 13
14static const char char_set[] =
15 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_";
16
17static char buf[6];
18
a91a6d50 19const char *error_table_name(int num)
d1b2a10e 20{
21 int ch;
22 int i;
23 char *p;
24
25 /* num = aa aaa abb bbb bcc ccc cdd ddd d?? ??? ??? */
26 p = buf;
27 num >>= ERRCODE_RANGE;
28 /* num = ?? ??? ??? aaa aaa bbb bbb ccc ccc ddd ddd */
29 num &= 077777777;
30 /* num = 00 000 000 aaa aaa bbb bbb ccc ccc ddd ddd */
31 for (i = 4; i >= 0; i--) {
32 ch = (num >> BITS_PER_CHAR * i) & ((1 << BITS_PER_CHAR) - 1);
33 if (ch != 0)
34 *p++ = char_set[ch-1];
35 }
36 *p = '\0';
37 return(buf);
38}
This page took 0.076416 seconds and 6 git commands to generate.