summaryrefslogtreecommitdiffstats
path: root/Tools/modulator/Templates
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1995-06-20 12:26:03 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1995-06-20 12:26:03 (GMT)
commit9a69112f85a52e87a171aa3346b5406f794c74ed (patch)
tree84d3b73209bc1a1413f618ccca7b284f68c2771d /Tools/modulator/Templates
parent1e054024c12b478eab2c09aae10f1a6cc1d6fda3 (diff)
downloadcpython-9a69112f85a52e87a171aa3346b5406f794c74ed.zip
cpython-9a69112f85a52e87a171aa3346b5406f794c74ed.tar.gz
cpython-9a69112f85a52e87a171aa3346b5406f794c74ed.tar.bz2
Jim Fulton's change to support doc strings
Diffstat (limited to 'Tools/modulator/Templates')
-rw-r--r--Tools/modulator/Templates/module_method4
-rw-r--r--Tools/modulator/Templates/module_tail8
-rw-r--r--Tools/modulator/Templates/object_method4
-rw-r--r--Tools/modulator/Templates/object_tail10
4 files changed, 25 insertions, 1 deletions
diff --git a/Tools/modulator/Templates/module_method b/Tools/modulator/Templates/module_method
index 53cc1ac..9e6c0d2 100644
--- a/Tools/modulator/Templates/module_method
+++ b/Tools/modulator/Templates/module_method
@@ -1,4 +1,8 @@
+static char $abbrev$_$method$__doc__[] =
+""
+;
+
static PyObject *
$abbrev$_$method$(self, args)
PyObject *self; /* Not used */
diff --git a/Tools/modulator/Templates/module_tail b/Tools/modulator/Templates/module_tail
index 8af75db..6ee7645 100644
--- a/Tools/modulator/Templates/module_tail
+++ b/Tools/modulator/Templates/module_tail
@@ -9,13 +9,19 @@ static struct PyMethodDef $abbrev$_methods[] = {
/* 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_InitModule("$name$", $abbrev$_methods);
+ 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);
diff --git a/Tools/modulator/Templates/object_method b/Tools/modulator/Templates/object_method
index 7ff5cea..9541494 100644
--- a/Tools/modulator/Templates/object_method
+++ b/Tools/modulator/Templates/object_method
@@ -1,4 +1,8 @@
+static char $abbrev$_$method$__doc__[] =
+""
+;
+
static PyObject *
$abbrev$_$method$(self, args)
$abbrev$object *self;
diff --git a/Tools/modulator/Templates/object_tail b/Tools/modulator/Templates/object_tail
index 4803ea5..65d29d3 100644
--- a/Tools/modulator/Templates/object_tail
+++ b/Tools/modulator/Templates/object_tail
@@ -1,4 +1,8 @@
+static char $Abbrev$type__doc__[] =
+""
+;
+
static PyTypeObject $Abbrev$type = {
PyObject_HEAD_INIT(&PyType_Type)
0, /*ob_size*/
@@ -16,6 +20,12 @@ static PyTypeObject $Abbrev$type = {
$tp_as_sequence$, /*tp_as_sequence*/
$tp_as_mapping$, /*tp_as_mapping*/
(hashfunc)$tp_hash$, /*tp_hash*/
+ (binaryfunc)$tp_call$, /*tp_call*/
+ (reprfunc)$tp_str$, /*tp_str*/
+
+ /* Space for future expansion */
+ 0L,0L,0L,0L,
+ $Abbrev$type__doc__ /* Documentation string */
};
/* End of code for $name$ objects */