|
|
void *vptr = 0; | void *vptr = 0; |
| |
/* here we get the method pointer for callbacks */ | /* here we get the method pointer for callbacks */ |
char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); |
const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); |
const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; | const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; |
if (desc) { | if (desc) { |
desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; | desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; |
|
|
SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) | SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) |
{ | { |
if (PyString_Check(obj)) { | if (PyString_Check(obj)) { |
char *cstr; int len; |
char *cstr; Py_ssize_t len; |
PyString_AsStringAndSize(obj, &cstr, &len); | PyString_AsStringAndSize(obj, &cstr, &len); |
if (cptr) { | if (cptr) { |
if (alloc) { | if (alloc) { |
|
|
swig_type_info **types_initial) { | swig_type_info **types_initial) { |
size_t i; | size_t i; |
for (i = 0; methods[i].ml_name; ++i) { | for (i = 0; methods[i].ml_name; ++i) { |
char *c = methods[i].ml_doc; |
const char *c = methods[i].ml_doc; |
if (c && (c = strstr(c, "swig_ptr: "))) { | if (c && (c = strstr(c, "swig_ptr: "))) { |
int j; | int j; |
swig_const_info *ci = 0; | swig_const_info *ci = 0; |
char *name = c + 10; |
const char *name = c + 10; |
for (j = 0; const_table[j].type; ++j) { | for (j = 0; const_table[j].type; ++j) { |
if (strncmp(const_table[j].name, name, | if (strncmp(const_table[j].name, name, |
strlen(const_table[j].name)) == 0) { | strlen(const_table[j].name)) == 0) { |