mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 11:49:12 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			37 lines
		
	
	
	
		
			809 B
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			37 lines
		
	
	
	
		
			809 B
		
	
	
	
		
			Text
		
	
	
	
	
	
 | 
						|
/* List of methods defined in the module */
 | 
						|
 | 
						|
static struct PyMethodDef $abbrev$_methods[] = {
 | 
						|
	$methodlist$
 | 
						|
	{NULL,	 (PyCFunction)NULL, 0, NULL}		/* sentinel */
 | 
						|
};
 | 
						|
 | 
						|
 | 
						|
/* Initialization function for the module (*must* be called init$name$) */
 | 
						|
 | 
						|
static char $name$_module_documentation[] = 
 | 
						|
""
 | 
						|
;
 | 
						|
 | 
						|
void
 | 
						|
init$name$()
 | 
						|
{
 | 
						|
	PyObject *m, *d;
 | 
						|
 | 
						|
	/* Create the module and add the functions */
 | 
						|
	m = Py_InitModule4("$name$", $abbrev$_methods,
 | 
						|
		$name$_module_documentation,
 | 
						|
		(PyObject*)NULL,PYTHON_API_VERSION);
 | 
						|
 | 
						|
	/* 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$");
 | 
						|
}
 | 
						|
 |