PageRenderTime 23ms CodeModel.GetById 20ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/PC/example_nt/example.c

http://unladen-swallow.googlecode.com/
C | 20 lines | 17 code | 3 blank | 0 comment | 0 complexity | 6fb5f3baeff6680256fe7dd371264a21 MD5 | raw file
 1#include "Python.h"
 2
 3static PyObject *
 4ex_foo(PyObject *self, PyObject *args)
 5{
 6	printf("Hello, world\n");
 7	Py_INCREF(Py_None);
 8	return Py_None;
 9}
10
11static PyMethodDef example_methods[] = {
12	{"foo", ex_foo, METH_VARARGS, "foo() doc string"},
13	{NULL, NULL}
14};
15
16PyMODINIT_FUNC
17initexample(void)
18{
19	Py_InitModule("example", example_methods);
20}