@@ -215,7 +215,7 @@ \section{Intermezzo: Errors and Exceptions
215215
216216\begin {verbatim }
217217void
218- initspam()
218+ initspam(void )
219219{
220220 PyObject *m, *d;
221221
@@ -308,9 +308,10 @@ \section{The Module's Method Table and Initialization Function
308308\begin {verbatim }
309309static PyMethodDef SpamMethods[] = {
310310 ...
311- {"system", spam_system, METH_VARARGS},
311+ {"system", spam_system, METH_VARARGS,
312+ "Execute a shell command."},
312313 ...
313- {NULL, NULL} /* Sentinel */
314+ {NULL, NULL, 0, NULL} /* Sentinel */
314315};
315316\end {verbatim }
316317
@@ -340,7 +341,7 @@ \section{The Module's Method Table and Initialization Function
340341
341342\begin {verbatim }
342343void
343- initspam()
344+ initspam(void )
344345{
345346 (void) Py_InitModule("spam", SpamMethods);
346347}
@@ -992,12 +993,13 @@ \section{Keyword Parameters for Extension Functions
992993 * only take two PyObject* parameters, and keywdarg_parrot() takes
993994 * three.
994995 */
995- {"parrot", (PyCFunction)keywdarg_parrot, METH_VARARGS|METH_KEYWORDS},
996- {NULL, NULL} /* sentinel */
996+ {"parrot", (PyCFunction)keywdarg_parrot, METH_VARARGS|METH_KEYWORDS,
997+ "Print a lovely skit to standard output."},
998+ {NULL, NULL, 0, NULL} /* sentinel */
997999};
9981000
9991001void
1000- initkeywdarg()
1002+ initkeywdarg(void )
10011003{
10021004 /* Create the module and add the functions */
10031005 Py_InitModule("keywdarg", keywdarg_methods);
@@ -1590,7 +1592,7 @@ \section{Providing a C API for an Extension Module
15901592
15911593\begin {verbatim }
15921594void
1593- initspam()
1595+ initspam(void )
15941596{
15951597 PyObject *m;
15961598 static void *PySpam_API[PySpam_API_pointers];
@@ -1614,8 +1616,8 @@ \section{Providing a C API for an Extension Module
16141616}
16151617\end {verbatim }
16161618
1617- Note that \code {PySpam_API} is declared \code {static}; otherwise
1618- the pointer array would disappear when \code {initspam} terminates!
1619+ Note that \code {PySpam_API} is declared \keyword {static}; otherwise
1620+ the pointer array would disappear when \function {initspam() } terminates!
16191621
16201622The bulk of the work is in the header file \file {spammodule.h},
16211623which looks like this:
@@ -1679,7 +1681,7 @@ \section{Providing a C API for an Extension Module
16791681
16801682\begin {verbatim }
16811683void
1682- initclient()
1684+ initclient(void )
16831685{
16841686 PyObject *m;
16851687
0 commit comments