Files
cpython/PC/example_nt/example.c
Georg Brandl 2673a50ac9 Merged revisions 68169-68170 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k

........
  r68169 | georg.brandl | 2009-01-02 20:20:26 +0100 (Fri, 02 Jan 2009) | 2 lines

  Remove traces of Py_InitModule*.
........
  r68170 | georg.brandl | 2009-01-02 21:10:05 +0100 (Fri, 02 Jan 2009) | 2 lines

  #4808: move old API below new API doc.
........
2009-01-03 23:57:38 +00:00

33 lines
504 B
C

#include "Python.h"
static PyObject *
ex_foo(PyObject *self, PyObject *args)
{
printf("Hello, world\n");
Py_INCREF(Py_None);
return Py_None;
}
static PyMethodDef example_methods[] = {
{"foo", ex_foo, METH_VARARGS, "foo() doc string"},
{NULL, NULL}
};
static struct PyModuleDef examplemodule = {
PyModuleDef_HEAD_INIT,
"example",
"example module doc string",
-1,
example_methods,
NULL,
NULL,
NULL,
NULL
};
PyMODINIT_FUNC
PyInit_example(void)
{
return PyModule_Create(&examplemodule);
}