File: init_et.c

package info (click to toggle)
zephyr 2.0.4-7
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,796 kB
  • ctags: 2,989
  • sloc: ansic: 29,327; sh: 1,447; makefile: 957; yacc: 498; lex: 137; lisp: 127
file content (49 lines) | stat: -rwxr-xr-x 1,180 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
 * $Header: /mit/zephyr/repository/zephyr/lib/et/init_et.c,v 1.2 1995/06/30 22:01:54 ghudson Exp $
 * $Source: /mit/zephyr/repository/zephyr/lib/et/init_et.c,v $
 * $Locker:  $
 *
 * Copyright 1986, 1987, 1988 by MIT Information Systems and
 *	the MIT Student Information Processing Board.
 *
 * For copyright info, see mit-sipb-copyright.h.
 */

#include <sysdep.h>
#include "error_table.h"
#include "mit-sipb-copyright.h"

#ifndef	lint
static const char rcsid_init_et_c[] =
    "$Header: /mit/zephyr/repository/zephyr/lib/et/init_et.c,v 1.2 1995/06/30 22:01:54 ghudson 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;
}