1 #ifndef Py_KVIRCMODULE_H
2 #define Py_KVIRCMODULE_H
38 #ifdef COMPILE_PYTHON_SUPPORT
52 PyMODINIT_FUNC python_init();
59 static void ** PyKVIrc_API;
61 #define PyKVIrc_echo \
62 (*(int (*)(const char * pcCmd))PyKVIrc_API[0])
64 (*(int (*)(const char * pcCmd))PyKVIrc_API[1])
65 #define PyKVIrc_warning \
66 (*(int (*)(const char * pcCmd))PyKVIrc_API[2])
67 #define PyKVIrc_getLocal \
68 (*(int (*)(const char * pcCmd))PyKVIrc_API[3])
69 #define PyKVIrc_setLocal \
70 (*(int (*)(const char * pcCmd))PyKVIrc_API[4])
71 #define PyKVIrc_getGlobal \
72 (*(int (*)(const char * pcCmd))PyKVIrc_API[5])
73 #define PyKVIrc_setGlobal \
74 (*(int (*)(const char * pcCmd))PyKVIrc_API[6])
75 #define PyKVIrc_eval \
76 (*(int (*)(const char * pcCmd))PyKVIrc_API[7])
77 #define PyKVIrc_internalWarning \
78 (*(int (*)(const char * pcCmd))PyKVIrc_API[8])
79 #define PyKVIrc_error \
80 (*(int (*)(const char * pcCmd))PyKVIrc_API[9])
87 inline static int import_kvirc()
89 PyObject * pModule = PyImport_ImportModule(
"kvirc");
92 PyObject * pC_API_Object = PyObject_GetAttrString(pModule,
"_C_API");
97 if(PyCObject_Check(pC_API_Object))
98 PyKVIrc_API = (
void **)PyCObject_AsVoidPtr(pC_API_Object);
100 Py_DECREF(pC_API_Object);
104 #endif // KVIRC_MODULE
110 #endif // COMPILE_PYTHON_SUPPORT
112 #endif // Py_KVIRCMODULE_H
This file contains compile time settings.