PyObject * AerospikePredicates_New(void) { PyObject * module; MOD_DEF(module, "aerospike.predicates", "Query Predicates", AerospikePredicates_Methods); return module; }
PyMODINIT_FUNC MOD_INIT(demangler)(void) { static PyMethodDef DemangleMethods[] = { {"demangle", demangle, METH_VARARGS, "Demangle the c++ Mangled Name"}, {NULL, NULL, 0, NULL} }; PyObject *m; MOD_DEF(m, demangler, DemangleMethods); return MOD_SUCCESS_VALUE(m); }
init_lcm (void) #endif { PyObject *m; Py_TYPE(&pylcmeventlog_type) = &PyType_Type; Py_TYPE(&pylcm_type) = &PyType_Type; Py_TYPE(&pylcm_subscription_type) = &PyType_Type; MOD_DEF(m, "_lcm", lcmmod_doc, lcmmod_methods); Py_INCREF (&pylcmeventlog_type); if (PyModule_AddObject (m, "EventLog", (PyObject *)&pylcmeventlog_type) != 0) { #if PY_MAJOR_VERSION >= 3 return NULL; // in python 3 return NULL on error #else return; #endif } Py_INCREF (&pylcm_type); if (PyModule_AddObject (m, "LCM", (PyObject *)&pylcm_type) != 0) { #if PY_MAJOR_VERSION >= 3 return NULL; // in python 3 return NULL on error #else return; #endif } Py_INCREF (&pylcm_subscription_type); if (PyModule_AddObject (m, "LCMSubscription", (PyObject *)&pylcm_subscription_type) != 0) { #if PY_MAJOR_VERSION >= 3 return NULL; // in python 3 return NULL on error #else return; #endif } #if PY_MAJOR_VERSION >= 3 return m; // in python 3, we must return the PyObject #endif }
void AddConstantsModule(PyObject * enclosingModule) { // Add sub-module std::string moduleName = PyModule_GetName(enclosingModule); moduleName += ".Constants"; PyObject * m; MOD_DEF(m, const_cast<char*>(moduleName.c_str()), CONSTANTS__DOC__, LocalModuleMethods); Py_INCREF(m); // Add Module Constants PyModule_AddStringConstant(m, "LOGGING_LEVEL_NONE", const_cast<char*>(LoggingLevelToString(LOGGING_LEVEL_NONE))); PyModule_AddStringConstant(m, "LOGGING_LEVEL_WARNING", const_cast<char*>(LoggingLevelToString(LOGGING_LEVEL_WARNING))); PyModule_AddStringConstant(m, "LOGGING_LEVEL_INFO", const_cast<char*>(LoggingLevelToString(LOGGING_LEVEL_INFO))); PyModule_AddStringConstant(m, "LOGGING_LEVEL_DEBUG", const_cast<char*>(LoggingLevelToString(LOGGING_LEVEL_DEBUG))); PyModule_AddStringConstant(m, "LOGGING_LEVEL_UNKNOWN", const_cast<char*>(LoggingLevelToString(LOGGING_LEVEL_UNKNOWN))); PyModule_AddStringConstant(m, "TRANSFORM_DIR_UNKNOWN", const_cast<char*>(TransformDirectionToString(TRANSFORM_DIR_UNKNOWN))); PyModule_AddStringConstant(m, "TRANSFORM_DIR_FORWARD", const_cast<char*>(TransformDirectionToString(TRANSFORM_DIR_FORWARD))); PyModule_AddStringConstant(m, "TRANSFORM_DIR_INVERSE", const_cast<char*>(TransformDirectionToString(TRANSFORM_DIR_INVERSE))); PyModule_AddStringConstant(m, "COLORSPACE_DIR_UNKNOWN", const_cast<char*>(ColorSpaceDirectionToString(COLORSPACE_DIR_UNKNOWN))); PyModule_AddStringConstant(m, "COLORSPACE_DIR_TO_REFERENCE", const_cast<char*>(ColorSpaceDirectionToString(COLORSPACE_DIR_TO_REFERENCE))); PyModule_AddStringConstant(m, "COLORSPACE_DIR_FROM_REFERENCE", const_cast<char*>(ColorSpaceDirectionToString(COLORSPACE_DIR_FROM_REFERENCE))); PyModule_AddStringConstant(m, "BIT_DEPTH_UNKNOWN", const_cast<char*>(BitDepthToString(BIT_DEPTH_UNKNOWN))); PyModule_AddStringConstant(m, "BIT_DEPTH_UINT8", const_cast<char*>(BitDepthToString(BIT_DEPTH_UINT8))); PyModule_AddStringConstant(m, "BIT_DEPTH_UINT10", const_cast<char*>(BitDepthToString(BIT_DEPTH_UINT10))); PyModule_AddStringConstant(m, "BIT_DEPTH_UINT12", const_cast<char*>(BitDepthToString(BIT_DEPTH_UINT12))); PyModule_AddStringConstant(m, "BIT_DEPTH_UINT14", const_cast<char*>(BitDepthToString(BIT_DEPTH_UINT14))); PyModule_AddStringConstant(m, "BIT_DEPTH_UINT16", const_cast<char*>(BitDepthToString(BIT_DEPTH_UINT16))); PyModule_AddStringConstant(m, "BIT_DEPTH_UINT32", const_cast<char*>(BitDepthToString(BIT_DEPTH_UINT32))); PyModule_AddStringConstant(m, "BIT_DEPTH_F16", const_cast<char*>(BitDepthToString(BIT_DEPTH_F16))); PyModule_AddStringConstant(m, "BIT_DEPTH_F32", const_cast<char*>(BitDepthToString(BIT_DEPTH_F32))); PyModule_AddStringConstant(m, "ALLOCATION_UNKNOWN", const_cast<char*>(AllocationToString(ALLOCATION_UNKNOWN))); PyModule_AddStringConstant(m, "ALLOCATION_UNIFORM", const_cast<char*>(AllocationToString(ALLOCATION_UNIFORM))); PyModule_AddStringConstant(m, "ALLOCATION_LG2", const_cast<char*>(AllocationToString(ALLOCATION_LG2))); PyModule_AddStringConstant(m, "INTERP_UNKNOWN", const_cast<char*>(InterpolationToString(INTERP_UNKNOWN))); PyModule_AddStringConstant(m, "INTERP_NEAREST", const_cast<char*>(InterpolationToString(INTERP_NEAREST))); PyModule_AddStringConstant(m, "INTERP_LINEAR", const_cast<char*>(InterpolationToString(INTERP_LINEAR))); PyModule_AddStringConstant(m, "INTERP_TETRAHEDRAL", const_cast<char*>(InterpolationToString(INTERP_TETRAHEDRAL))); PyModule_AddStringConstant(m, "INTERP_BEST", const_cast<char*>(InterpolationToString(INTERP_BEST))); PyModule_AddStringConstant(m, "GPU_LANGUAGE_UNKNOWN", const_cast<char*>(GpuLanguageToString(GPU_LANGUAGE_UNKNOWN))); PyModule_AddStringConstant(m, "GPU_LANGUAGE_CG", const_cast<char*>(GpuLanguageToString(GPU_LANGUAGE_CG))); PyModule_AddStringConstant(m, "GPU_LANGUAGE_GLSL_1_0", const_cast<char*>(GpuLanguageToString(GPU_LANGUAGE_GLSL_1_0))); PyModule_AddStringConstant(m, "GPU_LANGUAGE_GLSL_1_3", const_cast<char*>(GpuLanguageToString(GPU_LANGUAGE_GLSL_1_3))); PyModule_AddStringConstant(m, "ROLE_DEFAULT", const_cast<char*>(ROLE_DEFAULT)); PyModule_AddStringConstant(m, "ROLE_REFERENCE", const_cast<char*>(ROLE_REFERENCE)); PyModule_AddStringConstant(m, "ROLE_DATA", const_cast<char*>(ROLE_DATA)); PyModule_AddStringConstant(m, "ROLE_COLOR_PICKING", const_cast<char*>(ROLE_COLOR_PICKING)); PyModule_AddStringConstant(m, "ROLE_SCENE_LINEAR", const_cast<char*>(ROLE_SCENE_LINEAR)); PyModule_AddStringConstant(m, "ROLE_COMPOSITING_LOG", const_cast<char*>(ROLE_COMPOSITING_LOG)); PyModule_AddStringConstant(m, "ROLE_COLOR_TIMING", const_cast<char*>(ROLE_COLOR_TIMING)); PyModule_AddStringConstant(m, "ROLE_TEXTURE_PAINT", const_cast<char*>(ROLE_TEXTURE_PAINT)); PyModule_AddStringConstant(m, "ROLE_MATTE_PAINT", const_cast<char*>(ROLE_MATTE_PAINT)); // Add the module PyModule_AddObject(enclosingModule, "Constants", m); }