757
756
#define PyInt_Check(x) PyLong_Check(x)
758
757
#define PyInt_AsLong(x) PyLong_AsLong(x)
759
758
#define PyInt_FromLong(x) PyLong_FromLong(x)
759
#define PyString_Check(name) PyBytes_Check(name)
760
#define PyString_FromString(x) PyUnicode_FromString(x)
760
761
#define PyString_Format(fmt, args) PyUnicode_Format(fmt, args)
762
#define PyString_AsString(str) PyBytes_AsString(str)
763
#define PyString_Size(str) PyBytes_Size(str)
764
#define PyString_InternFromString(key) PyUnicode_InternFromString(key)
765
#define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE
766
#define PyString_AS_STRING(x) PyUnicode_AS_STRING(x)
767
#define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x)
897
904
typedef int Py_ssize_t;
898
905
# define PY_SSIZE_T_MAX INT_MAX
899
906
# define PY_SSIZE_T_MIN INT_MIN
907
typedef inquiry lenfunc;
908
typedef intargfunc ssizeargfunc;
909
typedef intintargfunc ssizessizeargfunc;
910
typedef intobjargproc ssizeobjargproc;
911
typedef intintobjargproc ssizessizeobjargproc;
912
typedef getreadbufferproc readbufferproc;
913
typedef getwritebufferproc writebufferproc;
914
typedef getsegcountproc segcountproc;
915
typedef getcharbufferproc charbufferproc;
916
static long PyNumber_AsSsize_t (PyObject *x, void *SWIGUNUSEDPARM(exc))
919
PyObject *i = PyNumber_Int(x);
921
result = PyInt_AsLong(i);
928
#if PY_VERSION_HEX < 0x02040000
929
#define Py_VISIT(op) \
932
int vret = visit((op), arg); \
939
#if PY_VERSION_HEX < 0x02030000
942
PyNumberMethods as_number;
943
PyMappingMethods as_mapping;
944
PySequenceMethods as_sequence;
945
PyBufferProcs as_buffer;
946
PyObject *name, *slots;
950
#if PY_VERSION_HEX < 0x02030000
951
typedef destructor freefunc;
954
#if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \
955
(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0) || \
956
(PY_MAJOR_VERSION > 3))
957
# define SWIGPY_USE_CAPSULE
958
# define SWIGPY_CAPSULE_NAME ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
961
#if PY_VERSION_HEX < 0x03020000
962
#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
963
#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
902
966
/* -----------------------------------------------------------------------------
1071
1132
* Wrapper of PyInstanceMethod_New() used in Python 3
1072
1133
* It is exported to the generated module, used for -fastproxy
1073
1134
* ----------------------------------------------------------------------------- */
1074
SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *self, PyObject *func)
1135
#if PY_VERSION_HEX >= 0x03000000
1136
SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
1076
#if PY_VERSION_HEX >= 0x03000000
1077
1138
return PyInstanceMethod_New(func);
1141
SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(func))
1083
1147
#ifdef __cplusplus
1091
1152
/* -----------------------------------------------------------------------------
1092
* See the LICENSE file for information on copyright, usage and redistribution
1093
* of SWIG, and the README file for authors - http://www.swig.org/release.html.
1097
1155
* This file contains the runtime support for Python modules
1106
1164
#define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1107
1165
#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags)
1108
1166
#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1109
#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(ptr, type, flags)
1168
#ifdef SWIGPYTHON_BUILTIN
1169
#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags)
1171
#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1174
#define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1110
1176
#define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty)
1111
1177
#define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src)
1112
1178
#define swig_owntype int
1122
1188
/* for C or C++ function pointers */
1123
1189
#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
1124
#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(ptr, type, 0)
1190
#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0)
1126
1192
/* for C++ member pointers, ie, member methods */
1127
1193
#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1165
1231
/* Set a constant value */
1233
#if defined(SWIGPYTHON_BUILTIN)
1236
SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) {
1237
PyObject *s = PyString_InternFromString(key);
1238
PyList_Append(seq, s);
1243
SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {
1244
PyDict_SetItemString(d, (char *)name, obj);
1246
if (public_interface)
1247
SwigPyBuiltin_AddPublicSymbol(public_interface, name);
1167
1252
SWIGINTERN void
1168
1253
SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {
1169
PyDict_SetItemString(d, (char*) name, obj);
1254
PyDict_SetItemString(d, (char *)name, obj);
1170
1255
Py_DECREF(obj);
1173
1260
/* Append a value to the result obj */
1175
1262
SWIGINTERN PyObject*
1537
1636
Py_INCREF(Py_NotImplemented);
1538
1637
return Py_NotImplemented;
1540
if( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) )
1639
res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0);
1549
SWIGRUNTIME PyTypeObject* _PySwigObject_type(void);
1644
SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void);
1551
SWIGRUNTIME PyTypeObject*
1552
SwigPyObject_type(void) {
1553
static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type();
1646
#ifdef SWIGPYTHON_BUILTIN
1647
static swig_type_info *SwigPyObject_stype = 0;
1648
SWIGRUNTIME PyTypeObject*
1649
SwigPyObject_type(void) {
1650
SwigPyClientData *cd;
1651
assert(SwigPyObject_stype);
1652
cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
1658
SWIGRUNTIME PyTypeObject*
1659
SwigPyObject_type(void) {
1660
static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce();
1557
1665
SWIGRUNTIMEINLINE int
1558
1666
SwigPyObject_Check(PyObject *op) {
1667
#ifdef SWIGPYTHON_BUILTIN
1668
PyTypeObject *target_tp = SwigPyObject_type();
1669
if (PyType_IsSubtype(op->ob_type, target_tp))
1671
return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0);
1559
1673
return (Py_TYPE(op) == SwigPyObject_type())
1560
1674
|| (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
1563
1678
SWIGRUNTIME PyObject *
1775
static PyTypeObject swigpyobject_type;
1890
static PyTypeObject swigpyobject_type;
1776
1891
static int type_init = 0;
1777
1892
if (!type_init) {
1778
const PyTypeObject tmp
1780
/* PyObject header changed in Python 3 */
1893
const PyTypeObject tmp = {
1894
/* PyObject header changed in Python 3 */
1781
1895
#if PY_VERSION_HEX >= 0x03000000
1782
PyVarObject_HEAD_INIT(&PyType_Type, 0)
1784
PyObject_HEAD_INIT(NULL)
1896
PyVarObject_HEAD_INIT(NULL, 0)
1898
PyObject_HEAD_INIT(NULL)
1787
(char *)"SwigPyObject", /* tp_name */
1788
sizeof(SwigPyObject), /* tp_basicsize */
1789
0, /* tp_itemsize */
1790
(destructor)SwigPyObject_dealloc, /* tp_dealloc */
1791
(printfunc)SwigPyObject_print, /* tp_print */
1901
(char *)"SwigPyObject", /* tp_name */
1902
sizeof(SwigPyObject), /* tp_basicsize */
1903
0, /* tp_itemsize */
1904
(destructor)SwigPyObject_dealloc, /* tp_dealloc */
1905
(printfunc)SwigPyObject_print, /* tp_print */
1792
1906
#if PY_VERSION_HEX < 0x02020000
1793
(getattrfunc)SwigPyObject_getattr, /* tp_getattr */
1907
(getattrfunc)SwigPyObject_getattr, /* tp_getattr */
1795
(getattrfunc)0, /* tp_getattr */
1909
(getattrfunc)0, /* tp_getattr */
1797
(setattrfunc)0, /* tp_setattr */
1911
(setattrfunc)0, /* tp_setattr */
1798
1912
#if PY_VERSION_HEX >= 0x03000000
1799
1913
0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
1801
(cmpfunc)SwigPyObject_compare, /* tp_compare */
1915
(cmpfunc)SwigPyObject_compare, /* tp_compare */
1803
(reprfunc)SwigPyObject_repr, /* tp_repr */
1804
&SwigPyObject_as_number, /* tp_as_number */
1805
0, /* tp_as_sequence */
1806
0, /* tp_as_mapping */
1807
(hashfunc)0, /* tp_hash */
1808
(ternaryfunc)0, /* tp_call */
1809
(reprfunc)SwigPyObject_str, /* tp_str */
1810
PyObject_GenericGetAttr, /* tp_getattro */
1811
0, /* tp_setattro */
1812
0, /* tp_as_buffer */
1813
Py_TPFLAGS_DEFAULT, /* tp_flags */
1814
swigobject_doc, /* tp_doc */
1815
0, /* tp_traverse */
1817
(richcmpfunc)SwigPyObject_richcompare, /* tp_richcompare */
1818
0, /* tp_weaklistoffset */
1917
(reprfunc)SwigPyObject_repr, /* tp_repr */
1918
&SwigPyObject_as_number, /* tp_as_number */
1919
0, /* tp_as_sequence */
1920
0, /* tp_as_mapping */
1921
(hashfunc)0, /* tp_hash */
1922
(ternaryfunc)0, /* tp_call */
1923
(reprfunc)SwigPyObject_str, /* tp_str */
1924
PyObject_GenericGetAttr, /* tp_getattro */
1925
0, /* tp_setattro */
1926
0, /* tp_as_buffer */
1927
Py_TPFLAGS_DEFAULT, /* tp_flags */
1928
swigobject_doc, /* tp_doc */
1929
0, /* tp_traverse */
1931
(richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */
1932
0, /* tp_weaklistoffset */
1819
1933
#if PY_VERSION_HEX >= 0x02020000
1821
0, /* tp_iternext */
1822
swigobject_methods, /* tp_methods */
1827
0, /* tp_descr_get */
1828
0, /* tp_descr_set */
1829
0, /* tp_dictoffset */
1838
0, /* tp_subclasses */
1839
0, /* tp_weaklist */
1935
0, /* tp_iternext */
1936
swigobject_methods, /* tp_methods */
1941
0, /* tp_descr_get */
1942
0, /* tp_descr_set */
1943
0, /* tp_dictoffset */
1952
0, /* tp_subclasses */
1953
0, /* tp_weaklist */
1841
1955
#if PY_VERSION_HEX >= 0x02030000
1958
#if PY_VERSION_HEX >= 0x02060000
1844
1961
#ifdef COUNT_ALLOCS
1845
0,0,0,0 /* tp_alloc -> tp_next */
1962
0,0,0,0 /* tp_alloc -> tp_next */
1848
1965
swigpyobject_type = tmp;
1849
/* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */
1850
#if PY_VERSION_HEX < 0x03000000
1967
#if PY_VERSION_HEX < 0x02020000
1851
1968
swigpyobject_type.ob_type = &PyType_Type;
1970
if (PyType_Ready(&swigpyobject_type) < 0)
1855
1974
return &swigpyobject_type;
1951
2070
SWIGRUNTIME PyTypeObject*
1952
_PySwigPacked_type(void) {
2071
SwigPyPacked_TypeOnce(void) {
1953
2072
static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
1954
2073
static PyTypeObject swigpypacked_type;
1955
static int type_init = 0;
2074
static int type_init = 0;
1956
2075
if (!type_init) {
1957
const PyTypeObject tmp
1959
/* PyObject header changed in Python 3 */
1960
#if PY_VERSION_HEX>=0x03000000
1961
PyVarObject_HEAD_INIT(&PyType_Type, 0)
1963
PyObject_HEAD_INIT(NULL)
1966
(char *)"SwigPyPacked", /* tp_name */
1967
sizeof(SwigPyPacked), /* tp_basicsize */
1968
0, /* tp_itemsize */
1969
(destructor)SwigPyPacked_dealloc, /* tp_dealloc */
1970
(printfunc)SwigPyPacked_print, /* tp_print */
1971
(getattrfunc)0, /* tp_getattr */
1972
(setattrfunc)0, /* tp_setattr */
1973
#if PY_VERSION_HEX>=0x03000000
1974
0, /* tp_reserved in 3.0.1 */
1976
(cmpfunc)SwigPyPacked_compare, /* tp_compare */
1978
(reprfunc)SwigPyPacked_repr, /* tp_repr */
1979
0, /* tp_as_number */
1980
0, /* tp_as_sequence */
1981
0, /* tp_as_mapping */
1982
(hashfunc)0, /* tp_hash */
1983
(ternaryfunc)0, /* tp_call */
1984
(reprfunc)SwigPyPacked_str, /* tp_str */
1985
PyObject_GenericGetAttr, /* tp_getattro */
1986
0, /* tp_setattro */
1987
0, /* tp_as_buffer */
1988
Py_TPFLAGS_DEFAULT, /* tp_flags */
1989
swigpacked_doc, /* tp_doc */
1990
0, /* tp_traverse */
1992
0, /* tp_richcompare */
1993
0, /* tp_weaklistoffset */
2076
const PyTypeObject tmp = {
2077
/* PyObject header changed in Python 3 */
2078
#if PY_VERSION_HEX>=0x03000000
2079
PyVarObject_HEAD_INIT(NULL, 0)
2081
PyObject_HEAD_INIT(NULL)
2084
(char *)"SwigPyPacked", /* tp_name */
2085
sizeof(SwigPyPacked), /* tp_basicsize */
2086
0, /* tp_itemsize */
2087
(destructor)SwigPyPacked_dealloc, /* tp_dealloc */
2088
(printfunc)SwigPyPacked_print, /* tp_print */
2089
(getattrfunc)0, /* tp_getattr */
2090
(setattrfunc)0, /* tp_setattr */
2091
#if PY_VERSION_HEX>=0x03000000
2092
0, /* tp_reserved in 3.0.1 */
2094
(cmpfunc)SwigPyPacked_compare, /* tp_compare */
2096
(reprfunc)SwigPyPacked_repr, /* tp_repr */
2097
0, /* tp_as_number */
2098
0, /* tp_as_sequence */
2099
0, /* tp_as_mapping */
2100
(hashfunc)0, /* tp_hash */
2101
(ternaryfunc)0, /* tp_call */
2102
(reprfunc)SwigPyPacked_str, /* tp_str */
2103
PyObject_GenericGetAttr, /* tp_getattro */
2104
0, /* tp_setattro */
2105
0, /* tp_as_buffer */
2106
Py_TPFLAGS_DEFAULT, /* tp_flags */
2107
swigpacked_doc, /* tp_doc */
2108
0, /* tp_traverse */
2110
0, /* tp_richcompare */
2111
0, /* tp_weaklistoffset */
1994
2112
#if PY_VERSION_HEX >= 0x02020000
1996
0, /* tp_iternext */
2002
0, /* tp_descr_get */
2003
0, /* tp_descr_set */
2004
0, /* tp_dictoffset */
2013
0, /* tp_subclasses */
2014
0, /* tp_weaklist */
2114
0, /* tp_iternext */
2120
0, /* tp_descr_get */
2121
0, /* tp_descr_set */
2122
0, /* tp_dictoffset */
2131
0, /* tp_subclasses */
2132
0, /* tp_weaklist */
2016
2134
#if PY_VERSION_HEX >= 0x02030000
2137
#if PY_VERSION_HEX >= 0x02060000
2019
2140
#ifdef COUNT_ALLOCS
2020
0,0,0,0 /* tp_alloc -> tp_next */
2141
0,0,0,0 /* tp_alloc -> tp_next */
2023
2144
swigpypacked_type = tmp;
2024
/* for Python 3 the ob_type already assigned in PyVarObject_HEAD_INIT() */
2025
#if PY_VERSION_HEX < 0x03000000
2146
#if PY_VERSION_HEX < 0x02020000
2026
2147
swigpypacked_type.ob_type = &PyType_Type;
2149
if (PyType_Ready(&swigpypacked_type) < 0)
2030
2153
return &swigpypacked_type;
2089
2215
SWIGRUNTIME SwigPyObject *
2090
2216
SWIG_Python_GetSwigThis(PyObject *pyobj)
2092
if (SwigPyObject_Check(pyobj)) {
2220
if (SwigPyObject_Check(pyobj))
2093
2221
return (SwigPyObject *) pyobj;
2223
#ifdef SWIGPYTHON_BUILTIN
2225
# ifdef PyWeakref_CheckProxy
2226
if (PyWeakref_CheckProxy(pyobj)) {
2227
pyobj = PyWeakref_GET_OBJECT(pyobj);
2228
if (pyobj && SwigPyObject_Check(pyobj))
2229
return (SwigPyObject*) pyobj;
2096
2237
#if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000))
2097
if (PyInstance_Check(pyobj)) {
2098
obj = _PyInstance_Lookup(pyobj, SWIG_This());
2238
if (PyInstance_Check(pyobj)) {
2239
obj = _PyInstance_Lookup(pyobj, SWIG_This());
2241
PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
2242
if (dictptr != NULL) {
2243
PyObject *dict = *dictptr;
2244
obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
2100
PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
2101
if (dictptr != NULL) {
2102
PyObject *dict = *dictptr;
2103
obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
2105
2246
#ifdef PyWeakref_CheckProxy
2106
if (PyWeakref_CheckProxy(pyobj)) {
2107
PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
2108
return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
2247
if (PyWeakref_CheckProxy(pyobj)) {
2248
PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
2249
return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
2111
obj = PyObject_GetAttr(pyobj,SWIG_This());
2115
if (PyErr_Occurred()) PyErr_Clear();
2252
obj = PyObject_GetAttr(pyobj,SWIG_This());
2256
if (PyErr_Occurred()) PyErr_Clear();
2121
obj = PyObject_GetAttr(pyobj,SWIG_This());
2125
if (PyErr_Occurred()) PyErr_Clear();
2129
if (obj && !SwigPyObject_Check(obj)) {
2130
/* a PyObject is called 'this', try to get the 'real this'
2131
SwigPyObject from it */
2132
return SWIG_Python_GetSwigThis(obj);
2134
return (SwigPyObject *)obj;
2262
obj = PyObject_GetAttr(pyobj,SWIG_This());
2266
if (PyErr_Occurred()) PyErr_Clear();
2270
if (obj && !SwigPyObject_Check(obj)) {
2271
/* a PyObject is called 'this', try to get the 'real this'
2272
SwigPyObject from it */
2273
return SWIG_Python_GetSwigThis(obj);
2275
return (SwigPyObject *)obj;
2138
2279
/* Acquire a pointer value */
2155
2296
SWIGRUNTIME int
2156
2297
SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
2157
if (!obj) return SWIG_ERROR;
2158
2303
if (obj == Py_None) {
2160
2306
return SWIG_OK;
2162
SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
2311
sobj = SWIG_Python_GetSwigThis(obj);
2315
void *vptr = sobj->ptr;
2317
swig_type_info *to = sobj->ty;
2319
/* no type cast needed */
2320
if (ptr) *ptr = vptr;
2323
swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2325
sobj = (SwigPyObject *)sobj->next;
2329
*ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2330
if (newmemory == SWIG_CAST_NEW_MEMORY) {
2331
assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
2333
*own = *own | SWIG_CAST_NEW_MEMORY;
2340
if (ptr) *ptr = vptr;
2166
void *vptr = sobj->ptr;
2168
swig_type_info *to = sobj->ty;
2170
/* no type cast needed */
2171
if (ptr) *ptr = vptr;
2174
swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2176
sobj = (SwigPyObject *)sobj->next;
2180
*ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2181
if (newmemory == SWIG_CAST_NEW_MEMORY) {
2184
*own = *own | SWIG_CAST_NEW_MEMORY;
2346
*own = *own | sobj->own;
2347
if (flags & SWIG_POINTER_DISOWN) {
2352
if (flags & SWIG_POINTER_IMPLICIT_CONV) {
2353
SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
2354
if (data && !data->implicitconv) {
2355
PyObject *klass = data->klass;
2358
data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
2359
impconv = SWIG_Python_CallFunctor(klass, obj);
2360
data->implicitconv = 0;
2361
if (PyErr_Occurred()) {
2366
SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
2369
res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
2370
if (SWIG_IsOK(res)) {
2373
/* transfer the ownership to 'ptr' */
2375
res = SWIG_AddCast(res);
2376
res = SWIG_AddNewMask(res);
2378
res = SWIG_AddCast(res);
2191
if (ptr) *ptr = vptr;
2197
*own = *own | sobj->own;
2198
if (flags & SWIG_POINTER_DISOWN) {
2203
int res = SWIG_ERROR;
2204
if (flags & SWIG_POINTER_IMPLICIT_CONV) {
2205
SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
2206
if (data && !data->implicitconv) {
2207
PyObject *klass = data->klass;
2210
data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
2211
impconv = SWIG_Python_CallFunctor(klass, obj);
2212
data->implicitconv = 0;
2213
if (PyErr_Occurred()) {
2218
SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
2221
res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
2222
if (SWIG_IsOK(res)) {
2225
/* transfer the ownership to 'ptr' */
2227
res = SWIG_AddCast(res);
2228
res = SWIG_AddNewMask(res);
2230
res = SWIG_AddCast(res);
2244
2391
/* Convert a function ptr value */
2408
2555
/* Create a new pointer object */
2410
2557
SWIGRUNTIME PyObject *
2411
SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) {
2558
SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) {
2559
SwigPyClientData *clientdata;
2413
2564
return SWIG_Py_Void();
2415
int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
2416
PyObject *robj = SwigPyObject_New(ptr, type, own);
2417
SwigPyClientData *clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
2418
if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
2419
PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
2566
clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
2567
own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
2568
if (clientdata && clientdata->pytype) {
2569
SwigPyObject *newobj;
2570
if (flags & SWIG_BUILTIN_TP_INIT) {
2571
newobj = (SwigPyObject*) self;
2573
PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0);
2574
while (newobj->next)
2575
newobj = (SwigPyObject *) newobj->next;
2576
newobj->next = next_self;
2577
newobj = (SwigPyObject *)next_self;
2580
newobj = PyObject_New(SwigPyObject, clientdata->pytype);
2587
#ifdef SWIGPYTHON_BUILTIN
2590
return (PyObject*) newobj;
2592
return SWIG_Py_Void();
2595
assert(!(flags & SWIG_BUILTIN_TP_INIT));
2597
robj = SwigPyObject_New(ptr, type, own);
2598
if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
2599
PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
2429
2608
/* Create a new packed object */
2508
2699
Py_DECREF(SWIG_This());
2511
2703
SWIGRUNTIME void
2512
2704
SWIG_Python_SetModule(swig_module_info *swig_module) {
2513
static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */
2515
2705
#if PY_VERSION_HEX >= 0x03000000
2516
2706
/* Add a dummy module object into sys.modules */
2517
2707
PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION);
2519
PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
2520
swig_empty_runtime_method_table);
2709
static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */
2710
PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table);
2712
#ifdef SWIGPY_USE_CAPSULE
2713
PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule);
2714
if (pointer && module) {
2715
PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer);
2717
Py_XDECREF(pointer);
2522
2720
PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
2523
2721
if (pointer && module) {
2524
2722
PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
2526
2724
Py_XDECREF(pointer);
2530
2729
/* The python cached type query */
2542
2741
PyObject *obj = PyDict_GetItem(cache, key);
2543
2742
swig_type_info *descriptor;
2744
#ifdef SWIGPY_USE_CAPSULE
2745
descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL);
2545
2747
descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
2547
2750
swig_module_info *swig_module = SWIG_Python_GetModule();
2548
2751
descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
2549
2752
if (descriptor) {
2753
#ifdef SWIGPY_USE_CAPSULE
2754
obj = PyCapsule_New((void*) descriptor, NULL, NULL);
2550
2756
obj = PyCObject_FromVoidPtr(descriptor, NULL);
2551
2758
PyDict_SetItem(cache, key, obj);
2552
2759
Py_DECREF(obj);
2876
SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
2877
PyTypeObject *tp = obj->ob_type;
2879
PyObject *encoded_name;
2883
#ifdef Py_USING_UNICODE
2884
if (PyString_Check(name)) {
2885
name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL);
2888
} else if (!PyUnicode_Check(name))
2890
if (!PyString_Check(name))
2893
PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name);
2900
if (PyType_Ready(tp) < 0)
2905
descr = _PyType_Lookup(tp, name);
2908
f = descr->ob_type->tp_descr_set;
2910
if (PyString_Check(name)) {
2911
encoded_name = name;
2914
encoded_name = PyUnicode_AsUTF8String(name);
2916
PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
2917
Py_DECREF(encoded_name);
2919
res = f(descr, obj, value);
2669
2928
#ifdef __cplusplus
3541
3797
swig_varlink_type(void) {
3542
3798
static char varlink__doc__[] = "Swig var link object";
3543
3799
static PyTypeObject varlink_type;
3544
static int type_init = 0;
3800
static int type_init = 0;
3545
3801
if (!type_init) {
3546
const PyTypeObject tmp
3802
const PyTypeObject tmp = {
3548
3803
/* PyObject header changed in Python 3 */
3549
3804
#if PY_VERSION_HEX >= 0x03000000
3550
PyVarObject_HEAD_INIT(&PyType_Type, 0)
3805
PyVarObject_HEAD_INIT(NULL, 0)
3552
3807
PyObject_HEAD_INIT(NULL)
3553
0, /* Number of items in variable part (ob_size) */
3555
(char *)"swigvarlink", /* Type name (tp_name) */
3556
sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */
3557
0, /* Itemsize (tp_itemsize) */
3558
(destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */
3559
(printfunc) swig_varlink_print, /* Print (tp_print) */
3560
(getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */
3561
(setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */
3810
(char *)"swigvarlink", /* tp_name */
3811
sizeof(swig_varlinkobject), /* tp_basicsize */
3812
0, /* tp_itemsize */
3813
(destructor) swig_varlink_dealloc, /* tp_dealloc */
3814
(printfunc) swig_varlink_print, /* tp_print */
3815
(getattrfunc) swig_varlink_getattr, /* tp_getattr */
3816
(setattrfunc) swig_varlink_setattr, /* tp_setattr */
3562
3817
0, /* tp_compare */
3563
3818
(reprfunc) swig_varlink_repr, /* tp_repr */
3564
3819
0, /* tp_as_number */
3685
size_t shift = (ci->ptype) - types;
3686
swig_type_info *ty = types_initial[shift];
3687
size_t ldoc = (c - methods[i].ml_doc);
3688
size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
3689
char *ndoc = (char*)malloc(ldoc + lptr + 10);
3692
void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
3945
void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
3947
size_t shift = (ci->ptype) - types;
3948
swig_type_info *ty = types_initial[shift];
3949
size_t ldoc = (c - methods[i].ml_doc);
3950
size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
3951
char *ndoc = (char*)malloc(ldoc + lptr + 10);
3694
3954
strncpy(buff, methods[i].ml_doc, ldoc);
3696
3956
strncpy(buff, "swig_ptr: ", 10);
4010
#if defined(SWIGPYTHON_BUILTIN)
4011
static SwigPyClientData SwigPyObject_clientdata = {
4014
static PyGetSetDef this_getset_def = {
4015
(char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
4017
static SwigPyGetSet thisown_getset_closure = {
4018
(PyCFunction) SwigPyObject_own,
4019
(PyCFunction) SwigPyObject_own
4021
static PyGetSetDef thisown_getset_def = {
4022
(char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
4024
PyObject *metatype_args;
4025
PyTypeObject *builtin_pytype;
4026
int builtin_base_count;
4027
swig_type_info *builtin_basetype;
4029
PyGetSetDescrObject *static_getset;
4030
PyTypeObject *metatype;
4031
SwigPyClientData *cd;
4032
PyObject *public_interface, *public_symbol;
4033
PyObject *this_descr;
4034
PyObject *thisown_descr;
4037
(void)builtin_pytype;
4038
(void)builtin_base_count;
4039
(void)builtin_basetype;
4041
(void)static_getset;
4043
/* metatype is used to implement static member variables. */
4044
metatype_args = Py_BuildValue("(s(O){})", "SwigPyObjectType", &PyType_Type);
4045
assert(metatype_args);
4046
metatype = (PyTypeObject *) PyType_Type.tp_call((PyObject *) &PyType_Type, metatype_args, NULL);
4048
Py_DECREF(metatype_args);
4049
metatype->tp_setattro = (setattrofunc) &SwigPyObjectType_setattro;
4050
assert(PyType_Ready(metatype) >= 0);
3741
4053
/* Fix SwigMethods to carry the callback ptrs when needed */
3742
4054
SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
3747
4059
m = Py_InitModule((char *) SWIG_name, SwigMethods);
3749
d = PyModule_GetDict(m);
4061
md = d = PyModule_GetDict(m);
3751
4063
SWIG_InitializeModule(0);
4065
#ifdef SWIGPYTHON_BUILTIN
4066
SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject");
4067
assert(SwigPyObject_stype);
4068
cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
4070
SwigPyObject_stype->clientdata = &SwigPyObject_clientdata;
4071
SwigPyObject_clientdata.pytype = SwigPyObject_TypeOnce();
4072
} else if (SwigPyObject_TypeOnce()->tp_basicsize != cd->pytype->tp_basicsize) {
4073
PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules.");
4074
# if PY_VERSION_HEX >= 0x03000000
4081
/* All objects have a 'this' attribute */
4082
this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def);
4085
/* All objects have a 'thisown' attribute */
4086
thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def);
4087
(void)thisown_descr;
4089
public_interface = PyList_New(0);
4091
(void)public_symbol;
4093
PyDict_SetItemString(md, "__all__", public_interface);
4094
Py_DECREF(public_interface);
4095
for (i = 0; SwigMethods[i].ml_name != NULL; ++i)
4096
SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name);
4097
for (i = 0; swig_const_table[i].name != 0; ++i)
4098
SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name);
3752
4101
SWIG_InstallConstants(d,swig_const_table);
3755
4103
SWIG_Python_SetConstant(d, "VDisplay_BARCO",SWIG_From_int(static_cast< int >(vips::VDisplay::BARCO)));
3756
4104
SWIG_Python_SetConstant(d, "VDisplay_DUMB",SWIG_From_int(static_cast< int >(vips::VDisplay::DUMB)));
3757
4105
#if PY_VERSION_HEX >= 0x03000000