Mercurial > cpython-lru_cache-weakref
annotate PC/example_nt/example.c @ 50401:7239fbcdcd4f 3.0
Merged revisions 68103 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r68103 | benjamin.peterson | 2008-12-31 08:51:07 -0600 (Wed, 31 Dec 2008) | 1 line
#4406 Directory has to inherit from commondialog.Dialog
........
| author | Benjamin Peterson <benjamin@python.org> |
|---|---|
| date | Wed, 31 Dec 2008 14:54:48 +0000 |
| parents | 19fd6141940d |
| children | bd0e361bd642 |
| rev | line source |
|---|---|
|
4223
180c1d3dac41
A directory with a working example of how to build an extension.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
1 #include "Python.h" |
|
180c1d3dac41
A directory with a working example of how to build an extension.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
2 |
|
180c1d3dac41
A directory with a working example of how to build an extension.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
3 static PyObject * |
|
13660
a1ce07218781
Miscelaneous ANSIfications. I'm assuming here 'main' should take (int,
Thomas Wouters <thomas@python.org>
parents:
4223
diff
changeset
|
4 ex_foo(PyObject *self, PyObject *args) |
|
4223
180c1d3dac41
A directory with a working example of how to build an extension.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
5 { |
|
180c1d3dac41
A directory with a working example of how to build an extension.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
6 printf("Hello, world\n"); |
|
180c1d3dac41
A directory with a working example of how to build an extension.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
7 Py_INCREF(Py_None); |
|
180c1d3dac41
A directory with a working example of how to build an extension.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
8 return Py_None; |
|
180c1d3dac41
A directory with a working example of how to build an extension.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
9 } |
|
180c1d3dac41
A directory with a working example of how to build an extension.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
10 |
|
180c1d3dac41
A directory with a working example of how to build an extension.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
11 static PyMethodDef example_methods[] = { |
|
38669
19fd6141940d
Partially merge trunk into p3yk. The removal of Mac/Tools is confusing svn
Thomas Wouters <thomas@python.org>
parents:
38453
diff
changeset
|
12 {"foo", ex_foo, METH_VARARGS, "foo() doc string"}, |
|
4223
180c1d3dac41
A directory with a working example of how to build an extension.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
13 {NULL, NULL} |
|
180c1d3dac41
A directory with a working example of how to build an extension.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
14 }; |
|
180c1d3dac41
A directory with a working example of how to build an extension.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
15 |
|
38453
29ae5e0fc348
Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.
Thomas Wouters <thomas@python.org>
parents:
13660
diff
changeset
|
16 PyMODINIT_FUNC |
|
13660
a1ce07218781
Miscelaneous ANSIfications. I'm assuming here 'main' should take (int,
Thomas Wouters <thomas@python.org>
parents:
4223
diff
changeset
|
17 initexample(void) |
|
4223
180c1d3dac41
A directory with a working example of how to build an extension.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
18 { |
|
180c1d3dac41
A directory with a working example of how to build an extension.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
19 Py_InitModule("example", example_methods); |
|
180c1d3dac41
A directory with a working example of how to build an extension.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
20 } |
