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".
14 #include "error_table.h"
15 #include "mit-sipb-copyright.h"
17 static const char rcsid[] = "$Id$";
18 static const char copyright[] =
19 "Copyright 1986, 1987, 1988 by the Student Information Processing Board\nand the department of Information Systems\nof the Massachusetts Institute of Technology";
21 static char buffer[25];
23 struct et_list *_et_list = NULL;
25 const char *error_message(long code)
33 offset = code & ((1<<ERRCODE_RANGE)-1);
34 table_num = code - offset;
36 return strerror(offset);
37 for (et = _et_list; et; et = et->next) {
38 if (et->table->base == table_num) {
39 /* This is the right table */
40 if (et->table->n_msgs <= offset)
42 return(et->table->msgs[offset]);
46 strcpy (buffer, "Unknown code ");
48 strcat (buffer, error_table_name (table_num));
51 for (cp = buffer; *cp; cp++)
54 *cp++ = '0' + offset / 100;
58 if (started || offset >= 10) {
59 *cp++ = '0' + offset / 10;