/* * GDSII-Converter Python Plugin * Copyright (C) 2019 Mario Hüttel * * This file is part of GDSII-Converter. * * GDSII-Converter is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * GDSII-Converter is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GDSII-Converter. If not, see . */ /** * @file gds-render-module.c * @brief Gds-render python module implementation * @author Mario Hüttel */ #include static PyObject *test(PyObject *self, PyObject *args) { long int i; if(!PyArg_ParseTuple(args, "l:get_number", &i)) return NULL; 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."}, {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; }