1995-03-02 10:05:29 -04:00
|
|
|
|
|
|
|
/* List of methods defined in the module */
|
|
|
|
|
1995-05-16 10:47:03 -03:00
|
|
|
static struct PyMethodDef $abbrev$_methods[] = {
|
|
|
|
$methodlist$
|
|
|
|
{NULL, NULL} /* sentinel */
|
1995-03-02 10:05:29 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* Initialization function for the module (*must* be called init$name$) */
|
|
|
|
|
|
|
|
void
|
|
|
|
init$name$()
|
|
|
|
{
|
1995-05-16 10:47:03 -03:00
|
|
|
PyObject *m, *d;
|
1995-03-02 10:05:29 -04:00
|
|
|
|
|
|
|
/* Create the module and add the functions */
|
1995-05-16 10:47:03 -03:00
|
|
|
m = Py_InitModule("$name$", $abbrev$_methods);
|
1995-03-02 10:05:29 -04:00
|
|
|
|
|
|
|
/* Add some symbolic constants to the module */
|
1995-05-16 10:47:03 -03:00
|
|
|
d = PyModule_GetDict(m);
|
|
|
|
ErrorObject = PyString_FromString("$name$.error");
|
|
|
|
PyDict_SetItemString(d, "error", ErrorObject);
|
1995-03-02 10:05:29 -04:00
|
|
|
|
|
|
|
/* XXXX Add constants here */
|
|
|
|
|
|
|
|
/* Check for errors */
|
1995-05-16 10:47:03 -03:00
|
|
|
if (PyErr_Occurred())
|
|
|
|
Py_FatalError("can't initialize module $name$");
|
1995-03-02 10:05:29 -04:00
|
|
|
}
|
1995-05-16 10:47:03 -03:00
|
|
|
|