| 2174 | /* Convert a function ptr value */ |
| 2175 | |
| 2176 | SWIGRUNTIME int |
| 2177 | SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { |
| 2178 | if (!PyCFunction_Check(obj)) { |
| 2179 | return SWIG_ConvertPtr(obj, ptr, ty, 0); |
| 2180 | } else { |
| 2181 | void *vptr = 0; |
| 2182 | swig_cast_info *tc; |
| 2183 | |
| 2184 | /* here we get the method pointer for callbacks */ |
| 2185 | const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); |
| 2186 | const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; |
| 2187 | if (desc) |
| 2188 | desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; |
| 2189 | if (!desc) |
| 2190 | return SWIG_ERROR; |
| 2191 | tc = SWIG_TypeCheck(desc,ty); |
| 2192 | if (tc) { |
| 2193 | int newmemory = 0; |
| 2194 | *ptr = SWIG_TypeCast(tc,vptr,&newmemory); |
| 2195 | assert(!newmemory); /* newmemory handling not yet implemented */ |
| 2196 | } else { |
| 2197 | return SWIG_ERROR; |
| 2198 | } |
| 2199 | return SWIG_OK; |
| 2200 | } |
| 2201 | } |
| 2202 | |
| 2203 | /* Convert a packed pointer value */ |
| 2204 |
nothing calls this directly
no test coverage detected