Coding style fixes for Python builtin changes added on the szager-builtin branch
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12515 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
97802ab8c4
commit
908c37cef8
7 changed files with 425 additions and 506 deletions
|
|
@ -1,15 +1,13 @@
|
||||||
#define PYSWIG_UNARYFUNC_CLOSURE(wrapper) \
|
#define PYSWIG_UNARYFUNC_CLOSURE(wrapper) \
|
||||||
SWIGINTERN PyObject* \
|
SWIGINTERN PyObject * \
|
||||||
wrapper##_closure (PyObject *a) \
|
wrapper##_closure(PyObject *a) { \
|
||||||
{ \
|
return wrapper(a, NULL); \
|
||||||
return wrapper(a, NULL); \
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PYSWIG_DESTRUCTOR_CLOSURE(wrapper) \
|
#define PYSWIG_DESTRUCTOR_CLOSURE(wrapper) \
|
||||||
SWIGINTERN void \
|
SWIGINTERN void \
|
||||||
wrapper##_closure (PyObject *a) \
|
wrapper##_closure(PyObject *a) { \
|
||||||
{ \
|
SwigPyObject *sobj = (SwigPyObject *)a; \
|
||||||
SwigPyObject *sobj = (SwigPyObject*) a; \
|
|
||||||
if (sobj->own) { \
|
if (sobj->own) { \
|
||||||
PyObject *o = wrapper(a, NULL); \
|
PyObject *o = wrapper(a, NULL); \
|
||||||
Py_XDECREF(o); \
|
Py_XDECREF(o); \
|
||||||
|
|
@ -18,8 +16,7 @@ wrapper##_closure (PyObject *a) \
|
||||||
|
|
||||||
#define PYSWIG_INQUIRY_CLOSURE(wrapper) \
|
#define PYSWIG_INQUIRY_CLOSURE(wrapper) \
|
||||||
SWIGINTERN int \
|
SWIGINTERN int \
|
||||||
wrapper##_closure (PyObject *a) \
|
wrapper##_closure(PyObject *a) { \
|
||||||
{ \
|
|
||||||
PyObject *pyresult = wrapper(a, NULL); \
|
PyObject *pyresult = wrapper(a, NULL); \
|
||||||
int result = pyresult && PyObject_IsTrue(pyresult) ? 1 : 0; \
|
int result = pyresult && PyObject_IsTrue(pyresult) ? 1 : 0; \
|
||||||
Py_XDECREF(pyresult); \
|
Py_XDECREF(pyresult); \
|
||||||
|
|
@ -27,9 +24,8 @@ wrapper##_closure (PyObject *a) \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PYSWIG_BINARYFUNC_CLOSURE(wrapper) \
|
#define PYSWIG_BINARYFUNC_CLOSURE(wrapper) \
|
||||||
SWIGINTERN PyObject* \
|
SWIGINTERN PyObject * \
|
||||||
wrapper##_closure (PyObject *a, PyObject *b) \
|
wrapper##_closure(PyObject *a, PyObject *b) { \
|
||||||
{ \
|
|
||||||
PyObject *tuple = PyTuple_New(1); \
|
PyObject *tuple = PyTuple_New(1); \
|
||||||
assert(tuple); \
|
assert(tuple); \
|
||||||
PyTuple_SET_ITEM(tuple, 0, b); \
|
PyTuple_SET_ITEM(tuple, 0, b); \
|
||||||
|
|
@ -40,9 +36,8 @@ wrapper##_closure (PyObject *a, PyObject *b) \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PYSWIG_TERNARYFUNC_CLOSURE(wrapper) \
|
#define PYSWIG_TERNARYFUNC_CLOSURE(wrapper) \
|
||||||
SWIGINTERN PyObject* \
|
SWIGINTERN PyObject * \
|
||||||
wrapper##_closure (PyObject *a, PyObject *b, PyObject *c) \
|
wrapper##_closure(PyObject *a, PyObject *b, PyObject *c) { \
|
||||||
{ \
|
|
||||||
PyObject *tuple = PyTuple_New(2); \
|
PyObject *tuple = PyTuple_New(2); \
|
||||||
assert(tuple); \
|
assert(tuple); \
|
||||||
PyTuple_SET_ITEM(tuple, 0, b); \
|
PyTuple_SET_ITEM(tuple, 0, b); \
|
||||||
|
|
@ -56,8 +51,7 @@ wrapper##_closure (PyObject *a, PyObject *b, PyObject *c) \
|
||||||
|
|
||||||
#define PYSWIG_LENFUNC_CLOSURE(wrapper) \
|
#define PYSWIG_LENFUNC_CLOSURE(wrapper) \
|
||||||
SWIGINTERN Py_ssize_t \
|
SWIGINTERN Py_ssize_t \
|
||||||
wrapper##_closure (PyObject *a) \
|
wrapper##_closure(PyObject *a) { \
|
||||||
{ \
|
|
||||||
PyObject *resultobj = wrapper(a, NULL); \
|
PyObject *resultobj = wrapper(a, NULL); \
|
||||||
Py_ssize_t result = PyNumber_AsSsize_t(resultobj, NULL); \
|
Py_ssize_t result = PyNumber_AsSsize_t(resultobj, NULL); \
|
||||||
Py_DECREF(resultobj); \
|
Py_DECREF(resultobj); \
|
||||||
|
|
@ -65,9 +59,8 @@ wrapper##_closure (PyObject *a) \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PYSWIG_SSIZESSIZEARGFUNC_CLOSURE(wrapper) \
|
#define PYSWIG_SSIZESSIZEARGFUNC_CLOSURE(wrapper) \
|
||||||
SWIGINTERN PyObject* \
|
SWIGINTERN PyObject * \
|
||||||
wrapper##_closure (PyObject *a, Py_ssize_t b, Py_ssize_t c) \
|
wrapper##_closure(PyObject *a, Py_ssize_t b, Py_ssize_t c) { \
|
||||||
{ \
|
|
||||||
PyObject *tuple = PyTuple_New(2); \
|
PyObject *tuple = PyTuple_New(2); \
|
||||||
assert(tuple); \
|
assert(tuple); \
|
||||||
PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b)); \
|
PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b)); \
|
||||||
|
|
@ -79,8 +72,7 @@ wrapper##_closure (PyObject *a, Py_ssize_t b, Py_ssize_t c) \
|
||||||
|
|
||||||
#define PYSWIG_SSIZESSIZEOBJARGPROC_CLOSURE(wrapper) \
|
#define PYSWIG_SSIZESSIZEOBJARGPROC_CLOSURE(wrapper) \
|
||||||
SWIGINTERN int \
|
SWIGINTERN int \
|
||||||
wrapper##_closure (PyObject *a, Py_ssize_t b, Py_ssize_t c, PyObject *d) \
|
wrapper##_closure(PyObject *a, Py_ssize_t b, Py_ssize_t c, PyObject *d) { \
|
||||||
{ \
|
|
||||||
PyObject *tuple = PyTuple_New(d ? 3 : 2); \
|
PyObject *tuple = PyTuple_New(d ? 3 : 2); \
|
||||||
assert(tuple); \
|
assert(tuple); \
|
||||||
PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b)); \
|
PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b)); \
|
||||||
|
|
@ -97,9 +89,8 @@ wrapper##_closure (PyObject *a, Py_ssize_t b, Py_ssize_t c, PyObject *d) \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PYSWIG_SSIZEARGFUNC_CLOSURE(wrapper) \
|
#define PYSWIG_SSIZEARGFUNC_CLOSURE(wrapper) \
|
||||||
SWIGINTERN PyObject* \
|
SWIGINTERN PyObject * \
|
||||||
wrapper##_closure (PyObject *a, Py_ssize_t b) \
|
wrapper##_closure(PyObject *a, Py_ssize_t b) { \
|
||||||
{ \
|
|
||||||
PyObject *tuple = PyTuple_New(1); \
|
PyObject *tuple = PyTuple_New(1); \
|
||||||
assert(tuple); \
|
assert(tuple); \
|
||||||
PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b)); \
|
PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b)); \
|
||||||
|
|
@ -109,9 +100,8 @@ wrapper##_closure (PyObject *a, Py_ssize_t b) \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PYSWIG_FUNPACK_SSIZEARGFUNC_CLOSURE(wrapper) \
|
#define PYSWIG_FUNPACK_SSIZEARGFUNC_CLOSURE(wrapper) \
|
||||||
SWIGINTERN PyObject* \
|
SWIGINTERN PyObject * \
|
||||||
wrapper##_closure (PyObject *a, Py_ssize_t b) \
|
wrapper##_closure(PyObject *a, Py_ssize_t b) { \
|
||||||
{ \
|
|
||||||
PyObject *arg = _PyLong_FromSsize_t(b); \
|
PyObject *arg = _PyLong_FromSsize_t(b); \
|
||||||
PyObject *result = wrapper(a, arg); \
|
PyObject *result = wrapper(a, arg); \
|
||||||
Py_DECREF(arg); \
|
Py_DECREF(arg); \
|
||||||
|
|
@ -120,8 +110,7 @@ wrapper##_closure (PyObject *a, Py_ssize_t b) \
|
||||||
|
|
||||||
#define PYSWIG_SSIZEOBJARGPROC_CLOSURE(wrapper) \
|
#define PYSWIG_SSIZEOBJARGPROC_CLOSURE(wrapper) \
|
||||||
SWIGINTERN int \
|
SWIGINTERN int \
|
||||||
wrapper##_closure (PyObject *a, Py_ssize_t b, PyObject *c) \
|
wrapper##_closure(PyObject *a, Py_ssize_t b, PyObject *c) { \
|
||||||
{ \
|
|
||||||
PyObject *tuple = PyTuple_New(2); \
|
PyObject *tuple = PyTuple_New(2); \
|
||||||
assert(tuple); \
|
assert(tuple); \
|
||||||
PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b)); \
|
PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b)); \
|
||||||
|
|
@ -136,8 +125,7 @@ wrapper##_closure (PyObject *a, Py_ssize_t b, PyObject *c) \
|
||||||
|
|
||||||
#define PYSWIG_OBJOBJARGPROC_CLOSURE(wrapper) \
|
#define PYSWIG_OBJOBJARGPROC_CLOSURE(wrapper) \
|
||||||
SWIGINTERN int \
|
SWIGINTERN int \
|
||||||
wrapper##_closure (PyObject *a, PyObject *b, PyObject *c) \
|
wrapper##_closure(PyObject *a, PyObject *b, PyObject *c) { \
|
||||||
{ \
|
|
||||||
PyObject *tuple = PyTuple_New(c ? 2 : 1); \
|
PyObject *tuple = PyTuple_New(c ? 2 : 1); \
|
||||||
assert(tuple); \
|
assert(tuple); \
|
||||||
PyTuple_SET_ITEM(tuple, 0, b); \
|
PyTuple_SET_ITEM(tuple, 0, b); \
|
||||||
|
|
@ -154,16 +142,14 @@ wrapper##_closure (PyObject *a, PyObject *b, PyObject *c) \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PYSWIG_REPRFUNC_CLOSURE(wrapper) \
|
#define PYSWIG_REPRFUNC_CLOSURE(wrapper) \
|
||||||
SWIGINTERN PyObject* \
|
SWIGINTERN PyObject * \
|
||||||
wrapper##_closure (PyObject *a) \
|
wrapper##_closure(PyObject *a) { \
|
||||||
{ \
|
|
||||||
return wrapper(a, NULL); \
|
return wrapper(a, NULL); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PYSWIG_HASHFUNC_CLOSURE(wrapper) \
|
#define PYSWIG_HASHFUNC_CLOSURE(wrapper) \
|
||||||
SWIGINTERN long \
|
SWIGINTERN long \
|
||||||
wrapper##_closure (PyObject *a) \
|
wrapper##_closure(PyObject *a) { \
|
||||||
{ \
|
|
||||||
PyObject *pyresult = wrapper(a, NULL); \
|
PyObject *pyresult = wrapper(a, NULL); \
|
||||||
if (!pyresult || !PyLong_Check(pyresult)) \
|
if (!pyresult || !PyLong_Check(pyresult)) \
|
||||||
return -1; \
|
return -1; \
|
||||||
|
|
@ -173,9 +159,8 @@ wrapper##_closure (PyObject *a) \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PYSWIG_ITERNEXT_CLOSURE(wrapper) \
|
#define PYSWIG_ITERNEXT_CLOSURE(wrapper) \
|
||||||
SWIGINTERN PyObject* \
|
SWIGINTERN PyObject * \
|
||||||
wrapper##_closure (PyObject *a) \
|
wrapper##_closure(PyObject *a) { \
|
||||||
{ \
|
|
||||||
PyObject *result = wrapper(a, NULL); \
|
PyObject *result = wrapper(a, NULL); \
|
||||||
if (result && result == Py_None) { \
|
if (result && result == Py_None) { \
|
||||||
Py_DECREF(result); \
|
Py_DECREF(result); \
|
||||||
|
|
@ -184,288 +169,251 @@ wrapper##_closure (PyObject *a) \
|
||||||
return result; \
|
return result; \
|
||||||
}
|
}
|
||||||
|
|
||||||
SWIGINTERN int py_builtin_bad_init (PyObject *self, PyObject *args, PyObject *kwds)
|
|
||||||
{
|
|
||||||
PyErr_Format(PyExc_TypeError, "Cannot create new instances of type '%.300s'", self->ob_type->tp_name);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
SWIGINTERN void py_builtin_bad_dealloc (PyObject *pyobj)
|
|
||||||
{
|
|
||||||
SwigPyObject *sobj = (SwigPyObject*) pyobj;
|
|
||||||
if (sobj->own) {
|
|
||||||
PyErr_Format(PyExc_TypeError,
|
|
||||||
"Swig detected a memory leak in type '%.300s': no callable destructor found.",
|
|
||||||
pyobj->ob_type->tp_name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
PyCFunction get;
|
|
||||||
PyCFunction set;
|
|
||||||
} SwigPyGetSet;
|
|
||||||
|
|
||||||
SWIGINTERN PyObject*
|
|
||||||
pyswig_getter_closure (PyObject *obj, void *closure)
|
|
||||||
{
|
|
||||||
if (!closure)
|
|
||||||
return SWIG_Py_Void();
|
|
||||||
SwigPyGetSet *getset = (SwigPyGetSet*) closure;
|
|
||||||
if (!getset->get)
|
|
||||||
return SWIG_Py_Void();
|
|
||||||
PyObject *tuple = PyTuple_New(0);
|
|
||||||
assert(tuple);
|
|
||||||
PyObject *result = (*getset->get)(obj, tuple);
|
|
||||||
Py_DECREF(tuple);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
SWIGINTERN PyObject*
|
|
||||||
pyswig_funpack_getter_closure (PyObject *obj, void *closure)
|
|
||||||
{
|
|
||||||
if (!closure)
|
|
||||||
return SWIG_Py_Void();
|
|
||||||
SwigPyGetSet *getset = (SwigPyGetSet*) closure;
|
|
||||||
if (!getset->get)
|
|
||||||
return SWIG_Py_Void();
|
|
||||||
PyObject *result = (*getset->get)(obj, NULL);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
SWIGINTERN int
|
SWIGINTERN int
|
||||||
pyswig_setter_closure (PyObject *obj, PyObject *val, void *closure)
|
py_builtin_bad_init(PyObject *self, PyObject *args, PyObject *kwds) {
|
||||||
{
|
PyErr_Format(PyExc_TypeError, "Cannot create new instances of type '%.300s'", self->ob_type->tp_name);
|
||||||
if (!closure) {
|
return -1;
|
||||||
PyErr_Format(PyExc_TypeError, "Missing getset closure");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
SwigPyGetSet *getset = (SwigPyGetSet*) closure;
|
|
||||||
if (!getset->set) {
|
|
||||||
PyErr_Format(PyExc_TypeError, "Illegal member variable assignment in type '%.300s'", obj->ob_type->tp_name);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
PyObject *tuple = PyTuple_New(1);
|
|
||||||
assert(tuple);
|
|
||||||
PyTuple_SET_ITEM(tuple, 0, val);
|
|
||||||
Py_XINCREF(val);
|
|
||||||
PyObject *result = (*getset->set)(obj, tuple);
|
|
||||||
Py_DECREF(tuple);
|
|
||||||
Py_XDECREF(result);
|
|
||||||
return result ? 0 : -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
SWIGINTERN int
|
|
||||||
pyswig_funpack_setter_closure (PyObject *obj, PyObject *val, void *closure)
|
|
||||||
{
|
|
||||||
if (!closure) {
|
|
||||||
PyErr_Format(PyExc_TypeError, "Missing getset closure");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
SwigPyGetSet *getset = (SwigPyGetSet*) closure;
|
|
||||||
if (!getset->set) {
|
|
||||||
PyErr_Format(PyExc_TypeError, "Illegal member variable assignment in type '%.300s'", obj->ob_type->tp_name);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
PyObject *result = (*getset->set)(obj, val);
|
|
||||||
Py_XDECREF(result);
|
|
||||||
return result ? 0 : -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
SWIGINTERN PyObject*
|
|
||||||
pyswig_static_getter_closure (PyObject *obj, void *closure)
|
|
||||||
{
|
|
||||||
if (!closure)
|
|
||||||
return SWIG_Py_Void();
|
|
||||||
SwigPyGetSet *getset = (SwigPyGetSet*) closure;
|
|
||||||
if (!getset->get)
|
|
||||||
return SWIG_Py_Void();
|
|
||||||
PyObject *tuple = PyTuple_New(0);
|
|
||||||
assert(tuple);
|
|
||||||
PyObject *result = (*getset->get)(obj, tuple);
|
|
||||||
Py_DECREF(tuple);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
SWIGINTERN int
|
|
||||||
pyswig_static_setter_closure (PyObject *obj, PyObject *val, void *closure)
|
|
||||||
{
|
|
||||||
if (!closure) {
|
|
||||||
PyErr_Format(PyExc_TypeError, "Missing getset closure");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
SwigPyGetSet *getset = (SwigPyGetSet*) closure;
|
|
||||||
if (!getset->set) {
|
|
||||||
PyErr_Format(PyExc_TypeError, "Illegal static variable assignment.");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
PyObject *tuple = PyTuple_New(1);
|
|
||||||
assert(tuple);
|
|
||||||
PyTuple_SET_ITEM(tuple, 0, val);
|
|
||||||
Py_XINCREF(val);
|
|
||||||
PyObject *result = (*getset->set)(obj, tuple);
|
|
||||||
Py_DECREF(tuple);
|
|
||||||
Py_XDECREF(result);
|
|
||||||
return result ? 0 : -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWIGINTERN void
|
SWIGINTERN void
|
||||||
SwigPyStaticVar_dealloc(PyDescrObject *descr)
|
py_builtin_bad_dealloc(PyObject *pyobj) {
|
||||||
{
|
SwigPyObject *sobj = (SwigPyObject *)pyobj;
|
||||||
_PyObject_GC_UNTRACK(descr);
|
if (sobj->own) {
|
||||||
Py_XDECREF(descr->d_type);
|
PyErr_Format(PyExc_TypeError, "Swig detected a memory leak in type '%.300s': no callable destructor found.", pyobj->ob_type->tp_name);
|
||||||
Py_XDECREF(descr->d_name);
|
}
|
||||||
PyObject_GC_Del(descr);
|
}
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
PyCFunction get;
|
||||||
|
PyCFunction set;
|
||||||
|
} SwigPyGetSet;
|
||||||
|
|
||||||
|
SWIGINTERN PyObject *
|
||||||
|
pyswig_getter_closure(PyObject *obj, void *closure) {
|
||||||
|
if (!closure)
|
||||||
|
return SWIG_Py_Void();
|
||||||
|
SwigPyGetSet *getset = (SwigPyGetSet *)closure;
|
||||||
|
if (!getset->get)
|
||||||
|
return SWIG_Py_Void();
|
||||||
|
PyObject *tuple = PyTuple_New(0);
|
||||||
|
assert(tuple);
|
||||||
|
PyObject *result = (*getset->get)(obj, tuple);
|
||||||
|
Py_DECREF(tuple);
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
SWIGINTERN PyObject *
|
SWIGINTERN PyObject *
|
||||||
SwigPyStaticVar_repr(PyGetSetDescrObject *descr)
|
pyswig_funpack_getter_closure(PyObject *obj, void *closure) {
|
||||||
{
|
if (!closure)
|
||||||
#if PY_VERSION_HEX >= 0x03000000
|
return SWIG_Py_Void();
|
||||||
return PyUnicode_FromFormat
|
SwigPyGetSet *getset = (SwigPyGetSet *)closure;
|
||||||
("<class attribute '%U' of type '%s'>",
|
if (!getset->get)
|
||||||
descr->d_name, descr->d_type->tp_name);
|
return SWIG_Py_Void();
|
||||||
#else
|
PyObject *result = (*getset->get)(obj, NULL);
|
||||||
return PyString_FromFormat
|
return result;
|
||||||
("<class attribute '%s' of type '%s'>",
|
|
||||||
PyString_AsString(descr->d_name), descr->d_type->tp_name);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWIGINTERN int
|
SWIGINTERN int
|
||||||
SwigPyStaticVar_traverse(PyObject *self, visitproc visit, void *arg)
|
pyswig_setter_closure(PyObject *obj, PyObject *val, void *closure) {
|
||||||
{
|
if (!closure) {
|
||||||
PyDescrObject *descr = (PyDescrObject *)self;
|
PyErr_Format(PyExc_TypeError, "Missing getset closure");
|
||||||
Py_VISIT(descr->d_type);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
SWIGINTERN PyObject *
|
|
||||||
SwigPyStaticVar_get (PyGetSetDescrObject *descr, PyObject *obj, PyObject *type)
|
|
||||||
{
|
|
||||||
if (descr->d_getset->get != NULL)
|
|
||||||
return descr->d_getset->get(obj, descr->d_getset->closure);
|
|
||||||
#if PY_VERSION_HEX >= 0x03000000
|
|
||||||
PyErr_Format(PyExc_AttributeError,
|
|
||||||
"attribute '%.300U' of '%.100s' objects is not readable",
|
|
||||||
descr->d_name, descr->d_type->tp_name);
|
|
||||||
#else
|
|
||||||
PyErr_Format(PyExc_AttributeError,
|
|
||||||
"attribute '%.300s' of '%.100s' objects is not readable",
|
|
||||||
PyString_AsString(descr->d_name), descr->d_type->tp_name);
|
|
||||||
#endif
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
SWIGINTERN int
|
|
||||||
SwigPyStaticVar_set (PyGetSetDescrObject *descr, PyObject *obj, PyObject *value)
|
|
||||||
{
|
|
||||||
int res;
|
|
||||||
|
|
||||||
if (descr->d_getset->set != NULL)
|
|
||||||
return descr->d_getset->set(obj, value, descr->d_getset->closure);
|
|
||||||
#if PY_VERSION_HEX >= 0x03000000
|
|
||||||
PyErr_Format(PyExc_AttributeError,
|
|
||||||
"attribute '%.300U' of '%.100s' objects is not writable",
|
|
||||||
descr->d_name,
|
|
||||||
descr->d_type->tp_name);
|
|
||||||
#else
|
|
||||||
PyErr_Format(PyExc_AttributeError,
|
|
||||||
"attribute '%.300s' of '%.100s' objects is not writable",
|
|
||||||
PyString_AsString(descr->d_name),
|
|
||||||
descr->d_type->tp_name);
|
|
||||||
#endif
|
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
SwigPyGetSet *getset = (SwigPyGetSet *)closure;
|
||||||
|
if (!getset->set) {
|
||||||
|
PyErr_Format(PyExc_TypeError, "Illegal member variable assignment in type '%.300s'", obj->ob_type->tp_name);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
PyObject *tuple = PyTuple_New(1);
|
||||||
|
assert(tuple);
|
||||||
|
PyTuple_SET_ITEM(tuple, 0, val);
|
||||||
|
Py_XINCREF(val);
|
||||||
|
PyObject *result = (*getset->set)(obj, tuple);
|
||||||
|
Py_DECREF(tuple);
|
||||||
|
Py_XDECREF(result);
|
||||||
|
return result ? 0 : -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
SWIGINTERN int
|
||||||
|
pyswig_funpack_setter_closure(PyObject *obj, PyObject *val, void *closure) {
|
||||||
|
if (!closure) {
|
||||||
|
PyErr_Format(PyExc_TypeError, "Missing getset closure");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
SwigPyGetSet *getset = (SwigPyGetSet *)closure;
|
||||||
|
if (!getset->set) {
|
||||||
|
PyErr_Format(PyExc_TypeError, "Illegal member variable assignment in type '%.300s'", obj->ob_type->tp_name);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
PyObject *result = (*getset->set)(obj, val);
|
||||||
|
Py_XDECREF(result);
|
||||||
|
return result ? 0 : -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
SWIGINTERN PyObject *
|
||||||
|
pyswig_static_getter_closure(PyObject *obj, void *closure) {
|
||||||
|
if (!closure)
|
||||||
|
return SWIG_Py_Void();
|
||||||
|
SwigPyGetSet *getset = (SwigPyGetSet *)closure;
|
||||||
|
if (!getset->get)
|
||||||
|
return SWIG_Py_Void();
|
||||||
|
PyObject *tuple = PyTuple_New(0);
|
||||||
|
assert(tuple);
|
||||||
|
PyObject *result = (*getset->get)(obj, tuple);
|
||||||
|
Py_DECREF(tuple);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
SWIGINTERN int
|
||||||
|
pyswig_static_setter_closure(PyObject *obj, PyObject *val, void *closure) {
|
||||||
|
if (!closure) {
|
||||||
|
PyErr_Format(PyExc_TypeError, "Missing getset closure");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
SwigPyGetSet *getset = (SwigPyGetSet *)closure;
|
||||||
|
if (!getset->set) {
|
||||||
|
PyErr_Format(PyExc_TypeError, "Illegal static variable assignment.");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
PyObject *tuple = PyTuple_New(1);
|
||||||
|
assert(tuple);
|
||||||
|
PyTuple_SET_ITEM(tuple, 0, val);
|
||||||
|
Py_XINCREF(val);
|
||||||
|
PyObject *result = (*getset->set)(obj, tuple);
|
||||||
|
Py_DECREF(tuple);
|
||||||
|
Py_XDECREF(result);
|
||||||
|
return result ? 0 : -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
SWIGINTERN void
|
||||||
|
SwigPyStaticVar_dealloc(PyDescrObject *descr) {
|
||||||
|
_PyObject_GC_UNTRACK(descr);
|
||||||
|
Py_XDECREF(descr->d_type);
|
||||||
|
Py_XDECREF(descr->d_name);
|
||||||
|
PyObject_GC_Del(descr);
|
||||||
|
}
|
||||||
|
|
||||||
|
SWIGINTERN PyObject *
|
||||||
|
SwigPyStaticVar_repr(PyGetSetDescrObject *descr) {
|
||||||
|
#if PY_VERSION_HEX >= 0x03000000
|
||||||
|
return PyUnicode_FromFormat("<class attribute '%U' of type '%s'>", descr->d_name, descr->d_type->tp_name);
|
||||||
|
#else
|
||||||
|
return PyString_FromFormat("<class attribute '%s' of type '%s'>", PyString_AsString(descr->d_name), descr->d_type->tp_name);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
SWIGINTERN int
|
||||||
|
SwigPyStaticVar_traverse(PyObject *self, visitproc visit, void *arg) {
|
||||||
|
PyDescrObject *descr = (PyDescrObject *)self;
|
||||||
|
Py_VISIT(descr->d_type);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
SWIGINTERN PyObject *
|
||||||
|
SwigPyStaticVar_get(PyGetSetDescrObject *descr, PyObject *obj, PyObject *type) {
|
||||||
|
if (descr->d_getset->get != NULL)
|
||||||
|
return descr->d_getset->get(obj, descr->d_getset->closure);
|
||||||
|
#if PY_VERSION_HEX >= 0x03000000
|
||||||
|
PyErr_Format(PyExc_AttributeError, "attribute '%.300U' of '%.100s' objects is not readable", descr->d_name, descr->d_type->tp_name);
|
||||||
|
#else
|
||||||
|
PyErr_Format(PyExc_AttributeError, "attribute '%.300s' of '%.100s' objects is not readable", PyString_AsString(descr->d_name), descr->d_type->tp_name);
|
||||||
|
#endif
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
SWIGINTERN int
|
||||||
|
SwigPyStaticVar_set(PyGetSetDescrObject *descr, PyObject *obj, PyObject *value) {
|
||||||
|
int res;
|
||||||
|
|
||||||
|
if (descr->d_getset->set != NULL)
|
||||||
|
return descr->d_getset->set(obj, value, descr->d_getset->closure);
|
||||||
|
#if PY_VERSION_HEX >= 0x03000000
|
||||||
|
PyErr_Format(PyExc_AttributeError, "attribute '%.300U' of '%.100s' objects is not writable", descr->d_name, descr->d_type->tp_name);
|
||||||
|
#else
|
||||||
|
PyErr_Format(PyExc_AttributeError, "attribute '%.300s' of '%.100s' objects is not writable", PyString_AsString(descr->d_name), descr->d_type->tp_name);
|
||||||
|
#endif
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
SWIGINTERN PyTypeObject SwigPyStaticVar_Type = {
|
SWIGINTERN PyTypeObject SwigPyStaticVar_Type = {
|
||||||
#if PY_VERSION_HEX >= 0x03000000
|
#if PY_VERSION_HEX >= 0x03000000
|
||||||
PyVarObject_HEAD_INIT(&PyType_Type, 0)
|
PyVarObject_HEAD_INIT(&PyType_Type, 0)
|
||||||
#else
|
#else
|
||||||
PyObject_HEAD_INIT(&PyType_Type)
|
PyObject_HEAD_INIT(&PyType_Type)
|
||||||
0,
|
0,
|
||||||
#endif
|
#endif
|
||||||
"swig_static_var_getset_descriptor",
|
"swig_static_var_getset_descriptor",
|
||||||
sizeof(PyGetSetDescrObject),
|
sizeof(PyGetSetDescrObject),
|
||||||
0,
|
0,
|
||||||
(destructor)SwigPyStaticVar_dealloc, /* tp_dealloc */
|
(destructor)SwigPyStaticVar_dealloc, /* tp_dealloc */
|
||||||
0, /* tp_print */
|
0, /* tp_print */
|
||||||
0, /* tp_getattr */
|
0, /* tp_getattr */
|
||||||
0, /* tp_setattr */
|
0, /* tp_setattr */
|
||||||
0, /* tp_compare */
|
0, /* tp_compare */
|
||||||
(reprfunc)SwigPyStaticVar_repr, /* tp_repr */
|
(reprfunc)SwigPyStaticVar_repr, /* tp_repr */
|
||||||
0, /* tp_as_number */
|
0, /* tp_as_number */
|
||||||
0, /* tp_as_sequence */
|
0, /* tp_as_sequence */
|
||||||
0, /* tp_as_mapping */
|
0, /* tp_as_mapping */
|
||||||
0, /* tp_hash */
|
0, /* tp_hash */
|
||||||
0, /* tp_call */
|
0, /* tp_call */
|
||||||
0, /* tp_str */
|
0, /* tp_str */
|
||||||
PyObject_GenericGetAttr, /* tp_getattro */
|
PyObject_GenericGetAttr, /* tp_getattro */
|
||||||
0, /* tp_setattro */
|
0, /* tp_setattro */
|
||||||
0, /* tp_as_buffer */
|
0, /* tp_as_buffer */
|
||||||
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_CLASS, /* tp_flags */
|
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_CLASS, /* tp_flags */
|
||||||
0, /* tp_doc */
|
0, /* tp_doc */
|
||||||
SwigPyStaticVar_traverse, /* tp_traverse */
|
SwigPyStaticVar_traverse, /* tp_traverse */
|
||||||
0, /* tp_clear */
|
0, /* tp_clear */
|
||||||
0, /* tp_richcompare */
|
0, /* tp_richcompare */
|
||||||
0, /* tp_weaklistoffset */
|
0, /* tp_weaklistoffset */
|
||||||
0, /* tp_iter */
|
0, /* tp_iter */
|
||||||
0, /* tp_iternext */
|
0, /* tp_iternext */
|
||||||
0, /* tp_methods */
|
0, /* tp_methods */
|
||||||
0, /* tp_members */
|
0, /* tp_members */
|
||||||
0, /* tp_getset */
|
0, /* tp_getset */
|
||||||
0, /* tp_base */
|
0, /* tp_base */
|
||||||
0, /* tp_dict */
|
0, /* tp_dict */
|
||||||
(descrgetfunc)SwigPyStaticVar_get, /* tp_descr_get */
|
(descrgetfunc)SwigPyStaticVar_get, /* tp_descr_get */
|
||||||
(descrsetfunc)SwigPyStaticVar_set, /* tp_descr_set */
|
(descrsetfunc)SwigPyStaticVar_set, /* tp_descr_set */
|
||||||
};
|
};
|
||||||
|
|
||||||
SWIGINTERN int
|
SWIGINTERN int
|
||||||
SwigPyObjectType_setattro(PyTypeObject *type, PyObject *name, PyObject *value)
|
SwigPyObjectType_setattro(PyTypeObject *type, PyObject *name, PyObject *value) {
|
||||||
{
|
PyObject *attribute = _PyType_Lookup(type, name);
|
||||||
PyObject *attribute = _PyType_Lookup(type, name);
|
if (attribute != NULL) {
|
||||||
if (attribute != NULL) {
|
/* Implement descriptor functionality, if any */
|
||||||
/* Implement descriptor functionality, if any */
|
descrsetfunc local_set = attribute->ob_type->tp_descr_set;
|
||||||
descrsetfunc local_set = attribute->ob_type->tp_descr_set;
|
if (local_set != NULL)
|
||||||
if (local_set != NULL)
|
return local_set(attribute, (PyObject *)type, value);
|
||||||
return local_set(attribute, (PyObject*) type, value);
|
|
||||||
#if PY_VERSION_HEX >= 0x03000000
|
#if PY_VERSION_HEX >= 0x03000000
|
||||||
PyErr_Format(PyExc_AttributeError,
|
PyErr_Format(PyExc_AttributeError, "cannot modify read-only attribute '%.50s.%.400U'", type->tp_name, name);
|
||||||
"cannot modify read-only attribute '%.50s.%.400U'",
|
#else
|
||||||
type->tp_name, name);
|
PyErr_Format(PyExc_AttributeError, "cannot modify read-only attribute '%.50s.%.400s'", type->tp_name, PyString_AS_STRING(name));
|
||||||
#else
|
|
||||||
PyErr_Format(PyExc_AttributeError,
|
|
||||||
"cannot modify read-only attribute '%.50s.%.400s'",
|
|
||||||
type->tp_name, PyString_AS_STRING(name));
|
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
#if PY_VERSION_HEX >= 0x03000000
|
#if PY_VERSION_HEX >= 0x03000000
|
||||||
PyErr_Format(PyExc_AttributeError,
|
PyErr_Format(PyExc_AttributeError, "type '%.50s' has no attribute '%.400U'", type->tp_name, name);
|
||||||
"type '%.50s' has no attribute '%.400U'",
|
|
||||||
type->tp_name, name);
|
|
||||||
#else
|
#else
|
||||||
PyErr_Format(PyExc_AttributeError,
|
PyErr_Format(PyExc_AttributeError, "type '%.50s' has no attribute '%.400s'", type->tp_name, PyString_AS_STRING(name));
|
||||||
"type '%.50s' has no attribute '%.400s'",
|
|
||||||
type->tp_name, PyString_AS_STRING(name));
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
SWIGINTERN PyGetSetDescrObject*
|
SWIGINTERN PyGetSetDescrObject *
|
||||||
SwigPyStaticVar_new_getset (PyTypeObject *type, PyGetSetDef *getset)
|
SwigPyStaticVar_new_getset(PyTypeObject *type, PyGetSetDef *getset) {
|
||||||
{
|
PyGetSetDescrObject *descr = (PyGetSetDescrObject *)PyType_GenericAlloc(&SwigPyStaticVar_Type, 0);
|
||||||
PyGetSetDescrObject *descr = (PyGetSetDescrObject*) PyType_GenericAlloc(&SwigPyStaticVar_Type, 0);
|
assert(descr);
|
||||||
assert(descr);
|
Py_XINCREF(type);
|
||||||
Py_XINCREF(type);
|
descr->d_type = type;
|
||||||
descr->d_type = type;
|
descr->d_name = PyString_InternFromString(getset->name);
|
||||||
descr->d_name = PyString_InternFromString(getset->name);
|
descr->d_getset = getset;
|
||||||
descr->d_getset = getset;
|
if (descr->d_name == NULL) {
|
||||||
if (descr->d_name == NULL) {
|
Py_DECREF(descr);
|
||||||
Py_DECREF(descr);
|
descr = NULL;
|
||||||
descr = NULL;
|
}
|
||||||
}
|
return descr;
|
||||||
return descr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
@ -473,27 +421,25 @@ SwigPyStaticVar_new_getset (PyTypeObject *type, PyGetSetDef *getset)
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
SWIGINTERN void
|
SWIGINTERN void
|
||||||
pyswig_builtin_init_bases (PyTypeObject *type, std::vector<PyTypeObject*>& bases)
|
pyswig_builtin_init_bases(PyTypeObject *type, std::vector<PyTypeObject *> &bases) {
|
||||||
{
|
if (!bases.size())
|
||||||
if (!bases.size())
|
bases.push_back(SwigPyObject_type());
|
||||||
bases.push_back(SwigPyObject_type());
|
type->tp_base = bases[0];
|
||||||
type->tp_base = bases[0];
|
Py_INCREF((PyObject *)bases[0]);
|
||||||
Py_INCREF((PyObject*) bases[0]);
|
PyObject *tuple = PyTuple_New(bases.size());
|
||||||
PyObject *tuple = PyTuple_New(bases.size());
|
int i;
|
||||||
int i;
|
for (i = 0; i < bases.size(); ++i) {
|
||||||
for (i = 0; i < bases.size(); ++i) {
|
PyTuple_SET_ITEM(tuple, i, (PyObject *)bases[i]);
|
||||||
PyTuple_SET_ITEM(tuple, i, (PyObject*) bases[i]);
|
Py_INCREF((PyObject *)bases[i]);
|
||||||
Py_INCREF((PyObject*) bases[i]);
|
}
|
||||||
}
|
type->tp_bases = tuple;
|
||||||
type->tp_bases = tuple;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWIGINTERN PyObject*
|
SWIGINTERN PyObject *
|
||||||
pyswig_this_closure (PyObject *self, void *closure)
|
pyswig_this_closure(PyObject *self, void *closure) {
|
||||||
{
|
PyObject *result = (PyObject *)SWIG_Python_GetSwigThis(self);
|
||||||
PyObject *result = (PyObject*) SWIG_Python_GetSwigThis(self);
|
Py_XINCREF(result);
|
||||||
Py_XINCREF(result);
|
return result;
|
||||||
return result;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -461,12 +461,13 @@ namespace Swig {
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename _Tp>
|
template <typename _Tp>
|
||||||
static PyObject* pyobj_disown (PyObject *pyobj, PyObject *SWIGUNUSEDPARM(args))
|
static PyObject* pyobj_disown(PyObject *pyobj, PyObject *SWIGUNUSEDPARM(args))
|
||||||
{
|
{
|
||||||
SwigPyObject *sobj = (SwigPyObject *) pyobj;
|
SwigPyObject *sobj = (SwigPyObject *)pyobj;
|
||||||
sobj->own = 0;
|
sobj->own = 0;
|
||||||
Director *d = SWIG_DIRECTOR_CAST(reinterpret_cast<_Tp*>(sobj->ptr));
|
Director *d = SWIG_DIRECTOR_CAST(reinterpret_cast<_Tp *>(sobj->ptr));
|
||||||
if (d) d->swig_disown();
|
if (d)
|
||||||
|
d->swig_disown();
|
||||||
return PyWeakref_NewProxy(pyobj, NULL);
|
return PyWeakref_NewProxy(pyobj, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -352,7 +352,7 @@ SWIG_init(void) {
|
||||||
// metatype is used to implement static member variables.
|
// metatype is used to implement static member variables.
|
||||||
PyObject *metatype_args = Py_BuildValue("(s(O){})", "SwigPyObjectType", &PyType_Type);
|
PyObject *metatype_args = Py_BuildValue("(s(O){})", "SwigPyObjectType", &PyType_Type);
|
||||||
assert(metatype_args);
|
assert(metatype_args);
|
||||||
PyTypeObject *metatype = (PyTypeObject*) PyType_Type.tp_call((PyObject*) &PyType_Type, metatype_args, NULL);
|
PyTypeObject *metatype = (PyTypeObject *) PyType_Type.tp_call((PyObject *) &PyType_Type, metatype_args, NULL);
|
||||||
assert(metatype);
|
assert(metatype);
|
||||||
Py_DECREF(metatype_args);
|
Py_DECREF(metatype_args);
|
||||||
metatype->tp_setattro = (setattrofunc) &SwigPyObjectType_setattro;
|
metatype->tp_setattro = (setattrofunc) &SwigPyObjectType_setattro;
|
||||||
|
|
@ -386,7 +386,7 @@ SWIG_init(void) {
|
||||||
|
|
||||||
// All objects have a 'this' attribute
|
// All objects have a 'this' attribute
|
||||||
static PyGetSetDef this_getset_def = {
|
static PyGetSetDef this_getset_def = {
|
||||||
const_cast<char*>("this"), pyswig_this_closure, NULL, NULL, NULL
|
const_cast<char *>("this"), pyswig_this_closure, NULL, NULL, NULL
|
||||||
};
|
};
|
||||||
PyObject *this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def);
|
PyObject *this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
|
||||||
#if defined(SWIGPYTHON_BUILTIN)
|
#if defined(SWIGPYTHON_BUILTIN)
|
||||||
|
|
||||||
SWIGINTERN void
|
SWIGINTERN void
|
||||||
pyswig_add_public_symbol (PyObject *seq, const char *key) {
|
pyswig_add_public_symbol(PyObject *seq, const char *key) {
|
||||||
PyObject *s = PyString_InternFromString(key);
|
PyObject *s = PyString_InternFromString(key);
|
||||||
PyList_Append(seq, s);
|
PyList_Append(seq, s);
|
||||||
Py_DECREF(s);
|
Py_DECREF(s);
|
||||||
|
|
@ -82,7 +82,7 @@ pyswig_add_public_symbol (PyObject *seq, const char *key) {
|
||||||
|
|
||||||
SWIGINTERN void
|
SWIGINTERN void
|
||||||
SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {
|
SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {
|
||||||
PyDict_SetItemString(d, (char*) name, obj);
|
PyDict_SetItemString(d, (char *)name, obj);
|
||||||
Py_DECREF(obj);
|
Py_DECREF(obj);
|
||||||
if (public_interface)
|
if (public_interface)
|
||||||
pyswig_add_public_symbol(public_interface, name);
|
pyswig_add_public_symbol(public_interface, name);
|
||||||
|
|
@ -92,7 +92,7 @@ SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *nam
|
||||||
|
|
||||||
SWIGINTERN void
|
SWIGINTERN void
|
||||||
SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {
|
SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {
|
||||||
PyDict_SetItemString(d, (char*) name, obj);
|
PyDict_SetItemString(d, (char *)name, obj);
|
||||||
Py_DECREF(obj);
|
Py_DECREF(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -338,8 +338,7 @@ SwigPyClientData_New(PyObject* obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
SWIGRUNTIME void
|
SWIGRUNTIME void
|
||||||
SwigPyClientData_Del(SwigPyClientData* data)
|
SwigPyClientData_Del(SwigPyClientData *data) {
|
||||||
{
|
|
||||||
Py_XDECREF(data->newraw);
|
Py_XDECREF(data->newraw);
|
||||||
Py_XDECREF(data->newargs);
|
Py_XDECREF(data->newargs);
|
||||||
Py_XDECREF(data->destroy);
|
Py_XDECREF(data->destroy);
|
||||||
|
|
@ -1127,106 +1126,84 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
|
||||||
return SWIG_OK;
|
return SWIG_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
if (ty && ty->clientdata && ((SwigPyClientData*) ty->clientdata)->pytype) {
|
|
||||||
PyTypeObject *target_tp = ((SwigPyClientData*) ty->clientdata)->pytype;
|
|
||||||
SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
|
|
||||||
for (; sobj; sobj = (SwigPyObject*) sobj->next) {
|
|
||||||
if (!sobj->ty->clientdata)
|
|
||||||
continue;
|
|
||||||
PyTypeObject *candidate_tp = ((SwigPyClientData*) sobj->ty->clientdata)->pytype;
|
|
||||||
if (candidate_tp && PyType_IsSubtype(candidate_tp, target_tp)) {
|
|
||||||
if (own)
|
|
||||||
*own = *own | sobj->own;
|
|
||||||
if (flags & SWIG_POINTER_DISOWN)
|
|
||||||
sobj->own = 0;
|
|
||||||
if (ptr)
|
|
||||||
*ptr = sobj->ptr;
|
|
||||||
return SWIG_OK;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return SWIG_ERROR;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
int res = SWIG_ERROR;
|
int res = SWIG_ERROR;
|
||||||
|
|
||||||
SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
|
SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
|
||||||
if (own)
|
if (own)
|
||||||
*own = 0;
|
*own = 0;
|
||||||
while (sobj) {
|
while (sobj) {
|
||||||
void *vptr = sobj->ptr;
|
void *vptr = sobj->ptr;
|
||||||
if (ty) {
|
if (ty) {
|
||||||
swig_type_info *to = sobj->ty;
|
swig_type_info *to = sobj->ty;
|
||||||
if (to == ty) {
|
if (to == ty) {
|
||||||
/* no type cast needed */
|
/* no type cast needed */
|
||||||
if (ptr) *ptr = vptr;
|
if (ptr) *ptr = vptr;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
|
swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
|
||||||
if (!tc) {
|
if (!tc) {
|
||||||
sobj = (SwigPyObject *)sobj->next;
|
sobj = (SwigPyObject *)sobj->next;
|
||||||
} else {
|
} else {
|
||||||
if (ptr) {
|
if (ptr) {
|
||||||
int newmemory = 0;
|
int newmemory = 0;
|
||||||
*ptr = SWIG_TypeCast(tc,vptr,&newmemory);
|
*ptr = SWIG_TypeCast(tc,vptr,&newmemory);
|
||||||
if (newmemory == SWIG_CAST_NEW_MEMORY) {
|
if (newmemory == SWIG_CAST_NEW_MEMORY) {
|
||||||
assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
|
assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
|
||||||
if (own)
|
if (own)
|
||||||
*own = *own | SWIG_CAST_NEW_MEMORY;
|
*own = *own | SWIG_CAST_NEW_MEMORY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (ptr) *ptr = vptr;
|
if (ptr) *ptr = vptr;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sobj) {
|
if (sobj) {
|
||||||
if (own)
|
if (own)
|
||||||
*own = *own | sobj->own;
|
*own = *own | sobj->own;
|
||||||
if (flags & SWIG_POINTER_DISOWN) {
|
if (flags & SWIG_POINTER_DISOWN) {
|
||||||
sobj->own = 0;
|
sobj->own = 0;
|
||||||
}
|
}
|
||||||
res = SWIG_OK;
|
res = SWIG_OK;
|
||||||
} else {
|
} else {
|
||||||
if (flags & SWIG_POINTER_IMPLICIT_CONV) {
|
if (flags & SWIG_POINTER_IMPLICIT_CONV) {
|
||||||
SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
|
SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
|
||||||
if (data && !data->implicitconv) {
|
if (data && !data->implicitconv) {
|
||||||
PyObject *klass = data->klass;
|
PyObject *klass = data->klass;
|
||||||
if (klass) {
|
if (klass) {
|
||||||
PyObject *impconv;
|
PyObject *impconv;
|
||||||
data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
|
data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
|
||||||
impconv = SWIG_Python_CallFunctor(klass, obj);
|
impconv = SWIG_Python_CallFunctor(klass, obj);
|
||||||
data->implicitconv = 0;
|
data->implicitconv = 0;
|
||||||
if (PyErr_Occurred()) {
|
if (PyErr_Occurred()) {
|
||||||
PyErr_Clear();
|
PyErr_Clear();
|
||||||
impconv = 0;
|
impconv = 0;
|
||||||
}
|
}
|
||||||
if (impconv) {
|
if (impconv) {
|
||||||
SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
|
SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
|
||||||
if (iobj) {
|
if (iobj) {
|
||||||
void *vptr;
|
void *vptr;
|
||||||
res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
|
res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
|
||||||
if (SWIG_IsOK(res)) {
|
if (SWIG_IsOK(res)) {
|
||||||
if (ptr) {
|
if (ptr) {
|
||||||
*ptr = vptr;
|
*ptr = vptr;
|
||||||
/* transfer the ownership to 'ptr' */
|
/* transfer the ownership to 'ptr' */
|
||||||
iobj->own = 0;
|
iobj->own = 0;
|
||||||
res = SWIG_AddCast(res);
|
res = SWIG_AddCast(res);
|
||||||
res = SWIG_AddNewMask(res);
|
res = SWIG_AddNewMask(res);
|
||||||
} else {
|
} else {
|
||||||
res = SWIG_AddCast(res);
|
res = SWIG_AddCast(res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Py_DECREF(impconv);
|
Py_DECREF(impconv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
@ -1399,35 +1376,35 @@ SWIG_Python_InitShadowInstance(PyObject *args) {
|
||||||
|
|
||||||
SWIGRUNTIME PyObject *
|
SWIGRUNTIME PyObject *
|
||||||
SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) {
|
SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) {
|
||||||
if (!ptr)
|
if (!ptr)
|
||||||
return SWIG_Py_Void();
|
return SWIG_Py_Void();
|
||||||
|
|
||||||
SwigPyClientData *clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
|
SwigPyClientData *clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
|
||||||
int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
|
int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
|
||||||
if (clientdata && clientdata->pytype) {
|
if (clientdata && clientdata->pytype) {
|
||||||
SwigPyObject *newobj = PyObject_New(SwigPyObject, clientdata->pytype);
|
SwigPyObject *newobj = PyObject_New(SwigPyObject, clientdata->pytype);
|
||||||
if (newobj) {
|
if (newobj) {
|
||||||
newobj->ptr = ptr;
|
newobj->ptr = ptr;
|
||||||
newobj->ty = type;
|
newobj->ty = type;
|
||||||
newobj->own = own;
|
newobj->own = own;
|
||||||
newobj->next = 0;
|
newobj->next = 0;
|
||||||
#ifdef SWIGPYTHON_BUILTIN
|
#ifdef SWIGPYTHON_BUILTIN
|
||||||
newobj->dict = 0;
|
newobj->dict = 0;
|
||||||
#endif
|
#endif
|
||||||
return (PyObject*) newobj;
|
return (PyObject*) newobj;
|
||||||
}
|
|
||||||
return SWIG_Py_Void();
|
|
||||||
}
|
}
|
||||||
|
return SWIG_Py_Void();
|
||||||
|
}
|
||||||
|
|
||||||
PyObject *robj = SwigPyObject_New(ptr, type, own);
|
PyObject *robj = SwigPyObject_New(ptr, type, own);
|
||||||
if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
|
if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
|
||||||
PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
|
PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
|
||||||
if (inst) {
|
if (inst) {
|
||||||
Py_DECREF(robj);
|
Py_DECREF(robj);
|
||||||
robj = inst;
|
robj = inst;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return robj;
|
}
|
||||||
|
return robj;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create a new packed object */
|
/* Create a new packed object */
|
||||||
|
|
@ -1444,12 +1421,12 @@ SWIG_Python_NewBuiltinObj(PyObject *self, void *ptr, swig_type_info *type, int f
|
||||||
assert(clientdata);
|
assert(clientdata);
|
||||||
assert(clientdata->pytype);
|
assert(clientdata->pytype);
|
||||||
int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
|
int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
|
||||||
SwigPyObject *newobj = (SwigPyObject*) self;
|
SwigPyObject *newobj = (SwigPyObject *)self;
|
||||||
if (newobj->ptr) {
|
if (newobj->ptr) {
|
||||||
PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0);
|
PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0);
|
||||||
while (newobj->next) newobj = (SwigPyObject*) newobj->next;
|
while (newobj->next) newobj = (SwigPyObject *)newobj->next;
|
||||||
newobj->next = next_self;
|
newobj->next = next_self;
|
||||||
newobj = (SwigPyObject*) next_self;
|
newobj = (SwigPyObject *)next_self;
|
||||||
}
|
}
|
||||||
newobj->ptr = ptr;
|
newobj->ptr = ptr;
|
||||||
newobj->own = own;
|
newobj->own = own;
|
||||||
|
|
@ -1696,55 +1673,52 @@ SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags)
|
||||||
|
|
||||||
// Cribbed from Objects/object.c in the python source code and modified
|
// Cribbed from Objects/object.c in the python source code and modified
|
||||||
SWIGRUNTIME int
|
SWIGRUNTIME int
|
||||||
SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value)
|
SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
|
||||||
{
|
PyTypeObject *tp = obj->ob_type;
|
||||||
PyTypeObject *tp = obj->ob_type;
|
PyObject *descr;
|
||||||
PyObject *descr;
|
descrsetfunc f;
|
||||||
descrsetfunc f;
|
int res = -1;
|
||||||
int res = -1;
|
|
||||||
|
|
||||||
#ifdef Py_USING_UNICODE
|
#ifdef Py_USING_UNICODE
|
||||||
if (PyString_Check(name)) {
|
if (PyString_Check(name)) {
|
||||||
name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL);
|
name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL);
|
||||||
if (name == NULL)
|
if (!name)
|
||||||
return -1;
|
return -1;
|
||||||
} else if (!PyUnicode_Check(name)) {
|
} else if (!PyUnicode_Check(name)) {
|
||||||
#else
|
#else
|
||||||
if (!PyString_Check(name)) {
|
if (!PyString_Check(name)) {
|
||||||
#endif
|
#endif
|
||||||
PyErr_Format(PyExc_TypeError,
|
PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name);
|
||||||
"attribute name must be string, not '%.200s'",
|
return -1;
|
||||||
name->ob_type->tp_name);
|
|
||||||
return -1;
|
|
||||||
} else {
|
} else {
|
||||||
Py_INCREF(name);
|
Py_INCREF(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tp->tp_dict == NULL) {
|
if (!tp->tp_dict) {
|
||||||
if (PyType_Ready(tp) < 0)
|
if (PyType_Ready(tp) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
descr = _PyType_Lookup(tp, name);
|
descr = _PyType_Lookup(tp, name);
|
||||||
f = NULL;
|
f = NULL;
|
||||||
if (descr != NULL)
|
if (descr != NULL)
|
||||||
f = descr->ob_type->tp_descr_set;
|
f = descr->ob_type->tp_descr_set;
|
||||||
if (f == NULL) {
|
if (!f) {
|
||||||
PyErr_Format(PyExc_AttributeError,
|
PyErr_Format(PyExc_AttributeError,
|
||||||
#ifdef Py_USING_UNICODE
|
#ifdef Py_USING_UNICODE
|
||||||
"'%.100s' object has no attribute '%.200U'",
|
"'%.100s' object has no attribute '%.200U'",
|
||||||
#else
|
#else
|
||||||
"'%.100s' object has no attribute '%.200S'",
|
"'%.100s' object has no attribute '%.200S'",
|
||||||
#endif
|
#endif
|
||||||
tp->tp_name, name);
|
tp->tp_name, name);
|
||||||
} else {
|
} else {
|
||||||
res = f(descr, obj, value);
|
res = f(descr, obj, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
Py_DECREF(name);
|
Py_DECREF(name);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
||||||
|
|
@ -10,5 +10,4 @@
|
||||||
%insert(runtime) "pythreads.swg"; /* Python thread code */
|
%insert(runtime) "pythreads.swg"; /* Python thread code */
|
||||||
%insert(runtime) "pyapi.swg"; /* Python API */
|
%insert(runtime) "pyapi.swg"; /* Python API */
|
||||||
%insert(runtime) "pyrun.swg"; /* Python run-time code */
|
%insert(runtime) "pyrun.swg"; /* Python run-time code */
|
||||||
|
|
||||||
%insert(runtime) "builtin.swg"; /* Specialization for classes with single inheritance */
|
%insert(runtime) "builtin.swg"; /* Specialization for classes with single inheritance */
|
||||||
|
|
|
||||||
|
|
@ -291,10 +291,10 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
%extend {
|
%extend {
|
||||||
// This will be called through the mp_ass_subscript slot to delete an entry.
|
// This will be called through the mp_ass_subscript slot to delete an entry.
|
||||||
void __setitem__(const key_type& key) {
|
void __setitem__(const key_type& key) {
|
||||||
self->erase(key);
|
self->erase(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
%extend {
|
%extend {
|
||||||
|
|
|
||||||
|
|
@ -240,9 +240,11 @@ public:
|
||||||
}
|
}
|
||||||
/* ------------------------------------------------------------
|
/* ------------------------------------------------------------
|
||||||
* Thread Implementation
|
* Thread Implementation
|
||||||
* ------------------------------------------------------------ */ int threads_enable(Node *n) const {
|
* ------------------------------------------------------------ */
|
||||||
|
int threads_enable(Node *n) const {
|
||||||
return threads && !GetFlagAttr(n, "feature:nothread");
|
return threads && !GetFlagAttr(n, "feature:nothread");
|
||||||
}
|
}
|
||||||
|
|
||||||
int initialize_threads(String *f_init) {
|
int initialize_threads(String *f_init) {
|
||||||
if (!threads) {
|
if (!threads) {
|
||||||
return SWIG_OK;
|
return SWIG_OK;
|
||||||
|
|
@ -510,7 +512,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} /* for */
|
}
|
||||||
|
|
||||||
if (py3) {
|
if (py3) {
|
||||||
/* force disable features that not compatible with Python 3.x */
|
/* force disable features that not compatible with Python 3.x */
|
||||||
|
|
@ -882,11 +884,11 @@ public:
|
||||||
* But don't sure wether this would broken old Python?
|
* But don't sure wether this would broken old Python?
|
||||||
*/
|
*/
|
||||||
Printv(f_shadow,
|
Printv(f_shadow,
|
||||||
// "import types\n",
|
// "import types\n",
|
||||||
"try:\n",
|
"try:\n",
|
||||||
// " _object = types.ObjectType\n",
|
// " _object = types.ObjectType\n",
|
||||||
" _object = object\n", " _newclass = 1\n", "except AttributeError:\n", " class _object : pass\n", " _newclass = 0\n",
|
" _object = object\n", " _newclass = 1\n", "except AttributeError:\n", " class _object : pass\n", " _newclass = 0\n",
|
||||||
// "del types\n",
|
// "del types\n",
|
||||||
"\n\n", NIL);
|
"\n\n", NIL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -995,8 +997,6 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
Dump(f_wrappers, f_begin);
|
Dump(f_wrappers, f_begin);
|
||||||
//if (builtin)
|
|
||||||
//Dump(f_builtins, f_begin);
|
|
||||||
Wrapper_pretty_print(f_init, f_begin);
|
Wrapper_pretty_print(f_init, f_begin);
|
||||||
|
|
||||||
Delete(f_header);
|
Delete(f_header);
|
||||||
|
|
@ -3186,7 +3186,7 @@ public:
|
||||||
String *mname = SwigType_manglestr(rname);
|
String *mname = SwigType_manglestr(rname);
|
||||||
|
|
||||||
Printf(f_init, "\n// type '%s'\n", rname);
|
Printf(f_init, "\n// type '%s'\n", rname);
|
||||||
Printf(f_init, " builtin_pytype = (PyTypeObject*) &SwigPyBuiltin_%s_type;\n", mname);
|
Printf(f_init, " builtin_pytype = (PyTypeObject *)&SwigPyBuiltin_%s_type;\n", mname);
|
||||||
Printf(f_init, " builtin_pytype->tp_dict = d = PyDict_New();\n");
|
Printf(f_init, " builtin_pytype->tp_dict = d = PyDict_New();\n");
|
||||||
|
|
||||||
Delete(rname);
|
Delete(rname);
|
||||||
|
|
@ -3277,38 +3277,37 @@ public:
|
||||||
// Rich compare function
|
// Rich compare function
|
||||||
Hash *richcompare = Getattr(n, "richcompare");
|
Hash *richcompare = Getattr(n, "richcompare");
|
||||||
assert(richcompare);
|
assert(richcompare);
|
||||||
Printf(f, "SWIGINTERN PyObject*\n");
|
Printf(f, "SWIGINTERN PyObject *\n");
|
||||||
Printf(f, "%s_richcompare (PyObject *self, PyObject *other, int op)\n", templ);
|
Printf(f, "%s_richcompare(PyObject *self, PyObject *other, int op) {\n", templ);
|
||||||
Printf(f, "{\n");
|
Printf(f, " PyObject *result = NULL;\n");
|
||||||
Printf(f, " PyObject *result = NULL;\n");
|
|
||||||
if (!funpack) {
|
if (!funpack) {
|
||||||
Printf(f, " PyObject *tuple = PyTuple_New(1);\n");
|
Printf(f, " PyObject *tuple = PyTuple_New(1);\n");
|
||||||
Printf(f, " assert(tuple);\n");
|
Printf(f, " assert(tuple);\n");
|
||||||
Printf(f, " PyTuple_SET_ITEM(tuple, 0, other);\n");
|
Printf(f, " PyTuple_SET_ITEM(tuple, 0, other);\n");
|
||||||
Printf(f, " Py_XINCREF(other);\n");
|
Printf(f, " Py_XINCREF(other);\n");
|
||||||
}
|
}
|
||||||
Printf(f, " switch (op) {\n");
|
Printf(f, " switch (op) {\n");
|
||||||
for (Iterator i = First(richcompare); i.item; i = Next(i))
|
for (Iterator i = First(richcompare); i.item; i = Next(i))
|
||||||
Printf(f, " case %s : result = %s(self, %s); break;\n", i.key, i.item, funpack ? "other" : "tuple");
|
Printf(f, " case %s : result = %s(self, %s); break;\n", i.key, i.item, funpack ? "other" : "tuple");
|
||||||
Printv(f, " default : break;\n", NIL);
|
Printv(f, " default : break;\n", NIL);
|
||||||
Printf(f, " }\n");
|
Printf(f, " }\n");
|
||||||
Printv(f, " if (result == NULL) {\n", NIL);
|
Printv(f, " if (!result) {\n", NIL);
|
||||||
Printv(f, " if (SwigPyObject_Check(self) && SwigPyObject_Check(other)) {\n", NIL);
|
Printv(f, " if (SwigPyObject_Check(self) && SwigPyObject_Check(other)) {\n", NIL);
|
||||||
Printv(f, " result = SwigPyObject_richcompare((SwigPyObject*) self, (SwigPyObject*) other, op);\n", NIL);
|
Printv(f, " result = SwigPyObject_richcompare((SwigPyObject *)self, (SwigPyObject *)other, op);\n", NIL);
|
||||||
Printv(f, " } else {\n", NIL);
|
Printv(f, " } else {\n", NIL);
|
||||||
Printv(f, " result = Py_NotImplemented;\n", NIL);
|
Printv(f, " result = Py_NotImplemented;\n", NIL);
|
||||||
Printv(f, " Py_INCREF(result);\n", NIL);
|
Printv(f, " Py_INCREF(result);\n", NIL);
|
||||||
Printv(f, " }\n", NIL);
|
|
||||||
Printv(f, " }\n", NIL);
|
Printv(f, " }\n", NIL);
|
||||||
|
Printv(f, " }\n", NIL);
|
||||||
if (!funpack)
|
if (!funpack)
|
||||||
Printf(f, " Py_DECREF(tuple);\n");
|
Printf(f, " Py_DECREF(tuple);\n");
|
||||||
Printf(f, " return result;\n");
|
Printf(f, " return result;\n");
|
||||||
Printf(f, "}\n\n");
|
Printf(f, "}\n\n");
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
Printf(f, "SWIGINTERN PyMethodDef %s_methods[] = {\n", templ);
|
Printf(f, "SWIGINTERN PyMethodDef %s_methods[] = {\n", templ);
|
||||||
Dump(builtin_methods, f);
|
Dump(builtin_methods, f);
|
||||||
Printf(f, " {NULL} // Sentinel\n};\n\n");
|
Printf(f, " {NULL} // Sentinel\n};\n\n");
|
||||||
|
|
||||||
// No instance dict for nondynamic objects
|
// No instance dict for nondynamic objects
|
||||||
if (GetFlag(n, "feature:python:nondynamic"))
|
if (GetFlag(n, "feature:python:nondynamic"))
|
||||||
|
|
@ -3502,7 +3501,7 @@ public:
|
||||||
Printf(clientdata_klass, "(PyObject*) &%s_type", templ);
|
Printf(clientdata_klass, "(PyObject*) &%s_type", templ);
|
||||||
}
|
}
|
||||||
|
|
||||||
Printf(f, "SWIGINTERN SwigPyClientData %s_clientdata = {%s, 0, 0, 0, 0, 0, (PyTypeObject*) &%s_type};\n\n", templ, clientdata_klass, templ);
|
Printf(f, "SWIGINTERN SwigPyClientData %s_clientdata = {%s, 0, 0, 0, 0, 0, (PyTypeObject *)&%s_type};\n\n", templ, clientdata_klass, templ);
|
||||||
|
|
||||||
Printv(f_init, " if (PyType_Ready(builtin_pytype) < 0) {\n", NIL);
|
Printv(f_init, " if (PyType_Ready(builtin_pytype) < 0) {\n", NIL);
|
||||||
Printf(f_init, " PyErr_SetString(PyExc_TypeError, \"Couldn't create type '%s'\");\n", symname);
|
Printf(f_init, " PyErr_SetString(PyExc_TypeError, \"Couldn't create type '%s'\");\n", symname);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue