]> andersk Git - moira.git/blob - util/et/init_et.c
Import latest com_err sources from Athena
[moira.git] / util / et / init_et.c
1 /*
2  * $Header$
3  * $Source$
4  * $Locker$
5  *
6  * Copyright 1986, 1987, 1988 by MIT Information Systems and
7  *      the MIT Student Information Processing Board.
8  *
9  * For copyright info, see mit-sipb-copyright.h.
10  */
11
12 #include <stdio.h>
13 #include <stdlib.h>
14 #include <errno.h>
15 #include "error_table.h"
16 #include "mit-sipb-copyright.h"
17
18 static const char rcsid[] = "$Id$";
19
20 struct foobar {
21     struct et_list etl;
22     struct error_table et;
23 };
24
25 extern struct et_list *_et_list;
26
27 int init_error_table(const char *const *msgs, int base, int count)
28 {
29     struct foobar * new_et;
30
31     if (!base || !count || !msgs)
32         return 0;
33
34     new_et = malloc(sizeof(struct foobar));
35     if (!new_et)
36         return errno;   /* oops */
37     new_et->etl.table = &new_et->et;
38     new_et->et.msgs = msgs;
39     new_et->et.base = base;
40     new_et->et.n_msgs= count;
41
42     new_et->etl.next = _et_list;
43     _et_list = &new_et->etl;
44     return 0;
45 }
This page took 0.078884 seconds and 5 git commands to generate.