diff options
Diffstat (limited to 'kerberosIV/com_err/init_et.c')
-rw-r--r-- | kerberosIV/com_err/init_et.c | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/kerberosIV/com_err/init_et.c b/kerberosIV/com_err/init_et.c new file mode 100644 index 00000000000..00828911201 --- /dev/null +++ b/kerberosIV/com_err/init_et.c @@ -0,0 +1,63 @@ +/* $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 <stdio.h> +#include <stdlib.h> +#include <errno.h> +#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; +} |