summaryrefslogtreecommitdiffstats
path: root/Tools/modulator/Templates/module_tail
blob: 8af75db9d65ac0c053aacdf17822feb7df0a75cb (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
31

/* List of methods defined in the module */

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


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

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

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

	/* Add some symbolic constants to the module */
	d = PyModule_GetDict(m);
	ErrorObject = PyString_FromString("$name$.error");
	PyDict_SetItemString(d, "error", ErrorObject);

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