python renderer: Try out function parameters

This commit is contained in:
Mario Hüttel 2019-11-17 16:18:03 +01:00
parent a4d84cff43
commit 95f6b31e4b

View File

@ -27,15 +27,18 @@
static PyObject *test(PyObject *self, PyObject *args)
{
if(!PyArg_ParseTuple(args, ":numargs"))
long int i;
if(!PyArg_ParseTuple(args, "l:get_number", &i))
return NULL;
return PyLong_FromLong(20UL);
i *= 2;
return PyLong_FromLong(i);
}
static PyMethodDef gds_render_methods[] = {
{"get_number", test, METH_VARARGS,
"Return the number of arguments received by the process."},
{"get_number", test, METH_VARARGS, "Return the number of arguments received by the process."},
{NULL, NULL, 0, NULL}
};