summaryrefslogtreecommitdiffstats
path: root/Tools/modulator/Templates/module_tail
blob: 466c84a3767dfbfbb7be5782251e20b75af82036 (plain)
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

/* List of methods defined in the module */

static struct methodlist $abbrev$_methods[] = {
 $methodlist$
 {NULL,		NULL}		/* sentinel */
};


/* Initialization function for the module (*must* be called init$name$) */

void
init$name$()
{
	object *m, *d;

	/* Create the module and add the functions */
	m = initmodule("$name$", $abbrev$_methods);

	/* Add some symbolic constants to the module */
	d = getmoduledict(m);
	ErrorObject = newstringobject("$name$.error");
	dictinsert(d, "error", ErrorObject);

	/* XXXX Add constants here */
	
	/* Check for errors */
	if (err_occurred())
		fatal("can't initialize module $name$");
}