mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
checkin of Jack's original version
This commit is contained in:
parent
df804f8591
commit
d211220cd2
27 changed files with 1525 additions and 0 deletions
30
Tools/modulator/Templates/module_tail
Normal file
30
Tools/modulator/Templates/module_tail
Normal file
|
@ -0,0 +1,30 @@
|
|||
|
||||
/* List of methods defined in the module */
|
||||
|
||||
static struct methodlist $abbrev$_methods[] = {
|
||||
$methodlist$
|
||||
{NULL, NULL} /* sentinel */
|
||||
};
|
||||
|
||||
|
||||
/* Initialization function for the module (*must* be called init$name$) */
|
||||
|
||||
void
|
||||
init$name$()
|
||||
{
|
||||
object *m, *d;
|
||||
|
||||
/* Create the module and add the functions */
|
||||
m = initmodule("$name$", $abbrev$_methods);
|
||||
|
||||
/* Add some symbolic constants to the module */
|
||||
d = getmoduledict(m);
|
||||
ErrorObject = newstringobject("$name$.error");
|
||||
dictinsert(d, "error", ErrorObject);
|
||||
|
||||
/* XXXX Add constants here */
|
||||
|
||||
/* Check for errors */
|
||||
if (err_occurred())
|
||||
fatal("can't initialize module $name$");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue