diff options
Diffstat (limited to 'util/et/init_et.c')
-rw-r--r-- | util/et/init_et.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/util/et/init_et.c b/util/et/init_et.c new file mode 100644 index 0000000..f52faca --- /dev/null +++ b/util/et/init_et.c @@ -0,0 +1,44 @@ +/* + * util/et/init_et.c + * + * Copyright 1986, 1987, 1988 by MIT Information Systems and + * the MIT Student Information Processing Board. + * + * For copyright info, see mit-sipb-copyright.h. + */ + +#include <stdio.h> +#include "error_table.h" +#include "mit-sipb-copyright.h" + +extern char *malloc(), *realloc(); + +struct foobar { + struct et_list etl; + struct error_table et; +}; + +extern struct et_list * _et_list; + +int init_error_table(msgs, base, count) + const char * const * msgs; + int base; + int count; +{ + struct foobar * new_et; + + if (!base || !count || !msgs) + return 0; + + new_et = (struct foobar *) malloc(sizeof(struct foobar)); + if (!new_et) + return errno; /* oops */ + new_et->etl.table = &new_et->et; + new_et->et.msgs = msgs; + new_et->et.base = base; + new_et->et.n_msgs= count; + + new_et->etl.next = _et_list; + _et_list = &new_et->etl; + return 0; +} |