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