6 * Copyright 1987 by the Student Information Processing Board
7 * of the Massachusetts Institute of Technology
9 * For copyright info, see "mit-sipb-copyright.h".
13 #include "error_table.h"
14 #include "mit-sipb-copyright.h"
17 static const char rcsid[] =
19 static const char copyright[] =
20 "Copyright 1986, 1987, 1988 by the Student Information Processing Board\nand the department of Information Systems\nof the Massachusetts Institute of Technology";
22 static char buffer[25];
24 struct et_list * _et_list = (struct et_list *) NULL;
26 const char * error_message (code)
35 offset = code & ((1<<ERRCODE_RANGE)-1);
36 table_num = code - offset;
38 if (offset < sys_nerr)
39 return(sys_errlist[offset]);
43 for (et = _et_list; et; et = et->next) {
44 if (et->table->base == table_num) {
45 /* This is the right table */
46 if (et->table->n_msgs <= offset)
48 return(et->table->msgs[offset]);
52 strcpy (buffer, "Unknown code ");
54 strcat (buffer, error_table_name (table_num));
57 for (cp = buffer; *cp; cp++)
60 *cp++ = '0' + offset / 100;
64 if (started || offset >= 10) {
65 *cp++ = '0' + offset / 10;