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

Revision 23178, 900 bytes checked in by broder, 16 years ago (diff)
Take a new snapshot from CVS for Moira, and add a debathena-moira-update-server package
Line 
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
18static const char rcsid[] = "$Id$";
19
20struct foobar {
21    struct et_list etl;
22    struct error_table et;
23};
24
25extern struct et_list *_et_list;
26
27int 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}
Note: See TracBrowser for help on using the repository browser.