source: trunk/third/moira/util/et/init_et.c @ 24319

Revision 24319, 1.0 KB checked in by broder, 15 years ago (diff)
New Moira snapshot from SVN.
Line 
1/* $Id: init_et.c 3956 2010-01-05 20:56:56Z zacheiss $
2 *
3 * Copyright 1986, 1987, 1988 by MIT Information Systems and
4 *      the MIT Student Information Processing Board.
5 *
6 * For copyright info, see mit-sipb-copyright.h.
7 */
8
9#include <stdio.h>
10#include <stdlib.h>
11#include <errno.h>
12#include "error_table.h"
13#include "mit-sipb-copyright.h"
14
15static const char rcsid[] = "$HeadURL: svn+ssh://svn.mit.edu/moira/trunk/moira/util/et/init_et.c $ $Id: init_et.c 3956 2010-01-05 20:56:56Z zacheiss $";
16
17struct foobar {
18    struct et_list etl;
19    struct error_table et;
20};
21
22extern struct et_list *_et_list;
23
24int init_error_table(const char *const *msgs, int base, int count)
25{
26    struct foobar * new_et;
27
28    if (!base || !count || !msgs)
29        return 0;
30
31    new_et = malloc(sizeof(struct foobar));
32    if (!new_et)
33        return errno;   /* oops */
34    new_et->etl.table = &new_et->et;
35    new_et->et.msgs = msgs;
36    new_et->et.base = base;
37    new_et->et.n_msgs= count;
38
39    new_et->etl.next = _et_list;
40    _et_list = &new_et->etl;
41    return 0;
42}
Note: See TracBrowser for help on using the repository browser.