int main(int argc, char **argv) { PyNet_Args *pn_args; pn_args = PyNet_Init(0); if (pn_args->error) { exit(1); } int rc = Py_Main(argc, argv); PyNet_Finalize(pn_args); exit(rc); }
PyMODINIT_FUNC initclr(void) { PyObject *m; /* Create the module and add the functions */ m = Py_InitModule3("clr", clr_methods, clr_module_doc); if (m == NULL) return; PyModule_AddObject(m, "facade", Py_True); Py_INCREF(Py_True); pn_args = PyNet_Init(1); if (pn_args->error) { return; } }
static PyObject *_initclr() { PyObject *m; /* Create the module and add the functions */ #if PY_MAJOR_VERSION >= 3 m = PyModule_Create(&clrdef); #else m = Py_InitModule3("clr", clr_methods, clr_module_doc); #endif if (m == NULL) return NULL; PyModule_AddObject(m, "facade", Py_True); Py_INCREF(Py_True); pn_args = PyNet_Init(1); if (pn_args->error) { return NULL; } if (NULL != pn_args->module) return pn_args->module; return m; }