summaryrefslogtreecommitdiff
path: root/test cases/unit/126 python extension/foo.c
diff options
context:
space:
mode:
Diffstat (limited to 'test cases/unit/126 python extension/foo.c')
-rw-r--r--test cases/unit/126 python extension/foo.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/test cases/unit/126 python extension/foo.c b/test cases/unit/126 python extension/foo.c
new file mode 100644
index 000000000..e1a0dfb7b
--- /dev/null
+++ b/test cases/unit/126 python extension/foo.c
@@ -0,0 +1,31 @@
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
+
+
+static PyObject *
+bar_impl(PyObject *self, PyObject *args)
+{
+ return Py_None;
+}
+
+
+static PyMethodDef foo_methods[] = {
+ {"bar", bar_impl, METH_NOARGS, NULL},
+ {NULL, NULL, 0, NULL} /* sentinel */
+};
+
+
+static struct PyModuleDef foo_module = {
+ PyModuleDef_HEAD_INIT,
+ "foo", /* m_name */
+ NULL, /* m_doc */
+ -1, /* m_size */
+ foo_methods, /* m_methods */
+};
+
+
+PyMODINIT_FUNC
+PyInit_foo(void)
+{
+ return PyModule_Create(&foo_module);
+}