view PC/example_nt/example.c @ 60008:0dfd62076ded

Blocked revisions 79402,79406 via svnmerge ........ r79402 | benjamin.peterson | 2010-03-24 20:03:51 -0500 (Wed, 24 Mar 2010) | 1 line set bsddb eol style ........ r79406 | benjamin.peterson | 2010-03-24 20:05:57 -0500 (Wed, 24 Mar 2010) | 1 line fix eol properties on capsule files ........
author Benjamin Peterson <benjamin@python.org>
date Thu, 25 Mar 2010 01:11:10 +0000
parents bd0e361bd642
children cab14be0ada1
line wrap: on
line source

#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);
}