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$
|
1996-03-07 12:16:54 -04:00
|
|
|
{NULL, (PyCFunction)NULL, 0, NULL} /* sentinel */
|
1995-03-02 10:05:29 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* Initialization function for the module (*must* be called init$name$) */
|
|
|
|
|
1995-06-20 09:26:03 -03:00
|
|
|
static char $name$_module_documentation[] =
|
|
|
|
""
|
|
|
|
;
|
|
|
|
|
1995-03-02 10:05:29 -04:00
|
|
|
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-06-20 09:26:03 -03:00
|
|
|
m = Py_InitModule4("$name$", $abbrev$_methods,
|
|
|
|
$name$_module_documentation,
|
|
|
|
(PyObject*)NULL,PYTHON_API_VERSION);
|
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
|
|
|
|