00001
00002
00003 #ifndef __PYX_HAVE_API__PyCafe
00004 #define __PYX_HAVE_API__PyCafe
00005 #include "Python.h"
00006
00007 static void (*__pyx_api_f_6PyCafe_py_cb_wrapper)(PVDataHolder, unsigned int, std::string) = 0;
00008 #define py_cb_wrapper __pyx_api_f_6PyCafe_py_cb_wrapper
00009 static void (*__pyx_api_f_6PyCafe_py_cb_ctrl_wrapper)(PVCtrlHolder, unsigned int, std::string) = 0;
00010 #define py_cb_ctrl_wrapper __pyx_api_f_6PyCafe_py_cb_ctrl_wrapper
00011 static void (*__pyx_api_f_6PyCafe_py_cb_handle_wrapper)(unsigned int) = 0;
00012 #define py_cb_handle_wrapper __pyx_api_f_6PyCafe_py_cb_handle_wrapper
00013 static void (*__pyx_api_f_6PyCafe_py_cb_handle_monid_wrapper)(unsigned int, unsigned long) = 0;
00014 #define py_cb_handle_monid_wrapper __pyx_api_f_6PyCafe_py_cb_handle_monid_wrapper
00015 #if !defined(__Pyx_PyIdentifier_FromString)
00016 #if PY_MAJOR_VERSION < 3
00017 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
00018 #else
00019 #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
00020 #endif
00021 #endif
00022
00023 #ifndef __PYX_HAVE_RT_ImportModule
00024 #define __PYX_HAVE_RT_ImportModule
00025 static PyObject *__Pyx_ImportModule(const char *name) {
00026 PyObject *py_name = 0;
00027 PyObject *py_module = 0;
00028 py_name = __Pyx_PyIdentifier_FromString(name);
00029 if (!py_name)
00030 goto bad;
00031 py_module = PyImport_Import(py_name);
00032 Py_DECREF(py_name);
00033 return py_module;
00034 bad:
00035 Py_XDECREF(py_name);
00036 return 0;
00037 }
00038 #endif
00039
00040 #ifndef __PYX_HAVE_RT_ImportFunction
00041 #define __PYX_HAVE_RT_ImportFunction
00042 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
00043 PyObject *d = 0;
00044 PyObject *cobj = 0;
00045 union {
00046 void (*fp)(void);
00047 void *p;
00048 } tmp;
00049 d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
00050 if (!d)
00051 goto bad;
00052 cobj = PyDict_GetItemString(d, funcname);
00053 if (!cobj) {
00054 PyErr_Format(PyExc_ImportError,
00055 "%.200s does not export expected C function %.200s",
00056 PyModule_GetName(module), funcname);
00057 goto bad;
00058 }
00059 #if PY_VERSION_HEX >= 0x02070000
00060 if (!PyCapsule_IsValid(cobj, sig)) {
00061 PyErr_Format(PyExc_TypeError,
00062 "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
00063 PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
00064 goto bad;
00065 }
00066 tmp.p = PyCapsule_GetPointer(cobj, sig);
00067 #else
00068 {const char *desc, *s1, *s2;
00069 desc = (const char *)PyCObject_GetDesc(cobj);
00070 if (!desc)
00071 goto bad;
00072 s1 = desc; s2 = sig;
00073 while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
00074 if (*s1 != *s2) {
00075 PyErr_Format(PyExc_TypeError,
00076 "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
00077 PyModule_GetName(module), funcname, sig, desc);
00078 goto bad;
00079 }
00080 tmp.p = PyCObject_AsVoidPtr(cobj);}
00081 #endif
00082 *f = tmp.fp;
00083 if (!(*f))
00084 goto bad;
00085 Py_DECREF(d);
00086 return 0;
00087 bad:
00088 Py_XDECREF(d);
00089 return -1;
00090 }
00091 #endif
00092
00093
00094 static int import_PyCafe(void) {
00095 PyObject *module = 0;
00096 module = __Pyx_ImportModule("PyCafe");
00097 if (!module) goto bad;
00098 if (__Pyx_ImportFunction(module, "py_cb_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_wrapper, "void (PVDataHolder, unsigned int, std::string)") < 0) goto bad;
00099 if (__Pyx_ImportFunction(module, "py_cb_ctrl_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_ctrl_wrapper, "void (PVCtrlHolder, unsigned int, std::string)") < 0) goto bad;
00100 if (__Pyx_ImportFunction(module, "py_cb_handle_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_handle_wrapper, "void (unsigned int)") < 0) goto bad;
00101 if (__Pyx_ImportFunction(module, "py_cb_handle_monid_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_handle_monid_wrapper, "void (unsigned int, unsigned long)") < 0) goto bad;
00102 Py_DECREF(module); module = 0;
00103 return 0;
00104 bad:
00105 Py_XDECREF(module);
00106 return -1;
00107 }
00108
00109 #endif