/* $Id: init_et.c,v 1.1 1995/12/14 06:52:32 tholo Exp $ */ /*- * Copyright 1987, 1988 by the Student Information Processing Board * of the Massachusetts Institute of Technology * * Permission to use, copy, modify, and distribute this software * and its documentation for any purpose and without fee is * hereby granted, provided that the above copyright notice * appear in all copies and that both that copyright notice and * this permission notice appear in supporting documentation, * and that the names of M.I.T. and the M.I.T. S.I.P.B. not be * used in advertising or publicity pertaining to distribution * of the software without specific, written prior permission. * M.I.T. and the M.I.T. S.I.P.B. make no representations about * the suitability of this software for any purpose. It is * provided "as is" without express or implied warranty. */ #include #include #include #include "error_table.h" #ifndef __STDC__ #define const #endif #ifndef lint static const char rcsid_init_et_c[] = "$Id: init_et.c,v 1.1 1995/12/14 06:52:32 tholo Exp $"; #endif 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; }