plugins: python-renderer: Implement first gds_render built-in module with a get_number function
This commit is contained in:
@@ -24,3 +24,30 @@
|
||||
*/
|
||||
|
||||
#include <python-renderer/gds-render-module.h>
|
||||
|
||||
static PyObject *test(PyObject *self, PyObject *args)
|
||||
{
|
||||
if(!PyArg_ParseTuple(args, ":numargs"))
|
||||
return NULL;
|
||||
|
||||
return PyLong_FromLong(20UL);
|
||||
}
|
||||
|
||||
static PyMethodDef gds_render_methods[] = {
|
||||
{"get_number", test, METH_VARARGS,
|
||||
"Return the number of arguments received by the process."},
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
static PyModuleDef gds_render_module = {
|
||||
PyModuleDef_HEAD_INIT, "gds_render", NULL, -1, gds_render_methods,
|
||||
NULL, NULL, NULL, NULL
|
||||
};
|
||||
|
||||
PyObject *init_gds_render_module(void)
|
||||
{
|
||||
PyObject *this_module;
|
||||
|
||||
this_module = PyModule_Create(&gds_render_module);
|
||||
return this_module;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user