init_pyavroc(void) #endif { PyObject* m; avroFileReaderType.tp_new = PyType_GenericNew; if (PyType_Ready(&avroFileReaderType) < 0) { INIT_RETURN(NULL); } avroFileWriterType.tp_new = PyType_GenericNew; if (PyType_Ready(&avroFileWriterType) < 0) { INIT_RETURN(NULL); } avroSerializerType.tp_new = PyType_GenericNew; if (PyType_Ready(&avroSerializerType) < 0) { INIT_RETURN(NULL); } avroDeserializerType.tp_new = PyType_GenericNew; if (PyType_Ready(&avroDeserializerType) < 0) { INIT_RETURN(NULL); } #if PY_MAJOR_VERSION >= 3 m = PyModule_Create(&moduledef); #else m = Py_InitModule3("_pyavroc", mod_methods, "Python wrapper around Avro-C"); #endif Py_INCREF(&avroFileReaderType); PyModule_AddObject(m, "AvroFileReader", (PyObject *)&avroFileReaderType); Py_INCREF(&avroFileWriterType); PyModule_AddObject(m, "AvroFileWriter", (PyObject *)&avroFileWriterType); Py_INCREF(&avroSerializerType); PyModule_AddObject(m, "AvroSerializer", (PyObject *)&avroSerializerType); Py_INCREF(&avroDeserializerType); PyModule_AddObject(m, "AvroDeserializer", (PyObject *)&avroDeserializerType); PyModule_AddObject(m, "AvroTypes", (PyObject*)get_avro_types_type()); INIT_RETURN(m); }
INIT() { INIT_COMMAND(script, STR(SCRIPT), STR(SCRIPT_DESC), ICON_LUA); wsprintf((char *)gszGlobalScripts, "%sScripts\\", siData->szInstallDir); wsprintf((char *)gszUserScripts, "%sScripts\\", siData->szDataDir); gData.params = NULL; gData.point_count = 0; gData.points = NULL; L_global = new_state(); L_new = new_state(); INIT_RETURN("Scripting Engine"); }