1997-04-26 17:21:57 +04:00
|
|
|
/*
|
|
|
|
* $Header$
|
|
|
|
* $Source$
|
|
|
|
* $Locker$
|
|
|
|
*
|
|
|
|
* Copyright 1986, 1987, 1988 by MIT Information Systems and
|
|
|
|
* the MIT Student Information Processing Board.
|
|
|
|
*
|
1999-09-15 00:11:19 +04:00
|
|
|
* This file may be copied under the terms of the GNU Public License.
|
1997-04-26 17:21:57 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
1997-04-26 17:34:30 +04:00
|
|
|
#include <errno.h>
|
1997-04-26 17:58:21 +04:00
|
|
|
#ifdef HAVE_STDLIB_H
|
1997-04-26 17:34:30 +04:00
|
|
|
#include <stdlib.h>
|
|
|
|
#endif
|
|
|
|
#include "com_err.h"
|
1997-04-26 17:21:57 +04:00
|
|
|
#include "error_table.h"
|
|
|
|
|
|
|
|
#ifndef __STDC__
|
|
|
|
#define const
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct foobar {
|
|
|
|
struct et_list etl;
|
|
|
|
struct error_table et;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern struct et_list * _et_list;
|
|
|
|
|
1997-04-26 17:34:30 +04:00
|
|
|
#ifdef __STDC__
|
|
|
|
int init_error_table(const char * const *msgs, int base, int count)
|
|
|
|
#else
|
1997-04-26 17:21:57 +04:00
|
|
|
int init_error_table(msgs, base, count)
|
|
|
|
const char * const * msgs;
|
|
|
|
int base;
|
|
|
|
int count;
|
1997-04-26 17:34:30 +04:00
|
|
|
#endif
|
1997-04-26 17:21:57 +04:00
|
|
|
{
|
|
|
|
struct foobar * new_et;
|
|
|
|
|
|
|
|
if (!base || !count || !msgs)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
new_et = (struct foobar *) malloc(sizeof(struct foobar));
|
|
|
|
if (!new_et)
|
1997-04-26 17:34:30 +04:00
|
|
|
return ENOMEM; /* oops */
|
1997-04-26 17:21:57 +04:00
|
|
|
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;
|
|
|
|
}
|