From deb58b818d8b6e106533ac6b64bb1ce60086de8a Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Thu, 6 May 2010 20:43:44 +0000 Subject: [PATCH] stuff --- TODO | 41 + swig/python/vdisplaymodule.cpp | 783 ++++++--- swig/python/verrormodule.cpp | 797 ++++++--- swig/python/vimagemodule.cpp | 2754 +++++++++++++++++++++++--------- swig/python/vipsCC/VDisplay.py | 44 +- swig/python/vipsCC/VError.py | 56 +- swig/python/vipsCC/VImage.py | 963 ++++++----- swig/python/vipsCC/VMask.py | 122 +- swig/python/vmaskmodule.cpp | 987 ++++++++---- 9 files changed, 4451 insertions(+), 2096 deletions(-) diff --git a/TODO b/TODO index 9433e45b..4f82de94 100644 --- a/TODO +++ b/TODO @@ -13,6 +13,47 @@ python setup.py build python setup.py install +now we get: + +>>> from vipsCC import * +Traceback (most recent call last): + File "", line 1, in + File "/usr/local/lib/python2.6/dist-packages/vipsCC/VImage.py", line 25, in + + vimagemodule = swig_import_helper() + File "/usr/local/lib/python2.6/dist-packages/vipsCC/VImage.py", line 21, in +swig_import_helper + _mod = imp.load_module('vimagemodule', fp, pathname, description) +ImportError: /usr/local/lib/python2.6/dist-packages/vipsCC/vimagemodule.so: +undefined symbol: _ZTIN4vips5VMaskE + +ie. vimagemodule.so can't find libvipsCC.so I guess? or perhaps the compiler +is being given a differnt mangling flag + +we're building with: + +gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall +-Wstrict-prototypes -fPIC -DDEBUG_FATAL=1 -DDEBUG_LEAK=1 +-I/usr/lib/glib-2.0/include -I/usr/include/pango-1.0 -I/usr/include/libxml2 +-I/usr/include/libpng12 -I/usr/include/libexif -I/usr/include/glib-2.0 +-I/usr/include/freetype2 -I/usr/include/OpenEXR -I/usr/include/ImageMagick +-I../../libvips/include -I../../libvipsCC/include -I/usr/include/python2.6 -c +vimagemodule.cpp -o build/temp.linux-x86_64-2.6/vimagemodule.o -pthread +-fopenmp -pthread -Wl,--export-dynamic -pthread -pthread -pthread + +g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions +build/temp.linux-x86_64-2.6/vimagemodule.o -Wl,-R/home/john/vips/lib +-lMagickWand -lMagickCore -lpng12 -ltiff -lz -ljpeg -lgthread-2.0 -lrt +-lglib-2.0 -lgmodule-2.0 -lxml2 -lgobject-2.0 -lgthread-2.0 -lrt -lglib-2.0 +-lpangoft2-1.0 -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 +-lgthread-2.0 -lrt -lglib-2.0 -lfftw3 -lm -llcms -lIlmImf -lz -lImath -lHalf +-lIex -lIlmThread -lmatio -lz -lexif -lm -lstdc++ -lm -o +build/lib.linux-x86_64-2.6/vipsCC/vimagemodule.so -pthread -fopenmp -pthread +-Wl,--export-dynamic -pthread -pthread -pthread + +how does this compare to the working build? + + - the tiff writer could use more im_check_ things diff --git a/swig/python/vdisplaymodule.cpp b/swig/python/vdisplaymodule.cpp index a66d642c..b24f9fd6 100644 --- a/swig/python/vdisplaymodule.cpp +++ b/swig/python/vdisplaymodule.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.36 + * Version 1.3.40 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -11,19 +11,23 @@ #define SWIGPYTHON #define SWIG_PYTHON_DIRECTOR_NO_VTABLE + #ifdef __cplusplus +/* SwigValueWrapper is described in swig.swg */ template class SwigValueWrapper { - T *tt; + struct SwigMovePointer { + T *ptr; + SwigMovePointer(T *p) : ptr(p) { } + ~SwigMovePointer() { delete ptr; } + SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper(const SwigValueWrapper& rhs); public: - SwigValueWrapper() : tt(0) { } - SwigValueWrapper(const SwigValueWrapper& rhs) : tt(new T(*rhs.tt)) { } - SwigValueWrapper(const T& t) : tt(new T(t)) { } - ~SwigValueWrapper() { delete tt; } - SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; } - operator T&() const { return *tt; } - T *operator&() { return tt; } -private: - SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper() : pointer(0) { } + SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } + operator T&() const { return *pointer.ptr; } + T *operator&() { return pointer.ptr; } }; template T SwigValueInit() { @@ -147,7 +151,7 @@ template T SwigValueInit() { /* ----------------------------------------------------------------------------- * swigrun.swg * - * This file contains generic CAPI SWIG runtime support for pointer + * This file contains generic C API SWIG runtime support for pointer * type checking. * ----------------------------------------------------------------------------- */ @@ -166,11 +170,11 @@ template T SwigValueInit() { /* You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for - creating a static or dynamic library from the swig runtime code. - In 99.9% of the cases, swig just needs to declare them as 'static'. + creating a static or dynamic library from the SWIG runtime code. + In 99.9% of the cases, SWIG just needs to declare them as 'static'. - But only do this if is strictly necessary, ie, if you have problems - with your compiler or so. + But only do this if strictly necessary, ie, if you have problems + with your compiler or suchlike. */ #ifndef SWIGRUNTIME @@ -197,14 +201,14 @@ template T SwigValueInit() { /* Flags/methods for returning states. - The swig conversion methods, as ConvertPtr, return and integer + The SWIG conversion methods, as ConvertPtr, return and integer that tells if the conversion was successful or not. And if not, an error code can be returned (see swigerrors.swg for the codes). Use the following macros/flags to set or process the returning states. - In old swig versions, you usually write code as: + In old versions of SWIG, code such as the following was usually written: if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { // success code @@ -212,7 +216,7 @@ template T SwigValueInit() { //fail code } - Now you can be more explicit as: + Now you can be more explicit: int res = SWIG_ConvertPtr(obj,vptr,ty.flags); if (SWIG_IsOK(res)) { @@ -221,7 +225,7 @@ template T SwigValueInit() { // fail code } - that seems to be the same, but now you can also do + which is the same really, but now you can also do Type *ptr; int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); @@ -239,7 +243,7 @@ template T SwigValueInit() { I.e., now SWIG_ConvertPtr can return new objects and you can identify the case and take care of the deallocation. Of course that - requires also to SWIG_ConvertPtr to return new result values, as + also requires SWIG_ConvertPtr to return new result values, such as int SWIG_ConvertPtr(obj, ptr,...) { if () { @@ -257,7 +261,7 @@ template T SwigValueInit() { Of course, returning the plain '0(success)/-1(fail)' still works, but you can be more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the - swig errors code. + SWIG errors code. Finally, if the SWIG_CASTRANK_MODE is enabled, the result code allows to return the 'cast rank', for example, if you have this @@ -271,9 +275,8 @@ template T SwigValueInit() { fooi(1) // cast rank '0' just use the SWIG_AddCast()/SWIG_CheckState() +*/ - - */ #define SWIG_OK (0) #define SWIG_ERROR (-1) #define SWIG_IsOK(r) (r >= 0) @@ -298,7 +301,6 @@ template T SwigValueInit() { #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) - /* Cast-Rank Mode */ #if defined(SWIG_CASTRANK_MODE) # ifndef SWIG_TypeRank @@ -321,8 +323,6 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) { #endif - - #include #ifdef __cplusplus @@ -419,40 +419,58 @@ SWIG_TypeCompare(const char *nb, const char *tb) { } -/* think of this as a c++ template<> or a scheme macro */ -#define SWIG_TypeCheck_Template(comparison, ty) \ - if (ty) { \ - swig_cast_info *iter = ty->cast; \ - while (iter) { \ - if (comparison) { \ - if (iter == ty->cast) return iter; \ - /* Move iter to the top of the linked list */ \ - iter->prev->next = iter->next; \ - if (iter->next) \ - iter->next->prev = iter->prev; \ - iter->next = ty->cast; \ - iter->prev = 0; \ - if (ty->cast) ty->cast->prev = iter; \ - ty->cast = iter; \ - return iter; \ - } \ - iter = iter->next; \ - } \ - } \ - return 0 - /* Check the typename */ SWIGRUNTIME swig_cast_info * SWIG_TypeCheck(const char *c, swig_type_info *ty) { - SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty); + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (strcmp(iter->type->name, c) == 0) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; } -/* Same as previous function, except strcmp is replaced with a pointer comparison */ +/* + Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison +*/ SWIGRUNTIME swig_cast_info * -SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { - SWIG_TypeCheck_Template(iter->type == from, into); +SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (iter->type == from) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; } /* @@ -731,6 +749,67 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { +/* Compatibility macros for Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 + +#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) +#define PyInt_Check(x) PyLong_Check(x) +#define PyInt_AsLong(x) PyLong_AsLong(x) +#define PyInt_FromLong(x) PyLong_FromLong(x) +#define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) + +#endif + +#ifndef Py_TYPE +# define Py_TYPE(op) ((op)->ob_type) +#endif + +/* SWIG APIs for compatibility of both Python 2 & 3 */ + +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_Python_str_FromFormat PyUnicode_FromFormat +#else +# define SWIG_Python_str_FromFormat PyString_FromFormat +#endif + + +/* Warning: This function will allocate a new string in Python 3, + * so please call SWIG_Python_str_DelForPy3(x) to free the space. + */ +SWIGINTERN char* +SWIG_Python_str_AsChar(PyObject *str) +{ +#if PY_VERSION_HEX >= 0x03000000 + char *cstr; + char *newstr; + Py_ssize_t len; + str = PyUnicode_AsUTF8String(str); + PyBytes_AsStringAndSize(str, &cstr, &len); + newstr = (char *) malloc(len+1); + memcpy(newstr, cstr, len+1); + Py_XDECREF(str); + return newstr; +#else + return PyString_AsString(str); +#endif +} + +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_Python_str_DelForPy3(x) free( (void*) (x) ) +#else +# define SWIG_Python_str_DelForPy3(x) +#endif + + +SWIGINTERN PyObject* +SWIG_Python_str_FromChar(const char *c) +{ +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_FromString(c); +#else + return PyString_FromString(c); +#endif +} /* Add PyOS_snprintf for old Pythons */ #if PY_VERSION_HEX < 0x02020000 @@ -777,6 +856,7 @@ PyString_FromFormat(const char *fmt, ...) { # define PyObject_GenericGetAttr 0 # endif #endif + /* Py_NotImplemented is defined in 2.1 and up. */ #if PY_VERSION_HEX < 0x02010000 # ifndef Py_NotImplemented @@ -784,7 +864,6 @@ PyString_FromFormat(const char *fmt, ...) { # endif #endif - /* A crude PyString_AsStringAndSize implementation for old Pythons */ #if PY_VERSION_HEX < 0x02010000 # ifndef PyString_AsStringAndSize @@ -799,7 +878,6 @@ PyString_FromFormat(const char *fmt, ...) { # endif #endif - /* PyBool_FromLong for old Pythons */ #if PY_VERSION_HEX < 0x02030000 static @@ -877,10 +955,13 @@ SWIG_Python_AddErrorMsg(const char* mesg) if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback); if (value) { + char *tmp; PyObject *old_str = PyObject_Str(value); PyErr_Clear(); Py_XINCREF(type); - PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg); + + PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); + SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); Py_DECREF(value); } else { @@ -888,8 +969,6 @@ SWIG_Python_AddErrorMsg(const char* mesg) } } - - #if defined(SWIG_PYTHON_NO_THREADS) # if defined(SWIG_PYTHON_THREADS) # undef SWIG_PYTHON_THREADS @@ -986,6 +1065,20 @@ typedef struct swig_const_info { swig_type_info **ptype; } swig_const_info; + +/* ----------------------------------------------------------------------------- + * Wrapper of PyInstanceMethod_New() used in Python 3 + * It is exported to the generated module, used for -fastproxy + * ----------------------------------------------------------------------------- */ +SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *self, PyObject *func) +{ +#if PY_VERSION_HEX >= 0x03000000 + return PyInstanceMethod_New(func); +#else + return NULL; +#endif +} + #ifdef __cplusplus #if 0 { /* cc-mode */ @@ -1038,7 +1131,7 @@ typedef struct swig_const_info { #define SWIG_GetModule(clientdata) SWIG_Python_GetModule() #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) -#define SWIG_NewClientData(obj) PySwigClientData_New(obj) +#define SWIG_NewClientData(obj) SwigPyClientData_New(obj) #define SWIG_SetErrorObj SWIG_Python_SetErrorObj #define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg @@ -1234,7 +1327,7 @@ SWIG_Py_Void(void) return none; } -/* PySwigClientData */ +/* SwigPyClientData */ typedef struct { PyObject *klass; @@ -1243,30 +1336,30 @@ typedef struct { PyObject *destroy; int delargs; int implicitconv; -} PySwigClientData; +} SwigPyClientData; SWIGRUNTIMEINLINE int SWIG_Python_CheckImplicit(swig_type_info *ty) { - PySwigClientData *data = (PySwigClientData *)ty->clientdata; + SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; return data ? data->implicitconv : 0; } SWIGRUNTIMEINLINE PyObject * SWIG_Python_ExceptionType(swig_type_info *desc) { - PySwigClientData *data = desc ? (PySwigClientData *) desc->clientdata : 0; + SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0; PyObject *klass = data ? data->klass : 0; return (klass ? klass : PyExc_RuntimeError); } -SWIGRUNTIME PySwigClientData * -PySwigClientData_New(PyObject* obj) +SWIGRUNTIME SwigPyClientData * +SwigPyClientData_New(PyObject* obj) { if (!obj) { return 0; } else { - PySwigClientData *data = (PySwigClientData *)malloc(sizeof(PySwigClientData)); + SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData)); /* the klass element */ data->klass = obj; Py_INCREF(data->klass); @@ -1314,14 +1407,14 @@ PySwigClientData_New(PyObject* obj) } SWIGRUNTIME void -PySwigClientData_Del(PySwigClientData* data) +SwigPyClientData_Del(SwigPyClientData* data) { Py_XDECREF(data->newraw); Py_XDECREF(data->newargs); Py_XDECREF(data->destroy); } -/* =============== PySwigObject =====================*/ +/* =============== SwigPyObject =====================*/ typedef struct { PyObject_HEAD @@ -1329,24 +1422,28 @@ typedef struct { swig_type_info *ty; int own; PyObject *next; -} PySwigObject; +} SwigPyObject; SWIGRUNTIME PyObject * -PySwigObject_long(PySwigObject *v) +SwigPyObject_long(SwigPyObject *v) { return PyLong_FromVoidPtr(v->ptr); } SWIGRUNTIME PyObject * -PySwigObject_format(const char* fmt, PySwigObject *v) +SwigPyObject_format(const char* fmt, SwigPyObject *v) { PyObject *res = NULL; PyObject *args = PyTuple_New(1); if (args) { - if (PyTuple_SetItem(args, 0, PySwigObject_long(v)) == 0) { - PyObject *ofmt = PyString_FromString(fmt); + if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) { + PyObject *ofmt = SWIG_Python_str_FromChar(fmt); if (ofmt) { +#if PY_VERSION_HEX >= 0x03000000 + res = PyUnicode_Format(ofmt,args); +#else res = PyString_Format(ofmt,args); +#endif Py_DECREF(ofmt); } Py_DECREF(args); @@ -1356,49 +1453,57 @@ PySwigObject_format(const char* fmt, PySwigObject *v) } SWIGRUNTIME PyObject * -PySwigObject_oct(PySwigObject *v) +SwigPyObject_oct(SwigPyObject *v) { - return PySwigObject_format("%o",v); + return SwigPyObject_format("%o",v); } SWIGRUNTIME PyObject * -PySwigObject_hex(PySwigObject *v) +SwigPyObject_hex(SwigPyObject *v) { - return PySwigObject_format("%x",v); + return SwigPyObject_format("%x",v); } SWIGRUNTIME PyObject * #ifdef METH_NOARGS -PySwigObject_repr(PySwigObject *v) +SwigPyObject_repr(SwigPyObject *v) #else -PySwigObject_repr(PySwigObject *v, PyObject *args) +SwigPyObject_repr(SwigPyObject *v, PyObject *args) #endif { const char *name = SWIG_TypePrettyName(v->ty); - PyObject *hex = PySwigObject_hex(v); - PyObject *repr = PyString_FromFormat("", name, PyString_AsString(hex)); - Py_DECREF(hex); + PyObject *repr = SWIG_Python_str_FromFormat("", name, v); if (v->next) { #ifdef METH_NOARGS - PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next); + PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); #else - PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next, args); + PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args); #endif +#if PY_VERSION_HEX >= 0x03000000 + PyObject *joined = PyUnicode_Concat(repr, nrep); + Py_DecRef(repr); + Py_DecRef(nrep); + repr = joined; +#else PyString_ConcatAndDel(&repr,nrep); +#endif } return repr; } SWIGRUNTIME int -PySwigObject_print(PySwigObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) +SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { + char *str; #ifdef METH_NOARGS - PyObject *repr = PySwigObject_repr(v); + PyObject *repr = SwigPyObject_repr(v); #else - PyObject *repr = PySwigObject_repr(v, NULL); + PyObject *repr = SwigPyObject_repr(v, NULL); #endif if (repr) { - fputs(PyString_AsString(repr), fp); + str = SWIG_Python_str_AsChar(repr); + fputs(str, fp); + SWIG_Python_str_DelForPy3(str); Py_DECREF(repr); return 0; } else { @@ -1407,53 +1512,71 @@ PySwigObject_print(PySwigObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) } SWIGRUNTIME PyObject * -PySwigObject_str(PySwigObject *v) +SwigPyObject_str(SwigPyObject *v) { char result[SWIG_BUFFER_SIZE]; return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ? - PyString_FromString(result) : 0; + SWIG_Python_str_FromChar(result) : 0; } SWIGRUNTIME int -PySwigObject_compare(PySwigObject *v, PySwigObject *w) +SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) { void *i = v->ptr; void *j = w->ptr; return (i < j) ? -1 : ((i > j) ? 1 : 0); } +/* Added for Python 3.x, would it also be useful for Python 2.x? */ +SWIGRUNTIME PyObject* +SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op) +{ + PyObject* res; + if( op != Py_EQ && op != Py_NE ) { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } + if( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ) + res = Py_True; + else + res = Py_False; + Py_INCREF(res); + return res; +} + + SWIGRUNTIME PyTypeObject* _PySwigObject_type(void); SWIGRUNTIME PyTypeObject* -PySwigObject_type(void) { +SwigPyObject_type(void) { static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type(); return type; } SWIGRUNTIMEINLINE int -PySwigObject_Check(PyObject *op) { - return ((op)->ob_type == PySwigObject_type()) - || (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0); +SwigPyObject_Check(PyObject *op) { + return (Py_TYPE(op) == SwigPyObject_type()) + || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); } SWIGRUNTIME PyObject * -PySwigObject_New(void *ptr, swig_type_info *ty, int own); +SwigPyObject_New(void *ptr, swig_type_info *ty, int own); SWIGRUNTIME void -PySwigObject_dealloc(PyObject *v) +SwigPyObject_dealloc(PyObject *v) { - PySwigObject *sobj = (PySwigObject *) v; + SwigPyObject *sobj = (SwigPyObject *) v; PyObject *next = sobj->next; if (sobj->own == SWIG_POINTER_OWN) { swig_type_info *ty = sobj->ty; - PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0; + SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; PyObject *destroy = data ? data->destroy : 0; if (destroy) { /* destroy is always a VARARGS method */ PyObject *res; if (data->delargs) { - /* we need to create a temporal object to carry the destroy operation */ - PyObject *tmp = PySwigObject_New(sobj->ptr, ty, 0); + /* we need to create a temporary object to carry the destroy operation */ + PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0); res = SWIG_Python_CallFunctor(destroy, tmp); Py_DECREF(tmp); } else { @@ -1475,15 +1598,15 @@ PySwigObject_dealloc(PyObject *v) } SWIGRUNTIME PyObject* -PySwigObject_append(PyObject* v, PyObject* next) +SwigPyObject_append(PyObject* v, PyObject* next) { - PySwigObject *sobj = (PySwigObject *) v; + SwigPyObject *sobj = (SwigPyObject *) v; #ifndef METH_O PyObject *tmp = 0; if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL; next = tmp; #endif - if (!PySwigObject_Check(next)) { + if (!SwigPyObject_Check(next)) { return NULL; } sobj->next = next; @@ -1493,12 +1616,12 @@ PySwigObject_append(PyObject* v, PyObject* next) SWIGRUNTIME PyObject* #ifdef METH_NOARGS -PySwigObject_next(PyObject* v) +SwigPyObject_next(PyObject* v) #else -PySwigObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { - PySwigObject *sobj = (PySwigObject *) v; + SwigPyObject *sobj = (SwigPyObject *) v; if (sobj->next) { Py_INCREF(sobj->next); return sobj->next; @@ -1509,30 +1632,30 @@ PySwigObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) SWIGINTERN PyObject* #ifdef METH_NOARGS -PySwigObject_disown(PyObject *v) +SwigPyObject_disown(PyObject *v) #else -PySwigObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { - PySwigObject *sobj = (PySwigObject *)v; + SwigPyObject *sobj = (SwigPyObject *)v; sobj->own = 0; return SWIG_Py_Void(); } SWIGINTERN PyObject* #ifdef METH_NOARGS -PySwigObject_acquire(PyObject *v) +SwigPyObject_acquire(PyObject *v) #else -PySwigObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { - PySwigObject *sobj = (PySwigObject *)v; + SwigPyObject *sobj = (SwigPyObject *)v; sobj->own = SWIG_POINTER_OWN; return SWIG_Py_Void(); } SWIGINTERN PyObject* -PySwigObject_own(PyObject *v, PyObject *args) +SwigPyObject_own(PyObject *v, PyObject *args) { PyObject *val = 0; #if (PY_VERSION_HEX < 0x02020000) @@ -1545,20 +1668,20 @@ PySwigObject_own(PyObject *v, PyObject *args) } else { - PySwigObject *sobj = (PySwigObject *)v; + SwigPyObject *sobj = (SwigPyObject *)v; PyObject *obj = PyBool_FromLong(sobj->own); if (val) { #ifdef METH_NOARGS if (PyObject_IsTrue(val)) { - PySwigObject_acquire(v); + SwigPyObject_acquire(v); } else { - PySwigObject_disown(v); + SwigPyObject_disown(v); } #else if (PyObject_IsTrue(val)) { - PySwigObject_acquire(v,args); + SwigPyObject_acquire(v,args); } else { - PySwigObject_disown(v,args); + SwigPyObject_disown(v,args); } #endif } @@ -1569,30 +1692,30 @@ PySwigObject_own(PyObject *v, PyObject *args) #ifdef METH_O static PyMethodDef swigobject_methods[] = { - {(char *)"disown", (PyCFunction)PySwigObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)PySwigObject_append, METH_O, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)PySwigObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)PySwigObject_repr, METH_NOARGS, (char *)"returns object representation"}, + {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"}, + {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, + {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"}, + {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, + {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"}, {0, 0, 0, 0} }; #else static PyMethodDef swigobject_methods[] = { - {(char *)"disown", (PyCFunction)PySwigObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)PySwigObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)PySwigObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)PySwigObject_repr, METH_VARARGS, (char *)"returns object representation"}, + {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"}, + {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, + {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, + {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, + {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"}, {0, 0, 0, 0} }; #endif #if PY_VERSION_HEX < 0x02020000 SWIGINTERN PyObject * -PySwigObject_getattr(PySwigObject *sobj,char *name) +SwigPyObject_getattr(SwigPyObject *sobj,char *name) { return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name); } @@ -1602,11 +1725,14 @@ SWIGRUNTIME PyTypeObject* _PySwigObject_type(void) { static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; - static PyNumberMethods PySwigObject_as_number = { + static PyNumberMethods SwigPyObject_as_number = { (binaryfunc)0, /*nb_add*/ (binaryfunc)0, /*nb_subtract*/ (binaryfunc)0, /*nb_multiply*/ + /* nb_divide removed in Python 3 */ +#if PY_VERSION_HEX < 0x03000000 (binaryfunc)0, /*nb_divide*/ +#endif (binaryfunc)0, /*nb_remainder*/ (binaryfunc)0, /*nb_divmod*/ (ternaryfunc)0,/*nb_power*/ @@ -1620,13 +1746,23 @@ _PySwigObject_type(void) { 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ - (coercion)0, /*nb_coerce*/ - (unaryfunc)PySwigObject_long, /*nb_int*/ - (unaryfunc)PySwigObject_long, /*nb_long*/ +#if PY_VERSION_HEX < 0x03000000 + 0, /*nb_coerce*/ +#endif + (unaryfunc)SwigPyObject_long, /*nb_int*/ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc)SwigPyObject_long, /*nb_long*/ +#else + 0, /*nb_reserved*/ +#endif (unaryfunc)0, /*nb_float*/ - (unaryfunc)PySwigObject_oct, /*nb_oct*/ - (unaryfunc)PySwigObject_hex, /*nb_hex*/ -#if PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc)SwigPyObject_oct, /*nb_oct*/ + (unaryfunc)SwigPyObject_hex, /*nb_hex*/ +#endif +#if PY_VERSION_HEX >= 0x03000000 /* 3.0 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ +#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ #elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ @@ -1635,32 +1771,41 @@ _PySwigObject_type(void) { #endif }; - static PyTypeObject pyswigobject_type; + static PyTypeObject swigpyobject_type; static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else PyObject_HEAD_INIT(NULL) 0, /* ob_size */ - (char *)"PySwigObject", /* tp_name */ - sizeof(PySwigObject), /* tp_basicsize */ +#endif + (char *)"SwigPyObject", /* tp_name */ + sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ - (destructor)PySwigObject_dealloc, /* tp_dealloc */ - (printfunc)PySwigObject_print, /* tp_print */ + (destructor)SwigPyObject_dealloc, /* tp_dealloc */ + (printfunc)SwigPyObject_print, /* tp_print */ #if PY_VERSION_HEX < 0x02020000 - (getattrfunc)PySwigObject_getattr, /* tp_getattr */ + (getattrfunc)SwigPyObject_getattr, /* tp_getattr */ #else (getattrfunc)0, /* tp_getattr */ #endif (setattrfunc)0, /* tp_setattr */ - (cmpfunc)PySwigObject_compare, /* tp_compare */ - (reprfunc)PySwigObject_repr, /* tp_repr */ - &PySwigObject_as_number, /* tp_as_number */ +#if PY_VERSION_HEX >= 0x03000000 + 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ +#else + (cmpfunc)SwigPyObject_compare, /* tp_compare */ +#endif + (reprfunc)SwigPyObject_repr, /* tp_repr */ + &SwigPyObject_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ (hashfunc)0, /* tp_hash */ (ternaryfunc)0, /* tp_call */ - (reprfunc)PySwigObject_str, /* tp_str */ + (reprfunc)SwigPyObject_str, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -1668,7 +1813,7 @@ _PySwigObject_type(void) { swigobject_doc, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ - 0, /* tp_richcompare */ + (richcmpfunc)SwigPyObject_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ #if PY_VERSION_HEX >= 0x02020000 0, /* tp_iter */ @@ -1685,11 +1830,11 @@ _PySwigObject_type(void) { 0, /* tp_alloc */ 0, /* tp_new */ 0, /* tp_free */ - 0, /* tp_is_gc */ + 0, /* tp_is_gc */ 0, /* tp_bases */ 0, /* tp_mro */ 0, /* tp_cache */ - 0, /* tp_subclasses */ + 0, /* tp_subclasses */ 0, /* tp_weaklist */ #endif #if PY_VERSION_HEX >= 0x02030000 @@ -1699,17 +1844,20 @@ _PySwigObject_type(void) { 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; - pyswigobject_type = tmp; - pyswigobject_type.ob_type = &PyType_Type; + swigpyobject_type = tmp; + /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 + swigpyobject_type.ob_type = &PyType_Type; +#endif type_init = 1; } - return &pyswigobject_type; + return &swigpyobject_type; } SWIGRUNTIME PyObject * -PySwigObject_New(void *ptr, swig_type_info *ty, int own) +SwigPyObject_New(void *ptr, swig_type_info *ty, int own) { - PySwigObject *sobj = PyObject_NEW(PySwigObject, PySwigObject_type()); + SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); if (sobj) { sobj->ptr = ptr; sobj->ty = ty; @@ -1728,10 +1876,10 @@ typedef struct { void *pack; swig_type_info *ty; size_t size; -} PySwigPacked; +} SwigPyPacked; SWIGRUNTIME int -PySwigPacked_print(PySwigPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) +SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { char result[SWIG_BUFFER_SIZE]; fputs("pack, v->size, 0, sizeof(result))) { - return PyString_FromFormat("", result, v->ty->name); + return SWIG_Python_str_FromFormat("", result, v->ty->name); } else { - return PyString_FromFormat("", v->ty->name); + return SWIG_Python_str_FromFormat("", v->ty->name); } } SWIGRUNTIME PyObject * -PySwigPacked_str(PySwigPacked *v) +SwigPyPacked_str(SwigPyPacked *v) { char result[SWIG_BUFFER_SIZE]; if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ - return PyString_FromFormat("%s%s", result, v->ty->name); + return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name); } else { - return PyString_FromString(v->ty->name); + return SWIG_Python_str_FromChar(v->ty->name); } } SWIGRUNTIME int -PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w) +SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) { size_t i = v->size; size_t j = w->size; @@ -1778,22 +1926,22 @@ PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w) SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void); SWIGRUNTIME PyTypeObject* -PySwigPacked_type(void) { +SwigPyPacked_type(void) { static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigPacked_type(); return type; } SWIGRUNTIMEINLINE int -PySwigPacked_Check(PyObject *op) { +SwigPyPacked_Check(PyObject *op) { return ((op)->ob_type == _PySwigPacked_type()) - || (strcmp((op)->ob_type->tp_name,"PySwigPacked") == 0); + || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); } SWIGRUNTIME void -PySwigPacked_dealloc(PyObject *v) +SwigPyPacked_dealloc(PyObject *v) { - if (PySwigPacked_Check(v)) { - PySwigPacked *sobj = (PySwigPacked *) v; + if (SwigPyPacked_Check(v)) { + SwigPyPacked *sobj = (SwigPyPacked *) v; free(sobj->pack); } PyObject_DEL(v); @@ -1802,28 +1950,37 @@ PySwigPacked_dealloc(PyObject *v) SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void) { static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; - static PyTypeObject pyswigpacked_type; + static PyTypeObject swigpypacked_type; static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX>=0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ - (char *)"PySwigPacked", /* tp_name */ - sizeof(PySwigPacked), /* tp_basicsize */ + 0, /* ob_size */ +#endif + (char *)"SwigPyPacked", /* tp_name */ + sizeof(SwigPyPacked), /* tp_basicsize */ 0, /* tp_itemsize */ - (destructor)PySwigPacked_dealloc, /* tp_dealloc */ - (printfunc)PySwigPacked_print, /* tp_print */ + (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ + (printfunc)SwigPyPacked_print, /* tp_print */ (getattrfunc)0, /* tp_getattr */ (setattrfunc)0, /* tp_setattr */ - (cmpfunc)PySwigPacked_compare, /* tp_compare */ - (reprfunc)PySwigPacked_repr, /* tp_repr */ - 0, /* tp_as_number */ +#if PY_VERSION_HEX>=0x03000000 + 0, /* tp_reserved in 3.0.1 */ +#else + (cmpfunc)SwigPyPacked_compare, /* tp_compare */ +#endif + (reprfunc)SwigPyPacked_repr, /* tp_repr */ + 0, /* tp_as_number */ 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - (reprfunc)PySwigPacked_str, /* tp_str */ + 0, /* tp_as_mapping */ + (hashfunc)0, /* tp_hash */ + (ternaryfunc)0, /* tp_call */ + (reprfunc)SwigPyPacked_str, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -1862,17 +2019,20 @@ _PySwigPacked_type(void) { 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; - pyswigpacked_type = tmp; - pyswigpacked_type.ob_type = &PyType_Type; + swigpypacked_type = tmp; + /* for Python 3 the ob_type already assigned in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 + swigpypacked_type.ob_type = &PyType_Type; +#endif type_init = 1; } - return &pyswigpacked_type; + return &swigpypacked_type; } SWIGRUNTIME PyObject * -PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty) +SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) { - PySwigPacked *sobj = PyObject_NEW(PySwigPacked, PySwigPacked_type()); + SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); if (sobj) { void *pack = malloc(size); if (pack) { @@ -1889,10 +2049,10 @@ PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty) } SWIGRUNTIME swig_type_info * -PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size) +SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) { - if (PySwigPacked_Check(obj)) { - PySwigPacked *sobj = (PySwigPacked *)obj; + if (SwigPyPacked_Check(obj)) { + SwigPyPacked *sobj = (SwigPyPacked *)obj; if (sobj->size != size) return 0; memcpy(ptr, sobj->pack, size); return sobj->ty; @@ -1908,7 +2068,7 @@ PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size) SWIGRUNTIMEINLINE PyObject * _SWIG_This(void) { - return PyString_FromString("this"); + return SWIG_Python_str_FromChar("this"); } SWIGRUNTIME PyObject * @@ -1920,11 +2080,16 @@ SWIG_This(void) /* #define SWIG_PYTHON_SLOW_GETSET_THIS */ -SWIGRUNTIME PySwigObject * +/* TODO: I don't know how to implement the fast getset in Python 3 right now */ +#if PY_VERSION_HEX>=0x03000000 +#define SWIG_PYTHON_SLOW_GETSET_THIS +#endif + +SWIGRUNTIME SwigPyObject * SWIG_Python_GetSwigThis(PyObject *pyobj) { - if (PySwigObject_Check(pyobj)) { - return (PySwigObject *) pyobj; + if (SwigPyObject_Check(pyobj)) { + return (SwigPyObject *) pyobj; } else { PyObject *obj = 0; #if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000)) @@ -1960,12 +2125,12 @@ SWIG_Python_GetSwigThis(PyObject *pyobj) return 0; } #endif - if (obj && !PySwigObject_Check(obj)) { + if (obj && !SwigPyObject_Check(obj)) { /* a PyObject is called 'this', try to get the 'real this' - PySwigObject from it */ + SwigPyObject from it */ return SWIG_Python_GetSwigThis(obj); } - return (PySwigObject *)obj; + return (SwigPyObject *)obj; } } @@ -1974,7 +2139,7 @@ SWIG_Python_GetSwigThis(PyObject *pyobj) SWIGRUNTIME int SWIG_Python_AcquirePtr(PyObject *obj, int own) { if (own == SWIG_POINTER_OWN) { - PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); + SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); if (sobj) { int oldown = sobj->own; sobj->own = own; @@ -1993,7 +2158,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int if (ptr) *ptr = 0; return SWIG_OK; } else { - PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); + SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); if (own) *own = 0; while (sobj) { @@ -2007,7 +2172,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int } else { swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); if (!tc) { - sobj = (PySwigObject *)sobj->next; + sobj = (SwigPyObject *)sobj->next; } else { if (ptr) { int newmemory = 0; @@ -2036,7 +2201,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int } else { int res = SWIG_ERROR; if (flags & SWIG_POINTER_IMPLICIT_CONV) { - PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0; + SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; if (data && !data->implicitconv) { PyObject *klass = data->klass; if (klass) { @@ -2049,7 +2214,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int impconv = 0; } if (impconv) { - PySwigObject *iobj = SWIG_Python_GetSwigThis(impconv); + SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv); if (iobj) { void *vptr; res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0); @@ -2087,10 +2252,10 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { /* here we get the method pointer for callbacks */ const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; - if (desc) { + if (desc) desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; - if (!desc) return SWIG_ERROR; - } + if (!desc) + return SWIG_ERROR; if (ty) { swig_cast_info *tc = SWIG_TypeCheck(desc,ty); if (tc) { @@ -2111,7 +2276,7 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { SWIGRUNTIME int SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { - swig_type_info *to = PySwigPacked_UnpackData(obj, ptr, sz); + swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz); if (!to) return SWIG_ERROR; if (ty) { if (to != ty) { @@ -2128,12 +2293,12 @@ SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *t * ----------------------------------------------------------------------------- */ /* - Create a new instance object, whitout calling __init__, and set the + Create a new instance object, without calling __init__, and set the 'this' attribute. */ SWIGRUNTIME PyObject* -SWIG_Python_NewShadowInstance(PySwigClientData *data, PyObject *swig_this) +SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) { #if (PY_VERSION_HEX >= 0x02020000) PyObject *inst = 0; @@ -2157,10 +2322,16 @@ SWIG_Python_NewShadowInstance(PySwigClientData *data, PyObject *swig_this) #endif } } else { +#if PY_VERSION_HEX >= 0x03000000 + inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None); + PyObject_SetAttr(inst, SWIG_This(), swig_this); + Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; +#else PyObject *dict = PyDict_New(); PyDict_SetItem(dict, SWIG_This(), swig_this); inst = PyInstance_NewRaw(data->newargs, dict); Py_DECREF(dict); +#endif } return inst; #else @@ -2223,9 +2394,9 @@ SWIG_Python_InitShadowInstance(PyObject *args) { if (!SWIG_Python_UnpackTuple(args,(char*)"swiginit", 2, 2, obj)) { return NULL; } else { - PySwigObject *sthis = SWIG_Python_GetSwigThis(obj[0]); + SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); if (sthis) { - PySwigObject_append((PyObject*) sthis, obj[1]); + SwigPyObject_append((PyObject*) sthis, obj[1]); } else { SWIG_Python_SetSwigThis(obj[0], obj[1]); } @@ -2241,8 +2412,8 @@ SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) { return SWIG_Py_Void(); } else { int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; - PyObject *robj = PySwigObject_New(ptr, type, own); - PySwigClientData *clientdata = type ? (PySwigClientData *)(type->clientdata) : 0; + PyObject *robj = SwigPyObject_New(ptr, type, own); + SwigPyClientData *clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0; if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); if (inst) { @@ -2258,7 +2429,7 @@ SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) { SWIGRUNTIMEINLINE PyObject * SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { - return ptr ? PySwigPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); + return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); } /* -----------------------------------------------------------------------------* @@ -2329,8 +2500,8 @@ SWIG_Python_DestroyModule(void *vptr) for (i =0; i < swig_module->size; ++i) { swig_type_info *ty = types[i]; if (ty->owndata) { - PySwigClientData *data = (PySwigClientData *) ty->clientdata; - if (data) PySwigClientData_Del(data); + SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; + if (data) SwigPyClientData_Del(data); } } Py_DECREF(SWIG_This()); @@ -2340,8 +2511,13 @@ SWIGRUNTIME void SWIG_Python_SetModule(swig_module_info *swig_module) { static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */ +#if PY_VERSION_HEX >= 0x03000000 + /* Add a dummy module object into sys.modules */ + PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION); +#else PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); +#endif PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); if (pointer && module) { PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); @@ -2361,7 +2537,7 @@ SWIGRUNTIME swig_type_info * SWIG_Python_TypeQuery(const char *type) { PyObject *cache = SWIG_Python_TypeCache(); - PyObject *key = PyString_FromString(type); + PyObject *key = SWIG_Python_str_FromChar(type); PyObject *obj = PyDict_GetItem(cache, key); swig_type_info *descriptor; if (obj) { @@ -2388,21 +2564,23 @@ SWIG_Python_TypeQuery(const char *type) SWIGRUNTIME int SWIG_Python_AddErrMesg(const char* mesg, int infront) -{ +{ if (PyErr_Occurred()) { PyObject *type = 0; PyObject *value = 0; PyObject *traceback = 0; PyErr_Fetch(&type, &value, &traceback); if (value) { + char *tmp; PyObject *old_str = PyObject_Str(value); Py_XINCREF(type); PyErr_Clear(); if (infront) { - PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str)); + PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str)); } else { - PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg); + PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); } + SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); } return 1; @@ -2425,9 +2603,9 @@ SWIG_Python_ArgFail(int argnum) } SWIGRUNTIMEINLINE const char * -PySwigObject_GetDesc(PyObject *self) +SwigPyObject_GetDesc(PyObject *self) { - PySwigObject *v = (PySwigObject *)self; + SwigPyObject *v = (SwigPyObject *)self; swig_type_info *ty = v ? v->ty : 0; return ty ? ty->str : (char*)""; } @@ -2437,10 +2615,10 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) { if (type) { #if defined(SWIG_COBJECT_TYPES) - if (obj && PySwigObject_Check(obj)) { - const char *otype = (const char *) PySwigObject_GetDesc(obj); + if (obj && SwigPyObject_Check(obj)) { + const char *otype = (const char *) SwigPyObject_GetDesc(obj); if (otype) { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'PySwigObject(%s)' is received", + PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received", type, otype); return; } @@ -2450,10 +2628,11 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) const char *otype = (obj ? obj->ob_type->tp_name : 0); if (otype) { PyObject *str = PyObject_Str(obj); - const char *cstr = str ? PyString_AsString(str) : 0; + const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0; if (cstr) { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", type, otype, cstr); + SWIG_Python_str_DelForPy3(cstr); } else { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); @@ -2475,10 +2654,12 @@ SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) void *result; if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { PyErr_Clear(); - if (flags & SWIG_POINTER_EXCEPTION) { +#if SWIG_POINTER_EXCEPTION + if (flags) { SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); SWIG_Python_ArgFail(argnum); } +#endif } return result; } @@ -2523,11 +2704,16 @@ static swig_module_info swig_module = {swig_types, 6, 0, 0, 0, 0}; /*----------------------------------------------- @(target):= vdisplaymodule.so ------------------------------------------------*/ -#define SWIG_init initvdisplaymodule +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_init PyInit_vdisplaymodule +#else +# define SWIG_init initvdisplaymodule + +#endif #define SWIG_name "vdisplaymodule" -#define SWIGVERSION 0x010336 +#define SWIGVERSION 0x010340 #define SWIG_VERSION SWIGVERSION @@ -2539,28 +2725,28 @@ static swig_module_info swig_module = {swig_types, 6, 0, 0, 0, 0}; namespace swig { - class PyObject_ptr { + class SwigPtr_PyObject { protected: PyObject *_obj; public: - PyObject_ptr() :_obj(0) + SwigPtr_PyObject() :_obj(0) { } - PyObject_ptr(const PyObject_ptr& item) : _obj(item._obj) + SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj) { Py_XINCREF(_obj); } - PyObject_ptr(PyObject *obj, bool initial_ref = true) :_obj(obj) + SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj) { if (initial_ref) { Py_XINCREF(_obj); } } - PyObject_ptr & operator=(const PyObject_ptr& item) + SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) { Py_XINCREF(item._obj); Py_XDECREF(_obj); @@ -2568,7 +2754,7 @@ namespace swig { return *this; } - ~PyObject_ptr() + ~SwigPtr_PyObject() { Py_XDECREF(_obj); } @@ -2587,10 +2773,10 @@ namespace swig { namespace swig { - struct PyObject_var : PyObject_ptr { - PyObject_var(PyObject* obj = 0) : PyObject_ptr(obj, false) { } + struct SwigVar_PyObject : SwigPtr_PyObject { + SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { } - PyObject_var & operator = (PyObject* obj) + SwigVar_PyObject & operator = (PyObject* obj) { Py_XDECREF(_obj); _obj = obj; @@ -2629,10 +2815,28 @@ SWIG_pchar_descriptor(void) SWIGINTERN int SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) { - if (PyString_Check(obj)) { +#if PY_VERSION_HEX>=0x03000000 + if (PyUnicode_Check(obj)) +#else + if (PyString_Check(obj)) +#endif + { char *cstr; Py_ssize_t len; +#if PY_VERSION_HEX>=0x03000000 + if (!alloc && cptr) { + /* We can't allow converting without allocation, since the internal + representation of string in Python 3 is UCS-2/UCS-4 but we require + a UTF-8 representation. + TODO(bhy) More detailed explanation */ + return SWIG_RuntimeError; + } + obj = PyUnicode_AsUTF8String(obj); + PyBytes_AsStringAndSize(obj, &cstr, &len); + if(alloc) *alloc = SWIG_NEWOBJ; +#else PyString_AsStringAndSize(obj, &cstr, &len); - if (cptr) { +#endif + if (cptr) { if (alloc) { /* In python the user should not be able to modify the inner @@ -2657,10 +2861,16 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) *alloc = SWIG_OLDOBJ; } } else { - *cptr = PyString_AsString(obj); + #if PY_VERSION_HEX>=0x03000000 + assert(0); /* Should never reach here in Python 3 */ + #endif + *cptr = SWIG_Python_str_AsChar(obj); } } if (psize) *psize = len + 1; +#if PY_VERSION_HEX>=0x03000000 + Py_XDECREF(obj); +#endif return SWIG_OK; } else { swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); @@ -2818,10 +3028,7 @@ SWIGINTERN PyObject *_wrap_VDisplay___assign__(PyObject *SWIGUNUSEDPARM(self), P SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VDisplay___assign__" "', argument " "2"" of type '" "vips::VDisplay const &""'"); } arg2 = reinterpret_cast< vips::VDisplay * >(argp2); - { - vips::VDisplay &_result_ref = (arg1)->operator =((vips::VDisplay const &)*arg2); - result = (vips::VDisplay *) &_result_ref; - } + result = (vips::VDisplay *) &(arg1)->operator =((vips::VDisplay const &)*arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_vips__VDisplay, 0 | 0 ); return resultobj; fail: @@ -2908,6 +3115,7 @@ SWIGINTERN PyObject *VDisplay_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObj } static PyMethodDef SwigMethods[] = { + { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL}, { (char *)"new_VDisplay", _wrap_new_VDisplay, METH_VARARGS, NULL}, { (char *)"VDisplay___assign__", _wrap_VDisplay___assign__, METH_VARARGS, NULL}, { (char *)"delete_VDisplay", _wrap_delete_VDisplay, METH_VARARGS, NULL}, @@ -3227,26 +3435,58 @@ extern "C" { SWIGINTERN PyObject * swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) { +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_InternFromString(""); +#else return PyString_FromString(""); +#endif } SWIGINTERN PyObject * swig_varlink_str(swig_varlinkobject *v) { +#if PY_VERSION_HEX >= 0x03000000 + PyObject *str = PyUnicode_InternFromString("("); + PyObject *tail; + PyObject *joined; + swig_globalvar *var; + for (var = v->vars; var; var=var->next) { + tail = PyUnicode_FromString(var->name); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; + if (var->next) { + tail = PyUnicode_InternFromString(", "); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; + } + } + tail = PyUnicode_InternFromString(")"); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; +#else PyObject *str = PyString_FromString("("); - swig_globalvar *var; + swig_globalvar *var; for (var = v->vars; var; var=var->next) { PyString_ConcatAndDel(&str,PyString_FromString(var->name)); if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", ")); } PyString_ConcatAndDel(&str,PyString_FromString(")")); +#endif return str; } SWIGINTERN int swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { + char *tmp; PyObject *str = swig_varlink_str(v); fprintf(fp,"Swig global variables "); - fprintf(fp,"%s\n", PyString_AsString(str)); + fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str)); + SWIG_Python_str_DelForPy3(tmp); Py_DECREF(str); return 0; } @@ -3304,12 +3544,17 @@ extern "C" { if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else PyObject_HEAD_INIT(NULL) 0, /* Number of items in variable part (ob_size) */ +#endif (char *)"swigvarlink", /* Type name (tp_name) */ sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */ 0, /* Itemsize (tp_itemsize) */ - (destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */ + (destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */ (printfunc) swig_varlink_print, /* Print (tp_print) */ (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */ (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */ @@ -3320,7 +3565,7 @@ extern "C" { 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ - (reprfunc)swig_varlink_str, /* tp_str */ + (reprfunc) swig_varlink_str, /* tp_str */ 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -3341,7 +3586,10 @@ extern "C" { #endif }; varlink_type = tmp; + /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 varlink_type.ob_type = &PyType_Type; +#endif type_init = 1; } return &varlink_type; @@ -3466,13 +3714,37 @@ extern "C" { #ifdef __cplusplus extern "C" #endif -SWIGEXPORT void SWIG_init(void) { - PyObject *m, *d; + +SWIGEXPORT +#if PY_VERSION_HEX >= 0x03000000 +PyObject* +#else +void +#endif +SWIG_init(void) { + PyObject *m, *d; +#if PY_VERSION_HEX >= 0x03000000 + static struct PyModuleDef SWIG_module = { + PyModuleDef_HEAD_INIT, + (char *) SWIG_name, + NULL, + -1, + SwigMethods, + NULL, + NULL, + NULL, + NULL + }; +#endif /* Fix SwigMethods to carry the callback ptrs when needed */ SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); +#if PY_VERSION_HEX >= 0x03000000 + m = PyModule_Create(&SWIG_module); +#else m = Py_InitModule((char *) SWIG_name, SwigMethods); +#endif d = PyModule_GetDict(m); SWIG_InitializeModule(0); @@ -3481,5 +3753,10 @@ SWIGEXPORT void SWIG_init(void) { SWIG_Python_SetConstant(d, "VDisplay_BARCO",SWIG_From_int(static_cast< int >(vips::VDisplay::BARCO))); SWIG_Python_SetConstant(d, "VDisplay_DUMB",SWIG_From_int(static_cast< int >(vips::VDisplay::DUMB))); +#if PY_VERSION_HEX >= 0x03000000 + return m; +#else + return; +#endif } diff --git a/swig/python/verrormodule.cpp b/swig/python/verrormodule.cpp index 22fd355b..e9ed85a3 100644 --- a/swig/python/verrormodule.cpp +++ b/swig/python/verrormodule.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.36 + * Version 1.3.40 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -11,19 +11,23 @@ #define SWIGPYTHON #define SWIG_PYTHON_DIRECTOR_NO_VTABLE + #ifdef __cplusplus +/* SwigValueWrapper is described in swig.swg */ template class SwigValueWrapper { - T *tt; + struct SwigMovePointer { + T *ptr; + SwigMovePointer(T *p) : ptr(p) { } + ~SwigMovePointer() { delete ptr; } + SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper(const SwigValueWrapper& rhs); public: - SwigValueWrapper() : tt(0) { } - SwigValueWrapper(const SwigValueWrapper& rhs) : tt(new T(*rhs.tt)) { } - SwigValueWrapper(const T& t) : tt(new T(t)) { } - ~SwigValueWrapper() { delete tt; } - SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; } - operator T&() const { return *tt; } - T *operator&() { return tt; } -private: - SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper() : pointer(0) { } + SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } + operator T&() const { return *pointer.ptr; } + T *operator&() { return pointer.ptr; } }; template T SwigValueInit() { @@ -147,7 +151,7 @@ template T SwigValueInit() { /* ----------------------------------------------------------------------------- * swigrun.swg * - * This file contains generic CAPI SWIG runtime support for pointer + * This file contains generic C API SWIG runtime support for pointer * type checking. * ----------------------------------------------------------------------------- */ @@ -166,11 +170,11 @@ template T SwigValueInit() { /* You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for - creating a static or dynamic library from the swig runtime code. - In 99.9% of the cases, swig just needs to declare them as 'static'. + creating a static or dynamic library from the SWIG runtime code. + In 99.9% of the cases, SWIG just needs to declare them as 'static'. - But only do this if is strictly necessary, ie, if you have problems - with your compiler or so. + But only do this if strictly necessary, ie, if you have problems + with your compiler or suchlike. */ #ifndef SWIGRUNTIME @@ -197,14 +201,14 @@ template T SwigValueInit() { /* Flags/methods for returning states. - The swig conversion methods, as ConvertPtr, return and integer + The SWIG conversion methods, as ConvertPtr, return and integer that tells if the conversion was successful or not. And if not, an error code can be returned (see swigerrors.swg for the codes). Use the following macros/flags to set or process the returning states. - In old swig versions, you usually write code as: + In old versions of SWIG, code such as the following was usually written: if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { // success code @@ -212,7 +216,7 @@ template T SwigValueInit() { //fail code } - Now you can be more explicit as: + Now you can be more explicit: int res = SWIG_ConvertPtr(obj,vptr,ty.flags); if (SWIG_IsOK(res)) { @@ -221,7 +225,7 @@ template T SwigValueInit() { // fail code } - that seems to be the same, but now you can also do + which is the same really, but now you can also do Type *ptr; int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); @@ -239,7 +243,7 @@ template T SwigValueInit() { I.e., now SWIG_ConvertPtr can return new objects and you can identify the case and take care of the deallocation. Of course that - requires also to SWIG_ConvertPtr to return new result values, as + also requires SWIG_ConvertPtr to return new result values, such as int SWIG_ConvertPtr(obj, ptr,...) { if () { @@ -257,7 +261,7 @@ template T SwigValueInit() { Of course, returning the plain '0(success)/-1(fail)' still works, but you can be more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the - swig errors code. + SWIG errors code. Finally, if the SWIG_CASTRANK_MODE is enabled, the result code allows to return the 'cast rank', for example, if you have this @@ -271,9 +275,8 @@ template T SwigValueInit() { fooi(1) // cast rank '0' just use the SWIG_AddCast()/SWIG_CheckState() +*/ - - */ #define SWIG_OK (0) #define SWIG_ERROR (-1) #define SWIG_IsOK(r) (r >= 0) @@ -298,7 +301,6 @@ template T SwigValueInit() { #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) - /* Cast-Rank Mode */ #if defined(SWIG_CASTRANK_MODE) # ifndef SWIG_TypeRank @@ -321,8 +323,6 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) { #endif - - #include #ifdef __cplusplus @@ -419,40 +419,58 @@ SWIG_TypeCompare(const char *nb, const char *tb) { } -/* think of this as a c++ template<> or a scheme macro */ -#define SWIG_TypeCheck_Template(comparison, ty) \ - if (ty) { \ - swig_cast_info *iter = ty->cast; \ - while (iter) { \ - if (comparison) { \ - if (iter == ty->cast) return iter; \ - /* Move iter to the top of the linked list */ \ - iter->prev->next = iter->next; \ - if (iter->next) \ - iter->next->prev = iter->prev; \ - iter->next = ty->cast; \ - iter->prev = 0; \ - if (ty->cast) ty->cast->prev = iter; \ - ty->cast = iter; \ - return iter; \ - } \ - iter = iter->next; \ - } \ - } \ - return 0 - /* Check the typename */ SWIGRUNTIME swig_cast_info * SWIG_TypeCheck(const char *c, swig_type_info *ty) { - SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty); + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (strcmp(iter->type->name, c) == 0) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; } -/* Same as previous function, except strcmp is replaced with a pointer comparison */ +/* + Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison +*/ SWIGRUNTIME swig_cast_info * -SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { - SWIG_TypeCheck_Template(iter->type == from, into); +SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (iter->type == from) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; } /* @@ -731,6 +749,67 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { +/* Compatibility macros for Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 + +#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) +#define PyInt_Check(x) PyLong_Check(x) +#define PyInt_AsLong(x) PyLong_AsLong(x) +#define PyInt_FromLong(x) PyLong_FromLong(x) +#define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) + +#endif + +#ifndef Py_TYPE +# define Py_TYPE(op) ((op)->ob_type) +#endif + +/* SWIG APIs for compatibility of both Python 2 & 3 */ + +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_Python_str_FromFormat PyUnicode_FromFormat +#else +# define SWIG_Python_str_FromFormat PyString_FromFormat +#endif + + +/* Warning: This function will allocate a new string in Python 3, + * so please call SWIG_Python_str_DelForPy3(x) to free the space. + */ +SWIGINTERN char* +SWIG_Python_str_AsChar(PyObject *str) +{ +#if PY_VERSION_HEX >= 0x03000000 + char *cstr; + char *newstr; + Py_ssize_t len; + str = PyUnicode_AsUTF8String(str); + PyBytes_AsStringAndSize(str, &cstr, &len); + newstr = (char *) malloc(len+1); + memcpy(newstr, cstr, len+1); + Py_XDECREF(str); + return newstr; +#else + return PyString_AsString(str); +#endif +} + +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_Python_str_DelForPy3(x) free( (void*) (x) ) +#else +# define SWIG_Python_str_DelForPy3(x) +#endif + + +SWIGINTERN PyObject* +SWIG_Python_str_FromChar(const char *c) +{ +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_FromString(c); +#else + return PyString_FromString(c); +#endif +} /* Add PyOS_snprintf for old Pythons */ #if PY_VERSION_HEX < 0x02020000 @@ -777,6 +856,7 @@ PyString_FromFormat(const char *fmt, ...) { # define PyObject_GenericGetAttr 0 # endif #endif + /* Py_NotImplemented is defined in 2.1 and up. */ #if PY_VERSION_HEX < 0x02010000 # ifndef Py_NotImplemented @@ -784,7 +864,6 @@ PyString_FromFormat(const char *fmt, ...) { # endif #endif - /* A crude PyString_AsStringAndSize implementation for old Pythons */ #if PY_VERSION_HEX < 0x02010000 # ifndef PyString_AsStringAndSize @@ -799,7 +878,6 @@ PyString_FromFormat(const char *fmt, ...) { # endif #endif - /* PyBool_FromLong for old Pythons */ #if PY_VERSION_HEX < 0x02030000 static @@ -877,10 +955,13 @@ SWIG_Python_AddErrorMsg(const char* mesg) if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback); if (value) { + char *tmp; PyObject *old_str = PyObject_Str(value); PyErr_Clear(); Py_XINCREF(type); - PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg); + + PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); + SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); Py_DECREF(value); } else { @@ -888,8 +969,6 @@ SWIG_Python_AddErrorMsg(const char* mesg) } } - - #if defined(SWIG_PYTHON_NO_THREADS) # if defined(SWIG_PYTHON_THREADS) # undef SWIG_PYTHON_THREADS @@ -986,6 +1065,20 @@ typedef struct swig_const_info { swig_type_info **ptype; } swig_const_info; + +/* ----------------------------------------------------------------------------- + * Wrapper of PyInstanceMethod_New() used in Python 3 + * It is exported to the generated module, used for -fastproxy + * ----------------------------------------------------------------------------- */ +SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *self, PyObject *func) +{ +#if PY_VERSION_HEX >= 0x03000000 + return PyInstanceMethod_New(func); +#else + return NULL; +#endif +} + #ifdef __cplusplus #if 0 { /* cc-mode */ @@ -1038,7 +1131,7 @@ typedef struct swig_const_info { #define SWIG_GetModule(clientdata) SWIG_Python_GetModule() #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) -#define SWIG_NewClientData(obj) PySwigClientData_New(obj) +#define SWIG_NewClientData(obj) SwigPyClientData_New(obj) #define SWIG_SetErrorObj SWIG_Python_SetErrorObj #define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg @@ -1234,7 +1327,7 @@ SWIG_Py_Void(void) return none; } -/* PySwigClientData */ +/* SwigPyClientData */ typedef struct { PyObject *klass; @@ -1243,30 +1336,30 @@ typedef struct { PyObject *destroy; int delargs; int implicitconv; -} PySwigClientData; +} SwigPyClientData; SWIGRUNTIMEINLINE int SWIG_Python_CheckImplicit(swig_type_info *ty) { - PySwigClientData *data = (PySwigClientData *)ty->clientdata; + SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; return data ? data->implicitconv : 0; } SWIGRUNTIMEINLINE PyObject * SWIG_Python_ExceptionType(swig_type_info *desc) { - PySwigClientData *data = desc ? (PySwigClientData *) desc->clientdata : 0; + SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0; PyObject *klass = data ? data->klass : 0; return (klass ? klass : PyExc_RuntimeError); } -SWIGRUNTIME PySwigClientData * -PySwigClientData_New(PyObject* obj) +SWIGRUNTIME SwigPyClientData * +SwigPyClientData_New(PyObject* obj) { if (!obj) { return 0; } else { - PySwigClientData *data = (PySwigClientData *)malloc(sizeof(PySwigClientData)); + SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData)); /* the klass element */ data->klass = obj; Py_INCREF(data->klass); @@ -1314,14 +1407,14 @@ PySwigClientData_New(PyObject* obj) } SWIGRUNTIME void -PySwigClientData_Del(PySwigClientData* data) +SwigPyClientData_Del(SwigPyClientData* data) { Py_XDECREF(data->newraw); Py_XDECREF(data->newargs); Py_XDECREF(data->destroy); } -/* =============== PySwigObject =====================*/ +/* =============== SwigPyObject =====================*/ typedef struct { PyObject_HEAD @@ -1329,24 +1422,28 @@ typedef struct { swig_type_info *ty; int own; PyObject *next; -} PySwigObject; +} SwigPyObject; SWIGRUNTIME PyObject * -PySwigObject_long(PySwigObject *v) +SwigPyObject_long(SwigPyObject *v) { return PyLong_FromVoidPtr(v->ptr); } SWIGRUNTIME PyObject * -PySwigObject_format(const char* fmt, PySwigObject *v) +SwigPyObject_format(const char* fmt, SwigPyObject *v) { PyObject *res = NULL; PyObject *args = PyTuple_New(1); if (args) { - if (PyTuple_SetItem(args, 0, PySwigObject_long(v)) == 0) { - PyObject *ofmt = PyString_FromString(fmt); + if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) { + PyObject *ofmt = SWIG_Python_str_FromChar(fmt); if (ofmt) { +#if PY_VERSION_HEX >= 0x03000000 + res = PyUnicode_Format(ofmt,args); +#else res = PyString_Format(ofmt,args); +#endif Py_DECREF(ofmt); } Py_DECREF(args); @@ -1356,49 +1453,57 @@ PySwigObject_format(const char* fmt, PySwigObject *v) } SWIGRUNTIME PyObject * -PySwigObject_oct(PySwigObject *v) +SwigPyObject_oct(SwigPyObject *v) { - return PySwigObject_format("%o",v); + return SwigPyObject_format("%o",v); } SWIGRUNTIME PyObject * -PySwigObject_hex(PySwigObject *v) +SwigPyObject_hex(SwigPyObject *v) { - return PySwigObject_format("%x",v); + return SwigPyObject_format("%x",v); } SWIGRUNTIME PyObject * #ifdef METH_NOARGS -PySwigObject_repr(PySwigObject *v) +SwigPyObject_repr(SwigPyObject *v) #else -PySwigObject_repr(PySwigObject *v, PyObject *args) +SwigPyObject_repr(SwigPyObject *v, PyObject *args) #endif { const char *name = SWIG_TypePrettyName(v->ty); - PyObject *hex = PySwigObject_hex(v); - PyObject *repr = PyString_FromFormat("", name, PyString_AsString(hex)); - Py_DECREF(hex); + PyObject *repr = SWIG_Python_str_FromFormat("", name, v); if (v->next) { #ifdef METH_NOARGS - PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next); + PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); #else - PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next, args); + PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args); #endif +#if PY_VERSION_HEX >= 0x03000000 + PyObject *joined = PyUnicode_Concat(repr, nrep); + Py_DecRef(repr); + Py_DecRef(nrep); + repr = joined; +#else PyString_ConcatAndDel(&repr,nrep); +#endif } return repr; } SWIGRUNTIME int -PySwigObject_print(PySwigObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) +SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { + char *str; #ifdef METH_NOARGS - PyObject *repr = PySwigObject_repr(v); + PyObject *repr = SwigPyObject_repr(v); #else - PyObject *repr = PySwigObject_repr(v, NULL); + PyObject *repr = SwigPyObject_repr(v, NULL); #endif if (repr) { - fputs(PyString_AsString(repr), fp); + str = SWIG_Python_str_AsChar(repr); + fputs(str, fp); + SWIG_Python_str_DelForPy3(str); Py_DECREF(repr); return 0; } else { @@ -1407,53 +1512,71 @@ PySwigObject_print(PySwigObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) } SWIGRUNTIME PyObject * -PySwigObject_str(PySwigObject *v) +SwigPyObject_str(SwigPyObject *v) { char result[SWIG_BUFFER_SIZE]; return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ? - PyString_FromString(result) : 0; + SWIG_Python_str_FromChar(result) : 0; } SWIGRUNTIME int -PySwigObject_compare(PySwigObject *v, PySwigObject *w) +SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) { void *i = v->ptr; void *j = w->ptr; return (i < j) ? -1 : ((i > j) ? 1 : 0); } +/* Added for Python 3.x, would it also be useful for Python 2.x? */ +SWIGRUNTIME PyObject* +SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op) +{ + PyObject* res; + if( op != Py_EQ && op != Py_NE ) { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } + if( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ) + res = Py_True; + else + res = Py_False; + Py_INCREF(res); + return res; +} + + SWIGRUNTIME PyTypeObject* _PySwigObject_type(void); SWIGRUNTIME PyTypeObject* -PySwigObject_type(void) { +SwigPyObject_type(void) { static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type(); return type; } SWIGRUNTIMEINLINE int -PySwigObject_Check(PyObject *op) { - return ((op)->ob_type == PySwigObject_type()) - || (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0); +SwigPyObject_Check(PyObject *op) { + return (Py_TYPE(op) == SwigPyObject_type()) + || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); } SWIGRUNTIME PyObject * -PySwigObject_New(void *ptr, swig_type_info *ty, int own); +SwigPyObject_New(void *ptr, swig_type_info *ty, int own); SWIGRUNTIME void -PySwigObject_dealloc(PyObject *v) +SwigPyObject_dealloc(PyObject *v) { - PySwigObject *sobj = (PySwigObject *) v; + SwigPyObject *sobj = (SwigPyObject *) v; PyObject *next = sobj->next; if (sobj->own == SWIG_POINTER_OWN) { swig_type_info *ty = sobj->ty; - PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0; + SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; PyObject *destroy = data ? data->destroy : 0; if (destroy) { /* destroy is always a VARARGS method */ PyObject *res; if (data->delargs) { - /* we need to create a temporal object to carry the destroy operation */ - PyObject *tmp = PySwigObject_New(sobj->ptr, ty, 0); + /* we need to create a temporary object to carry the destroy operation */ + PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0); res = SWIG_Python_CallFunctor(destroy, tmp); Py_DECREF(tmp); } else { @@ -1475,15 +1598,15 @@ PySwigObject_dealloc(PyObject *v) } SWIGRUNTIME PyObject* -PySwigObject_append(PyObject* v, PyObject* next) +SwigPyObject_append(PyObject* v, PyObject* next) { - PySwigObject *sobj = (PySwigObject *) v; + SwigPyObject *sobj = (SwigPyObject *) v; #ifndef METH_O PyObject *tmp = 0; if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL; next = tmp; #endif - if (!PySwigObject_Check(next)) { + if (!SwigPyObject_Check(next)) { return NULL; } sobj->next = next; @@ -1493,12 +1616,12 @@ PySwigObject_append(PyObject* v, PyObject* next) SWIGRUNTIME PyObject* #ifdef METH_NOARGS -PySwigObject_next(PyObject* v) +SwigPyObject_next(PyObject* v) #else -PySwigObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { - PySwigObject *sobj = (PySwigObject *) v; + SwigPyObject *sobj = (SwigPyObject *) v; if (sobj->next) { Py_INCREF(sobj->next); return sobj->next; @@ -1509,30 +1632,30 @@ PySwigObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) SWIGINTERN PyObject* #ifdef METH_NOARGS -PySwigObject_disown(PyObject *v) +SwigPyObject_disown(PyObject *v) #else -PySwigObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { - PySwigObject *sobj = (PySwigObject *)v; + SwigPyObject *sobj = (SwigPyObject *)v; sobj->own = 0; return SWIG_Py_Void(); } SWIGINTERN PyObject* #ifdef METH_NOARGS -PySwigObject_acquire(PyObject *v) +SwigPyObject_acquire(PyObject *v) #else -PySwigObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { - PySwigObject *sobj = (PySwigObject *)v; + SwigPyObject *sobj = (SwigPyObject *)v; sobj->own = SWIG_POINTER_OWN; return SWIG_Py_Void(); } SWIGINTERN PyObject* -PySwigObject_own(PyObject *v, PyObject *args) +SwigPyObject_own(PyObject *v, PyObject *args) { PyObject *val = 0; #if (PY_VERSION_HEX < 0x02020000) @@ -1545,20 +1668,20 @@ PySwigObject_own(PyObject *v, PyObject *args) } else { - PySwigObject *sobj = (PySwigObject *)v; + SwigPyObject *sobj = (SwigPyObject *)v; PyObject *obj = PyBool_FromLong(sobj->own); if (val) { #ifdef METH_NOARGS if (PyObject_IsTrue(val)) { - PySwigObject_acquire(v); + SwigPyObject_acquire(v); } else { - PySwigObject_disown(v); + SwigPyObject_disown(v); } #else if (PyObject_IsTrue(val)) { - PySwigObject_acquire(v,args); + SwigPyObject_acquire(v,args); } else { - PySwigObject_disown(v,args); + SwigPyObject_disown(v,args); } #endif } @@ -1569,30 +1692,30 @@ PySwigObject_own(PyObject *v, PyObject *args) #ifdef METH_O static PyMethodDef swigobject_methods[] = { - {(char *)"disown", (PyCFunction)PySwigObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)PySwigObject_append, METH_O, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)PySwigObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)PySwigObject_repr, METH_NOARGS, (char *)"returns object representation"}, + {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"}, + {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, + {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"}, + {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, + {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"}, {0, 0, 0, 0} }; #else static PyMethodDef swigobject_methods[] = { - {(char *)"disown", (PyCFunction)PySwigObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)PySwigObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)PySwigObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)PySwigObject_repr, METH_VARARGS, (char *)"returns object representation"}, + {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"}, + {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, + {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, + {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, + {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"}, {0, 0, 0, 0} }; #endif #if PY_VERSION_HEX < 0x02020000 SWIGINTERN PyObject * -PySwigObject_getattr(PySwigObject *sobj,char *name) +SwigPyObject_getattr(SwigPyObject *sobj,char *name) { return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name); } @@ -1602,11 +1725,14 @@ SWIGRUNTIME PyTypeObject* _PySwigObject_type(void) { static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; - static PyNumberMethods PySwigObject_as_number = { + static PyNumberMethods SwigPyObject_as_number = { (binaryfunc)0, /*nb_add*/ (binaryfunc)0, /*nb_subtract*/ (binaryfunc)0, /*nb_multiply*/ + /* nb_divide removed in Python 3 */ +#if PY_VERSION_HEX < 0x03000000 (binaryfunc)0, /*nb_divide*/ +#endif (binaryfunc)0, /*nb_remainder*/ (binaryfunc)0, /*nb_divmod*/ (ternaryfunc)0,/*nb_power*/ @@ -1620,13 +1746,23 @@ _PySwigObject_type(void) { 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ - (coercion)0, /*nb_coerce*/ - (unaryfunc)PySwigObject_long, /*nb_int*/ - (unaryfunc)PySwigObject_long, /*nb_long*/ +#if PY_VERSION_HEX < 0x03000000 + 0, /*nb_coerce*/ +#endif + (unaryfunc)SwigPyObject_long, /*nb_int*/ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc)SwigPyObject_long, /*nb_long*/ +#else + 0, /*nb_reserved*/ +#endif (unaryfunc)0, /*nb_float*/ - (unaryfunc)PySwigObject_oct, /*nb_oct*/ - (unaryfunc)PySwigObject_hex, /*nb_hex*/ -#if PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc)SwigPyObject_oct, /*nb_oct*/ + (unaryfunc)SwigPyObject_hex, /*nb_hex*/ +#endif +#if PY_VERSION_HEX >= 0x03000000 /* 3.0 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ +#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ #elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ @@ -1635,32 +1771,41 @@ _PySwigObject_type(void) { #endif }; - static PyTypeObject pyswigobject_type; + static PyTypeObject swigpyobject_type; static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else PyObject_HEAD_INIT(NULL) 0, /* ob_size */ - (char *)"PySwigObject", /* tp_name */ - sizeof(PySwigObject), /* tp_basicsize */ +#endif + (char *)"SwigPyObject", /* tp_name */ + sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ - (destructor)PySwigObject_dealloc, /* tp_dealloc */ - (printfunc)PySwigObject_print, /* tp_print */ + (destructor)SwigPyObject_dealloc, /* tp_dealloc */ + (printfunc)SwigPyObject_print, /* tp_print */ #if PY_VERSION_HEX < 0x02020000 - (getattrfunc)PySwigObject_getattr, /* tp_getattr */ + (getattrfunc)SwigPyObject_getattr, /* tp_getattr */ #else (getattrfunc)0, /* tp_getattr */ #endif (setattrfunc)0, /* tp_setattr */ - (cmpfunc)PySwigObject_compare, /* tp_compare */ - (reprfunc)PySwigObject_repr, /* tp_repr */ - &PySwigObject_as_number, /* tp_as_number */ +#if PY_VERSION_HEX >= 0x03000000 + 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ +#else + (cmpfunc)SwigPyObject_compare, /* tp_compare */ +#endif + (reprfunc)SwigPyObject_repr, /* tp_repr */ + &SwigPyObject_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ (hashfunc)0, /* tp_hash */ (ternaryfunc)0, /* tp_call */ - (reprfunc)PySwigObject_str, /* tp_str */ + (reprfunc)SwigPyObject_str, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -1668,7 +1813,7 @@ _PySwigObject_type(void) { swigobject_doc, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ - 0, /* tp_richcompare */ + (richcmpfunc)SwigPyObject_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ #if PY_VERSION_HEX >= 0x02020000 0, /* tp_iter */ @@ -1685,11 +1830,11 @@ _PySwigObject_type(void) { 0, /* tp_alloc */ 0, /* tp_new */ 0, /* tp_free */ - 0, /* tp_is_gc */ + 0, /* tp_is_gc */ 0, /* tp_bases */ 0, /* tp_mro */ 0, /* tp_cache */ - 0, /* tp_subclasses */ + 0, /* tp_subclasses */ 0, /* tp_weaklist */ #endif #if PY_VERSION_HEX >= 0x02030000 @@ -1699,17 +1844,20 @@ _PySwigObject_type(void) { 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; - pyswigobject_type = tmp; - pyswigobject_type.ob_type = &PyType_Type; + swigpyobject_type = tmp; + /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 + swigpyobject_type.ob_type = &PyType_Type; +#endif type_init = 1; } - return &pyswigobject_type; + return &swigpyobject_type; } SWIGRUNTIME PyObject * -PySwigObject_New(void *ptr, swig_type_info *ty, int own) +SwigPyObject_New(void *ptr, swig_type_info *ty, int own) { - PySwigObject *sobj = PyObject_NEW(PySwigObject, PySwigObject_type()); + SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); if (sobj) { sobj->ptr = ptr; sobj->ty = ty; @@ -1728,10 +1876,10 @@ typedef struct { void *pack; swig_type_info *ty; size_t size; -} PySwigPacked; +} SwigPyPacked; SWIGRUNTIME int -PySwigPacked_print(PySwigPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) +SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { char result[SWIG_BUFFER_SIZE]; fputs("pack, v->size, 0, sizeof(result))) { - return PyString_FromFormat("", result, v->ty->name); + return SWIG_Python_str_FromFormat("", result, v->ty->name); } else { - return PyString_FromFormat("", v->ty->name); + return SWIG_Python_str_FromFormat("", v->ty->name); } } SWIGRUNTIME PyObject * -PySwigPacked_str(PySwigPacked *v) +SwigPyPacked_str(SwigPyPacked *v) { char result[SWIG_BUFFER_SIZE]; if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ - return PyString_FromFormat("%s%s", result, v->ty->name); + return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name); } else { - return PyString_FromString(v->ty->name); + return SWIG_Python_str_FromChar(v->ty->name); } } SWIGRUNTIME int -PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w) +SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) { size_t i = v->size; size_t j = w->size; @@ -1778,22 +1926,22 @@ PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w) SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void); SWIGRUNTIME PyTypeObject* -PySwigPacked_type(void) { +SwigPyPacked_type(void) { static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigPacked_type(); return type; } SWIGRUNTIMEINLINE int -PySwigPacked_Check(PyObject *op) { +SwigPyPacked_Check(PyObject *op) { return ((op)->ob_type == _PySwigPacked_type()) - || (strcmp((op)->ob_type->tp_name,"PySwigPacked") == 0); + || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); } SWIGRUNTIME void -PySwigPacked_dealloc(PyObject *v) +SwigPyPacked_dealloc(PyObject *v) { - if (PySwigPacked_Check(v)) { - PySwigPacked *sobj = (PySwigPacked *) v; + if (SwigPyPacked_Check(v)) { + SwigPyPacked *sobj = (SwigPyPacked *) v; free(sobj->pack); } PyObject_DEL(v); @@ -1802,28 +1950,37 @@ PySwigPacked_dealloc(PyObject *v) SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void) { static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; - static PyTypeObject pyswigpacked_type; + static PyTypeObject swigpypacked_type; static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX>=0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ - (char *)"PySwigPacked", /* tp_name */ - sizeof(PySwigPacked), /* tp_basicsize */ + 0, /* ob_size */ +#endif + (char *)"SwigPyPacked", /* tp_name */ + sizeof(SwigPyPacked), /* tp_basicsize */ 0, /* tp_itemsize */ - (destructor)PySwigPacked_dealloc, /* tp_dealloc */ - (printfunc)PySwigPacked_print, /* tp_print */ + (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ + (printfunc)SwigPyPacked_print, /* tp_print */ (getattrfunc)0, /* tp_getattr */ (setattrfunc)0, /* tp_setattr */ - (cmpfunc)PySwigPacked_compare, /* tp_compare */ - (reprfunc)PySwigPacked_repr, /* tp_repr */ - 0, /* tp_as_number */ +#if PY_VERSION_HEX>=0x03000000 + 0, /* tp_reserved in 3.0.1 */ +#else + (cmpfunc)SwigPyPacked_compare, /* tp_compare */ +#endif + (reprfunc)SwigPyPacked_repr, /* tp_repr */ + 0, /* tp_as_number */ 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - (reprfunc)PySwigPacked_str, /* tp_str */ + 0, /* tp_as_mapping */ + (hashfunc)0, /* tp_hash */ + (ternaryfunc)0, /* tp_call */ + (reprfunc)SwigPyPacked_str, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -1862,17 +2019,20 @@ _PySwigPacked_type(void) { 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; - pyswigpacked_type = tmp; - pyswigpacked_type.ob_type = &PyType_Type; + swigpypacked_type = tmp; + /* for Python 3 the ob_type already assigned in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 + swigpypacked_type.ob_type = &PyType_Type; +#endif type_init = 1; } - return &pyswigpacked_type; + return &swigpypacked_type; } SWIGRUNTIME PyObject * -PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty) +SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) { - PySwigPacked *sobj = PyObject_NEW(PySwigPacked, PySwigPacked_type()); + SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); if (sobj) { void *pack = malloc(size); if (pack) { @@ -1889,10 +2049,10 @@ PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty) } SWIGRUNTIME swig_type_info * -PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size) +SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) { - if (PySwigPacked_Check(obj)) { - PySwigPacked *sobj = (PySwigPacked *)obj; + if (SwigPyPacked_Check(obj)) { + SwigPyPacked *sobj = (SwigPyPacked *)obj; if (sobj->size != size) return 0; memcpy(ptr, sobj->pack, size); return sobj->ty; @@ -1908,7 +2068,7 @@ PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size) SWIGRUNTIMEINLINE PyObject * _SWIG_This(void) { - return PyString_FromString("this"); + return SWIG_Python_str_FromChar("this"); } SWIGRUNTIME PyObject * @@ -1920,11 +2080,16 @@ SWIG_This(void) /* #define SWIG_PYTHON_SLOW_GETSET_THIS */ -SWIGRUNTIME PySwigObject * +/* TODO: I don't know how to implement the fast getset in Python 3 right now */ +#if PY_VERSION_HEX>=0x03000000 +#define SWIG_PYTHON_SLOW_GETSET_THIS +#endif + +SWIGRUNTIME SwigPyObject * SWIG_Python_GetSwigThis(PyObject *pyobj) { - if (PySwigObject_Check(pyobj)) { - return (PySwigObject *) pyobj; + if (SwigPyObject_Check(pyobj)) { + return (SwigPyObject *) pyobj; } else { PyObject *obj = 0; #if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000)) @@ -1960,12 +2125,12 @@ SWIG_Python_GetSwigThis(PyObject *pyobj) return 0; } #endif - if (obj && !PySwigObject_Check(obj)) { + if (obj && !SwigPyObject_Check(obj)) { /* a PyObject is called 'this', try to get the 'real this' - PySwigObject from it */ + SwigPyObject from it */ return SWIG_Python_GetSwigThis(obj); } - return (PySwigObject *)obj; + return (SwigPyObject *)obj; } } @@ -1974,7 +2139,7 @@ SWIG_Python_GetSwigThis(PyObject *pyobj) SWIGRUNTIME int SWIG_Python_AcquirePtr(PyObject *obj, int own) { if (own == SWIG_POINTER_OWN) { - PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); + SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); if (sobj) { int oldown = sobj->own; sobj->own = own; @@ -1993,7 +2158,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int if (ptr) *ptr = 0; return SWIG_OK; } else { - PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); + SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); if (own) *own = 0; while (sobj) { @@ -2007,7 +2172,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int } else { swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); if (!tc) { - sobj = (PySwigObject *)sobj->next; + sobj = (SwigPyObject *)sobj->next; } else { if (ptr) { int newmemory = 0; @@ -2036,7 +2201,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int } else { int res = SWIG_ERROR; if (flags & SWIG_POINTER_IMPLICIT_CONV) { - PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0; + SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; if (data && !data->implicitconv) { PyObject *klass = data->klass; if (klass) { @@ -2049,7 +2214,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int impconv = 0; } if (impconv) { - PySwigObject *iobj = SWIG_Python_GetSwigThis(impconv); + SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv); if (iobj) { void *vptr; res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0); @@ -2087,10 +2252,10 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { /* here we get the method pointer for callbacks */ const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; - if (desc) { + if (desc) desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; - if (!desc) return SWIG_ERROR; - } + if (!desc) + return SWIG_ERROR; if (ty) { swig_cast_info *tc = SWIG_TypeCheck(desc,ty); if (tc) { @@ -2111,7 +2276,7 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { SWIGRUNTIME int SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { - swig_type_info *to = PySwigPacked_UnpackData(obj, ptr, sz); + swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz); if (!to) return SWIG_ERROR; if (ty) { if (to != ty) { @@ -2128,12 +2293,12 @@ SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *t * ----------------------------------------------------------------------------- */ /* - Create a new instance object, whitout calling __init__, and set the + Create a new instance object, without calling __init__, and set the 'this' attribute. */ SWIGRUNTIME PyObject* -SWIG_Python_NewShadowInstance(PySwigClientData *data, PyObject *swig_this) +SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) { #if (PY_VERSION_HEX >= 0x02020000) PyObject *inst = 0; @@ -2157,10 +2322,16 @@ SWIG_Python_NewShadowInstance(PySwigClientData *data, PyObject *swig_this) #endif } } else { +#if PY_VERSION_HEX >= 0x03000000 + inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None); + PyObject_SetAttr(inst, SWIG_This(), swig_this); + Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; +#else PyObject *dict = PyDict_New(); PyDict_SetItem(dict, SWIG_This(), swig_this); inst = PyInstance_NewRaw(data->newargs, dict); Py_DECREF(dict); +#endif } return inst; #else @@ -2223,9 +2394,9 @@ SWIG_Python_InitShadowInstance(PyObject *args) { if (!SWIG_Python_UnpackTuple(args,(char*)"swiginit", 2, 2, obj)) { return NULL; } else { - PySwigObject *sthis = SWIG_Python_GetSwigThis(obj[0]); + SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); if (sthis) { - PySwigObject_append((PyObject*) sthis, obj[1]); + SwigPyObject_append((PyObject*) sthis, obj[1]); } else { SWIG_Python_SetSwigThis(obj[0], obj[1]); } @@ -2241,8 +2412,8 @@ SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) { return SWIG_Py_Void(); } else { int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; - PyObject *robj = PySwigObject_New(ptr, type, own); - PySwigClientData *clientdata = type ? (PySwigClientData *)(type->clientdata) : 0; + PyObject *robj = SwigPyObject_New(ptr, type, own); + SwigPyClientData *clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0; if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); if (inst) { @@ -2258,7 +2429,7 @@ SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) { SWIGRUNTIMEINLINE PyObject * SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { - return ptr ? PySwigPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); + return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); } /* -----------------------------------------------------------------------------* @@ -2329,8 +2500,8 @@ SWIG_Python_DestroyModule(void *vptr) for (i =0; i < swig_module->size; ++i) { swig_type_info *ty = types[i]; if (ty->owndata) { - PySwigClientData *data = (PySwigClientData *) ty->clientdata; - if (data) PySwigClientData_Del(data); + SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; + if (data) SwigPyClientData_Del(data); } } Py_DECREF(SWIG_This()); @@ -2340,8 +2511,13 @@ SWIGRUNTIME void SWIG_Python_SetModule(swig_module_info *swig_module) { static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */ +#if PY_VERSION_HEX >= 0x03000000 + /* Add a dummy module object into sys.modules */ + PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION); +#else PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); +#endif PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); if (pointer && module) { PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); @@ -2361,7 +2537,7 @@ SWIGRUNTIME swig_type_info * SWIG_Python_TypeQuery(const char *type) { PyObject *cache = SWIG_Python_TypeCache(); - PyObject *key = PyString_FromString(type); + PyObject *key = SWIG_Python_str_FromChar(type); PyObject *obj = PyDict_GetItem(cache, key); swig_type_info *descriptor; if (obj) { @@ -2388,21 +2564,23 @@ SWIG_Python_TypeQuery(const char *type) SWIGRUNTIME int SWIG_Python_AddErrMesg(const char* mesg, int infront) -{ +{ if (PyErr_Occurred()) { PyObject *type = 0; PyObject *value = 0; PyObject *traceback = 0; PyErr_Fetch(&type, &value, &traceback); if (value) { + char *tmp; PyObject *old_str = PyObject_Str(value); Py_XINCREF(type); PyErr_Clear(); if (infront) { - PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str)); + PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str)); } else { - PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg); + PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); } + SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); } return 1; @@ -2425,9 +2603,9 @@ SWIG_Python_ArgFail(int argnum) } SWIGRUNTIMEINLINE const char * -PySwigObject_GetDesc(PyObject *self) +SwigPyObject_GetDesc(PyObject *self) { - PySwigObject *v = (PySwigObject *)self; + SwigPyObject *v = (SwigPyObject *)self; swig_type_info *ty = v ? v->ty : 0; return ty ? ty->str : (char*)""; } @@ -2437,10 +2615,10 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) { if (type) { #if defined(SWIG_COBJECT_TYPES) - if (obj && PySwigObject_Check(obj)) { - const char *otype = (const char *) PySwigObject_GetDesc(obj); + if (obj && SwigPyObject_Check(obj)) { + const char *otype = (const char *) SwigPyObject_GetDesc(obj); if (otype) { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'PySwigObject(%s)' is received", + PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received", type, otype); return; } @@ -2450,10 +2628,11 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) const char *otype = (obj ? obj->ob_type->tp_name : 0); if (otype) { PyObject *str = PyObject_Str(obj); - const char *cstr = str ? PyString_AsString(str) : 0; + const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0; if (cstr) { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", type, otype, cstr); + SWIG_Python_str_DelForPy3(cstr); } else { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); @@ -2475,10 +2654,12 @@ SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) void *result; if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { PyErr_Clear(); - if (flags & SWIG_POINTER_EXCEPTION) { +#if SWIG_POINTER_EXCEPTION + if (flags) { SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); SWIG_Python_ArgFail(argnum); } +#endif } return result; } @@ -2521,11 +2702,16 @@ static swig_module_info swig_module = {swig_types, 4, 0, 0, 0, 0}; /*----------------------------------------------- @(target):= verrormodule.so ------------------------------------------------*/ -#define SWIG_init initverrormodule +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_init PyInit_verrormodule +#else +# define SWIG_init initverrormodule + +#endif #define SWIG_name "verrormodule" -#define SWIGVERSION 0x010336 +#define SWIGVERSION 0x010340 #define SWIG_VERSION SWIGVERSION @@ -2537,28 +2723,28 @@ static swig_module_info swig_module = {swig_types, 4, 0, 0, 0, 0}; namespace swig { - class PyObject_ptr { + class SwigPtr_PyObject { protected: PyObject *_obj; public: - PyObject_ptr() :_obj(0) + SwigPtr_PyObject() :_obj(0) { } - PyObject_ptr(const PyObject_ptr& item) : _obj(item._obj) + SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj) { Py_XINCREF(_obj); } - PyObject_ptr(PyObject *obj, bool initial_ref = true) :_obj(obj) + SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj) { if (initial_ref) { Py_XINCREF(_obj); } } - PyObject_ptr & operator=(const PyObject_ptr& item) + SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) { Py_XINCREF(item._obj); Py_XDECREF(_obj); @@ -2566,7 +2752,7 @@ namespace swig { return *this; } - ~PyObject_ptr() + ~SwigPtr_PyObject() { Py_XDECREF(_obj); } @@ -2585,10 +2771,10 @@ namespace swig { namespace swig { - struct PyObject_var : PyObject_ptr { - PyObject_var(PyObject* obj = 0) : PyObject_ptr(obj, false) { } + struct SwigVar_PyObject : SwigPtr_PyObject { + SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { } - PyObject_var & operator = (PyObject* obj) + SwigVar_PyObject & operator = (PyObject* obj) { Py_XDECREF(_obj); _obj = obj; @@ -2623,10 +2809,28 @@ SWIG_pchar_descriptor(void) SWIGINTERN int SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) { - if (PyString_Check(obj)) { +#if PY_VERSION_HEX>=0x03000000 + if (PyUnicode_Check(obj)) +#else + if (PyString_Check(obj)) +#endif + { char *cstr; Py_ssize_t len; +#if PY_VERSION_HEX>=0x03000000 + if (!alloc && cptr) { + /* We can't allow converting without allocation, since the internal + representation of string in Python 3 is UCS-2/UCS-4 but we require + a UTF-8 representation. + TODO(bhy) More detailed explanation */ + return SWIG_RuntimeError; + } + obj = PyUnicode_AsUTF8String(obj); + PyBytes_AsStringAndSize(obj, &cstr, &len); + if(alloc) *alloc = SWIG_NEWOBJ; +#else PyString_AsStringAndSize(obj, &cstr, &len); - if (cptr) { +#endif + if (cptr) { if (alloc) { /* In python the user should not be able to modify the inner @@ -2651,10 +2855,16 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) *alloc = SWIG_OLDOBJ; } } else { - *cptr = PyString_AsString(obj); + #if PY_VERSION_HEX>=0x03000000 + assert(0); /* Should never reach here in Python 3 */ + #endif + *cptr = SWIG_Python_str_AsChar(obj); } } if (psize) *psize = len + 1; +#if PY_VERSION_HEX>=0x03000000 + Py_XDECREF(obj); +#endif return SWIG_OK; } else { swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); @@ -2860,7 +3070,11 @@ SWIG_FromCharPtrAndSize(const char* carray, size_t size) return pchar_descriptor ? SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void(); } else { +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_FromStringAndSize(carray, static_cast< int >(size)); +#else return PyString_FromStringAndSize(carray, static_cast< int >(size)); +#endif } } else { return SWIG_Py_Void(); @@ -3090,10 +3304,7 @@ SWIGINTERN PyObject *_wrap_VError_app__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py arg2 = *ptr; if (SWIG_IsNewObj(res)) delete ptr; } - { - vips::VError &_result_ref = (arg1)->app(arg2); - result = (vips::VError *) &_result_ref; - } + result = (vips::VError *) &(arg1)->app(arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_vips__VError, 0 | 0 ); return resultobj; fail: @@ -3124,10 +3335,7 @@ SWIGINTERN PyObject *_wrap_VError_app__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VError_app" "', argument " "2"" of type '" "int""'"); } arg2 = static_cast< int >(val2); - { - vips::VError &_result_ref = (arg1)->app(arg2); - result = (vips::VError *) &_result_ref; - } + result = (vips::VError *) &(arg1)->app(arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_vips__VError, 0 | 0 ); return resultobj; fail: @@ -3296,10 +3504,7 @@ SWIGINTERN PyObject *_wrap___lshift__(PyObject *SWIGUNUSEDPARM(self), PyObject * SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "__lshift__" "', argument " "2"" of type '" "vips::VError const &""'"); } arg2 = reinterpret_cast< vips::VError * >(argp2); - { - std::ostream &_result_ref = vips::operator <<(*arg1,(vips::VError const &)*arg2); - result = (std::ostream *) &_result_ref; - } + result = (std::ostream *) &vips::operator <<(*arg1,(vips::VError const &)*arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__ostream, 0 | 0 ); return resultobj; fail: @@ -3386,6 +3591,7 @@ fail: static PyMethodDef SwigMethods[] = { + { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL}, { (char *)"new_VError", _wrap_new_VError, METH_VARARGS, NULL}, { (char *)"delete_VError", _wrap_delete_VError, METH_VARARGS, NULL}, { (char *)"VError_perror", _wrap_VError_perror, METH_VARARGS, NULL}, @@ -3704,26 +3910,58 @@ extern "C" { SWIGINTERN PyObject * swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) { +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_InternFromString(""); +#else return PyString_FromString(""); +#endif } SWIGINTERN PyObject * swig_varlink_str(swig_varlinkobject *v) { +#if PY_VERSION_HEX >= 0x03000000 + PyObject *str = PyUnicode_InternFromString("("); + PyObject *tail; + PyObject *joined; + swig_globalvar *var; + for (var = v->vars; var; var=var->next) { + tail = PyUnicode_FromString(var->name); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; + if (var->next) { + tail = PyUnicode_InternFromString(", "); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; + } + } + tail = PyUnicode_InternFromString(")"); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; +#else PyObject *str = PyString_FromString("("); - swig_globalvar *var; + swig_globalvar *var; for (var = v->vars; var; var=var->next) { PyString_ConcatAndDel(&str,PyString_FromString(var->name)); if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", ")); } PyString_ConcatAndDel(&str,PyString_FromString(")")); +#endif return str; } SWIGINTERN int swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { + char *tmp; PyObject *str = swig_varlink_str(v); fprintf(fp,"Swig global variables "); - fprintf(fp,"%s\n", PyString_AsString(str)); + fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str)); + SWIG_Python_str_DelForPy3(tmp); Py_DECREF(str); return 0; } @@ -3781,12 +4019,17 @@ extern "C" { if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else PyObject_HEAD_INIT(NULL) 0, /* Number of items in variable part (ob_size) */ +#endif (char *)"swigvarlink", /* Type name (tp_name) */ sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */ 0, /* Itemsize (tp_itemsize) */ - (destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */ + (destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */ (printfunc) swig_varlink_print, /* Print (tp_print) */ (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */ (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */ @@ -3797,7 +4040,7 @@ extern "C" { 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ - (reprfunc)swig_varlink_str, /* tp_str */ + (reprfunc) swig_varlink_str, /* tp_str */ 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -3818,7 +4061,10 @@ extern "C" { #endif }; varlink_type = tmp; + /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 varlink_type.ob_type = &PyType_Type; +#endif type_init = 1; } return &varlink_type; @@ -3943,18 +4189,47 @@ extern "C" { #ifdef __cplusplus extern "C" #endif -SWIGEXPORT void SWIG_init(void) { - PyObject *m, *d; + +SWIGEXPORT +#if PY_VERSION_HEX >= 0x03000000 +PyObject* +#else +void +#endif +SWIG_init(void) { + PyObject *m, *d; +#if PY_VERSION_HEX >= 0x03000000 + static struct PyModuleDef SWIG_module = { + PyModuleDef_HEAD_INIT, + (char *) SWIG_name, + NULL, + -1, + SwigMethods, + NULL, + NULL, + NULL, + NULL + }; +#endif /* Fix SwigMethods to carry the callback ptrs when needed */ SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); +#if PY_VERSION_HEX >= 0x03000000 + m = PyModule_Create(&SWIG_module); +#else m = Py_InitModule((char *) SWIG_name, SwigMethods); +#endif d = PyModule_GetDict(m); SWIG_InitializeModule(0); SWIG_InstallConstants(d,swig_const_table); +#if PY_VERSION_HEX >= 0x03000000 + return m; +#else + return; +#endif } diff --git a/swig/python/vimagemodule.cpp b/swig/python/vimagemodule.cpp index 83cd3f12..b8b2c186 100644 --- a/swig/python/vimagemodule.cpp +++ b/swig/python/vimagemodule.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.36 + * Version 1.3.40 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -11,19 +11,23 @@ #define SWIGPYTHON #define SWIG_PYTHON_DIRECTOR_NO_VTABLE + #ifdef __cplusplus +/* SwigValueWrapper is described in swig.swg */ template class SwigValueWrapper { - T *tt; + struct SwigMovePointer { + T *ptr; + SwigMovePointer(T *p) : ptr(p) { } + ~SwigMovePointer() { delete ptr; } + SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper(const SwigValueWrapper& rhs); public: - SwigValueWrapper() : tt(0) { } - SwigValueWrapper(const SwigValueWrapper& rhs) : tt(new T(*rhs.tt)) { } - SwigValueWrapper(const T& t) : tt(new T(t)) { } - ~SwigValueWrapper() { delete tt; } - SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; } - operator T&() const { return *tt; } - T *operator&() { return tt; } -private: - SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper() : pointer(0) { } + SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } + operator T&() const { return *pointer.ptr; } + T *operator&() { return pointer.ptr; } }; template T SwigValueInit() { @@ -147,7 +151,7 @@ template T SwigValueInit() { /* ----------------------------------------------------------------------------- * swigrun.swg * - * This file contains generic CAPI SWIG runtime support for pointer + * This file contains generic C API SWIG runtime support for pointer * type checking. * ----------------------------------------------------------------------------- */ @@ -166,11 +170,11 @@ template T SwigValueInit() { /* You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for - creating a static or dynamic library from the swig runtime code. - In 99.9% of the cases, swig just needs to declare them as 'static'. + creating a static or dynamic library from the SWIG runtime code. + In 99.9% of the cases, SWIG just needs to declare them as 'static'. - But only do this if is strictly necessary, ie, if you have problems - with your compiler or so. + But only do this if strictly necessary, ie, if you have problems + with your compiler or suchlike. */ #ifndef SWIGRUNTIME @@ -197,14 +201,14 @@ template T SwigValueInit() { /* Flags/methods for returning states. - The swig conversion methods, as ConvertPtr, return and integer + The SWIG conversion methods, as ConvertPtr, return and integer that tells if the conversion was successful or not. And if not, an error code can be returned (see swigerrors.swg for the codes). Use the following macros/flags to set or process the returning states. - In old swig versions, you usually write code as: + In old versions of SWIG, code such as the following was usually written: if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { // success code @@ -212,7 +216,7 @@ template T SwigValueInit() { //fail code } - Now you can be more explicit as: + Now you can be more explicit: int res = SWIG_ConvertPtr(obj,vptr,ty.flags); if (SWIG_IsOK(res)) { @@ -221,7 +225,7 @@ template T SwigValueInit() { // fail code } - that seems to be the same, but now you can also do + which is the same really, but now you can also do Type *ptr; int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); @@ -239,7 +243,7 @@ template T SwigValueInit() { I.e., now SWIG_ConvertPtr can return new objects and you can identify the case and take care of the deallocation. Of course that - requires also to SWIG_ConvertPtr to return new result values, as + also requires SWIG_ConvertPtr to return new result values, such as int SWIG_ConvertPtr(obj, ptr,...) { if () { @@ -257,7 +261,7 @@ template T SwigValueInit() { Of course, returning the plain '0(success)/-1(fail)' still works, but you can be more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the - swig errors code. + SWIG errors code. Finally, if the SWIG_CASTRANK_MODE is enabled, the result code allows to return the 'cast rank', for example, if you have this @@ -271,9 +275,8 @@ template T SwigValueInit() { fooi(1) // cast rank '0' just use the SWIG_AddCast()/SWIG_CheckState() +*/ - - */ #define SWIG_OK (0) #define SWIG_ERROR (-1) #define SWIG_IsOK(r) (r >= 0) @@ -298,7 +301,6 @@ template T SwigValueInit() { #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) - /* Cast-Rank Mode */ #if defined(SWIG_CASTRANK_MODE) # ifndef SWIG_TypeRank @@ -321,8 +323,6 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) { #endif - - #include #ifdef __cplusplus @@ -419,40 +419,58 @@ SWIG_TypeCompare(const char *nb, const char *tb) { } -/* think of this as a c++ template<> or a scheme macro */ -#define SWIG_TypeCheck_Template(comparison, ty) \ - if (ty) { \ - swig_cast_info *iter = ty->cast; \ - while (iter) { \ - if (comparison) { \ - if (iter == ty->cast) return iter; \ - /* Move iter to the top of the linked list */ \ - iter->prev->next = iter->next; \ - if (iter->next) \ - iter->next->prev = iter->prev; \ - iter->next = ty->cast; \ - iter->prev = 0; \ - if (ty->cast) ty->cast->prev = iter; \ - ty->cast = iter; \ - return iter; \ - } \ - iter = iter->next; \ - } \ - } \ - return 0 - /* Check the typename */ SWIGRUNTIME swig_cast_info * SWIG_TypeCheck(const char *c, swig_type_info *ty) { - SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty); + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (strcmp(iter->type->name, c) == 0) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; } -/* Same as previous function, except strcmp is replaced with a pointer comparison */ +/* + Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison +*/ SWIGRUNTIME swig_cast_info * -SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { - SWIG_TypeCheck_Template(iter->type == from, into); +SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (iter->type == from) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; } /* @@ -731,6 +749,67 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { +/* Compatibility macros for Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 + +#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) +#define PyInt_Check(x) PyLong_Check(x) +#define PyInt_AsLong(x) PyLong_AsLong(x) +#define PyInt_FromLong(x) PyLong_FromLong(x) +#define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) + +#endif + +#ifndef Py_TYPE +# define Py_TYPE(op) ((op)->ob_type) +#endif + +/* SWIG APIs for compatibility of both Python 2 & 3 */ + +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_Python_str_FromFormat PyUnicode_FromFormat +#else +# define SWIG_Python_str_FromFormat PyString_FromFormat +#endif + + +/* Warning: This function will allocate a new string in Python 3, + * so please call SWIG_Python_str_DelForPy3(x) to free the space. + */ +SWIGINTERN char* +SWIG_Python_str_AsChar(PyObject *str) +{ +#if PY_VERSION_HEX >= 0x03000000 + char *cstr; + char *newstr; + Py_ssize_t len; + str = PyUnicode_AsUTF8String(str); + PyBytes_AsStringAndSize(str, &cstr, &len); + newstr = (char *) malloc(len+1); + memcpy(newstr, cstr, len+1); + Py_XDECREF(str); + return newstr; +#else + return PyString_AsString(str); +#endif +} + +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_Python_str_DelForPy3(x) free( (void*) (x) ) +#else +# define SWIG_Python_str_DelForPy3(x) +#endif + + +SWIGINTERN PyObject* +SWIG_Python_str_FromChar(const char *c) +{ +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_FromString(c); +#else + return PyString_FromString(c); +#endif +} /* Add PyOS_snprintf for old Pythons */ #if PY_VERSION_HEX < 0x02020000 @@ -777,6 +856,7 @@ PyString_FromFormat(const char *fmt, ...) { # define PyObject_GenericGetAttr 0 # endif #endif + /* Py_NotImplemented is defined in 2.1 and up. */ #if PY_VERSION_HEX < 0x02010000 # ifndef Py_NotImplemented @@ -784,7 +864,6 @@ PyString_FromFormat(const char *fmt, ...) { # endif #endif - /* A crude PyString_AsStringAndSize implementation for old Pythons */ #if PY_VERSION_HEX < 0x02010000 # ifndef PyString_AsStringAndSize @@ -799,7 +878,6 @@ PyString_FromFormat(const char *fmt, ...) { # endif #endif - /* PyBool_FromLong for old Pythons */ #if PY_VERSION_HEX < 0x02030000 static @@ -877,10 +955,13 @@ SWIG_Python_AddErrorMsg(const char* mesg) if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback); if (value) { + char *tmp; PyObject *old_str = PyObject_Str(value); PyErr_Clear(); Py_XINCREF(type); - PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg); + + PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); + SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); Py_DECREF(value); } else { @@ -888,8 +969,6 @@ SWIG_Python_AddErrorMsg(const char* mesg) } } - - #if defined(SWIG_PYTHON_NO_THREADS) # if defined(SWIG_PYTHON_THREADS) # undef SWIG_PYTHON_THREADS @@ -986,6 +1065,20 @@ typedef struct swig_const_info { swig_type_info **ptype; } swig_const_info; + +/* ----------------------------------------------------------------------------- + * Wrapper of PyInstanceMethod_New() used in Python 3 + * It is exported to the generated module, used for -fastproxy + * ----------------------------------------------------------------------------- */ +SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *self, PyObject *func) +{ +#if PY_VERSION_HEX >= 0x03000000 + return PyInstanceMethod_New(func); +#else + return NULL; +#endif +} + #ifdef __cplusplus #if 0 { /* cc-mode */ @@ -1038,7 +1131,7 @@ typedef struct swig_const_info { #define SWIG_GetModule(clientdata) SWIG_Python_GetModule() #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) -#define SWIG_NewClientData(obj) PySwigClientData_New(obj) +#define SWIG_NewClientData(obj) SwigPyClientData_New(obj) #define SWIG_SetErrorObj SWIG_Python_SetErrorObj #define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg @@ -1234,7 +1327,7 @@ SWIG_Py_Void(void) return none; } -/* PySwigClientData */ +/* SwigPyClientData */ typedef struct { PyObject *klass; @@ -1243,30 +1336,30 @@ typedef struct { PyObject *destroy; int delargs; int implicitconv; -} PySwigClientData; +} SwigPyClientData; SWIGRUNTIMEINLINE int SWIG_Python_CheckImplicit(swig_type_info *ty) { - PySwigClientData *data = (PySwigClientData *)ty->clientdata; + SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; return data ? data->implicitconv : 0; } SWIGRUNTIMEINLINE PyObject * SWIG_Python_ExceptionType(swig_type_info *desc) { - PySwigClientData *data = desc ? (PySwigClientData *) desc->clientdata : 0; + SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0; PyObject *klass = data ? data->klass : 0; return (klass ? klass : PyExc_RuntimeError); } -SWIGRUNTIME PySwigClientData * -PySwigClientData_New(PyObject* obj) +SWIGRUNTIME SwigPyClientData * +SwigPyClientData_New(PyObject* obj) { if (!obj) { return 0; } else { - PySwigClientData *data = (PySwigClientData *)malloc(sizeof(PySwigClientData)); + SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData)); /* the klass element */ data->klass = obj; Py_INCREF(data->klass); @@ -1314,14 +1407,14 @@ PySwigClientData_New(PyObject* obj) } SWIGRUNTIME void -PySwigClientData_Del(PySwigClientData* data) +SwigPyClientData_Del(SwigPyClientData* data) { Py_XDECREF(data->newraw); Py_XDECREF(data->newargs); Py_XDECREF(data->destroy); } -/* =============== PySwigObject =====================*/ +/* =============== SwigPyObject =====================*/ typedef struct { PyObject_HEAD @@ -1329,24 +1422,28 @@ typedef struct { swig_type_info *ty; int own; PyObject *next; -} PySwigObject; +} SwigPyObject; SWIGRUNTIME PyObject * -PySwigObject_long(PySwigObject *v) +SwigPyObject_long(SwigPyObject *v) { return PyLong_FromVoidPtr(v->ptr); } SWIGRUNTIME PyObject * -PySwigObject_format(const char* fmt, PySwigObject *v) +SwigPyObject_format(const char* fmt, SwigPyObject *v) { PyObject *res = NULL; PyObject *args = PyTuple_New(1); if (args) { - if (PyTuple_SetItem(args, 0, PySwigObject_long(v)) == 0) { - PyObject *ofmt = PyString_FromString(fmt); + if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) { + PyObject *ofmt = SWIG_Python_str_FromChar(fmt); if (ofmt) { +#if PY_VERSION_HEX >= 0x03000000 + res = PyUnicode_Format(ofmt,args); +#else res = PyString_Format(ofmt,args); +#endif Py_DECREF(ofmt); } Py_DECREF(args); @@ -1356,49 +1453,57 @@ PySwigObject_format(const char* fmt, PySwigObject *v) } SWIGRUNTIME PyObject * -PySwigObject_oct(PySwigObject *v) +SwigPyObject_oct(SwigPyObject *v) { - return PySwigObject_format("%o",v); + return SwigPyObject_format("%o",v); } SWIGRUNTIME PyObject * -PySwigObject_hex(PySwigObject *v) +SwigPyObject_hex(SwigPyObject *v) { - return PySwigObject_format("%x",v); + return SwigPyObject_format("%x",v); } SWIGRUNTIME PyObject * #ifdef METH_NOARGS -PySwigObject_repr(PySwigObject *v) +SwigPyObject_repr(SwigPyObject *v) #else -PySwigObject_repr(PySwigObject *v, PyObject *args) +SwigPyObject_repr(SwigPyObject *v, PyObject *args) #endif { const char *name = SWIG_TypePrettyName(v->ty); - PyObject *hex = PySwigObject_hex(v); - PyObject *repr = PyString_FromFormat("", name, PyString_AsString(hex)); - Py_DECREF(hex); + PyObject *repr = SWIG_Python_str_FromFormat("", name, v); if (v->next) { #ifdef METH_NOARGS - PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next); + PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); #else - PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next, args); + PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args); #endif +#if PY_VERSION_HEX >= 0x03000000 + PyObject *joined = PyUnicode_Concat(repr, nrep); + Py_DecRef(repr); + Py_DecRef(nrep); + repr = joined; +#else PyString_ConcatAndDel(&repr,nrep); +#endif } return repr; } SWIGRUNTIME int -PySwigObject_print(PySwigObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) +SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { + char *str; #ifdef METH_NOARGS - PyObject *repr = PySwigObject_repr(v); + PyObject *repr = SwigPyObject_repr(v); #else - PyObject *repr = PySwigObject_repr(v, NULL); + PyObject *repr = SwigPyObject_repr(v, NULL); #endif if (repr) { - fputs(PyString_AsString(repr), fp); + str = SWIG_Python_str_AsChar(repr); + fputs(str, fp); + SWIG_Python_str_DelForPy3(str); Py_DECREF(repr); return 0; } else { @@ -1407,53 +1512,71 @@ PySwigObject_print(PySwigObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) } SWIGRUNTIME PyObject * -PySwigObject_str(PySwigObject *v) +SwigPyObject_str(SwigPyObject *v) { char result[SWIG_BUFFER_SIZE]; return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ? - PyString_FromString(result) : 0; + SWIG_Python_str_FromChar(result) : 0; } SWIGRUNTIME int -PySwigObject_compare(PySwigObject *v, PySwigObject *w) +SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) { void *i = v->ptr; void *j = w->ptr; return (i < j) ? -1 : ((i > j) ? 1 : 0); } +/* Added for Python 3.x, would it also be useful for Python 2.x? */ +SWIGRUNTIME PyObject* +SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op) +{ + PyObject* res; + if( op != Py_EQ && op != Py_NE ) { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } + if( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ) + res = Py_True; + else + res = Py_False; + Py_INCREF(res); + return res; +} + + SWIGRUNTIME PyTypeObject* _PySwigObject_type(void); SWIGRUNTIME PyTypeObject* -PySwigObject_type(void) { +SwigPyObject_type(void) { static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type(); return type; } SWIGRUNTIMEINLINE int -PySwigObject_Check(PyObject *op) { - return ((op)->ob_type == PySwigObject_type()) - || (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0); +SwigPyObject_Check(PyObject *op) { + return (Py_TYPE(op) == SwigPyObject_type()) + || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); } SWIGRUNTIME PyObject * -PySwigObject_New(void *ptr, swig_type_info *ty, int own); +SwigPyObject_New(void *ptr, swig_type_info *ty, int own); SWIGRUNTIME void -PySwigObject_dealloc(PyObject *v) +SwigPyObject_dealloc(PyObject *v) { - PySwigObject *sobj = (PySwigObject *) v; + SwigPyObject *sobj = (SwigPyObject *) v; PyObject *next = sobj->next; if (sobj->own == SWIG_POINTER_OWN) { swig_type_info *ty = sobj->ty; - PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0; + SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; PyObject *destroy = data ? data->destroy : 0; if (destroy) { /* destroy is always a VARARGS method */ PyObject *res; if (data->delargs) { - /* we need to create a temporal object to carry the destroy operation */ - PyObject *tmp = PySwigObject_New(sobj->ptr, ty, 0); + /* we need to create a temporary object to carry the destroy operation */ + PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0); res = SWIG_Python_CallFunctor(destroy, tmp); Py_DECREF(tmp); } else { @@ -1475,15 +1598,15 @@ PySwigObject_dealloc(PyObject *v) } SWIGRUNTIME PyObject* -PySwigObject_append(PyObject* v, PyObject* next) +SwigPyObject_append(PyObject* v, PyObject* next) { - PySwigObject *sobj = (PySwigObject *) v; + SwigPyObject *sobj = (SwigPyObject *) v; #ifndef METH_O PyObject *tmp = 0; if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL; next = tmp; #endif - if (!PySwigObject_Check(next)) { + if (!SwigPyObject_Check(next)) { return NULL; } sobj->next = next; @@ -1493,12 +1616,12 @@ PySwigObject_append(PyObject* v, PyObject* next) SWIGRUNTIME PyObject* #ifdef METH_NOARGS -PySwigObject_next(PyObject* v) +SwigPyObject_next(PyObject* v) #else -PySwigObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { - PySwigObject *sobj = (PySwigObject *) v; + SwigPyObject *sobj = (SwigPyObject *) v; if (sobj->next) { Py_INCREF(sobj->next); return sobj->next; @@ -1509,30 +1632,30 @@ PySwigObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) SWIGINTERN PyObject* #ifdef METH_NOARGS -PySwigObject_disown(PyObject *v) +SwigPyObject_disown(PyObject *v) #else -PySwigObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { - PySwigObject *sobj = (PySwigObject *)v; + SwigPyObject *sobj = (SwigPyObject *)v; sobj->own = 0; return SWIG_Py_Void(); } SWIGINTERN PyObject* #ifdef METH_NOARGS -PySwigObject_acquire(PyObject *v) +SwigPyObject_acquire(PyObject *v) #else -PySwigObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { - PySwigObject *sobj = (PySwigObject *)v; + SwigPyObject *sobj = (SwigPyObject *)v; sobj->own = SWIG_POINTER_OWN; return SWIG_Py_Void(); } SWIGINTERN PyObject* -PySwigObject_own(PyObject *v, PyObject *args) +SwigPyObject_own(PyObject *v, PyObject *args) { PyObject *val = 0; #if (PY_VERSION_HEX < 0x02020000) @@ -1545,20 +1668,20 @@ PySwigObject_own(PyObject *v, PyObject *args) } else { - PySwigObject *sobj = (PySwigObject *)v; + SwigPyObject *sobj = (SwigPyObject *)v; PyObject *obj = PyBool_FromLong(sobj->own); if (val) { #ifdef METH_NOARGS if (PyObject_IsTrue(val)) { - PySwigObject_acquire(v); + SwigPyObject_acquire(v); } else { - PySwigObject_disown(v); + SwigPyObject_disown(v); } #else if (PyObject_IsTrue(val)) { - PySwigObject_acquire(v,args); + SwigPyObject_acquire(v,args); } else { - PySwigObject_disown(v,args); + SwigPyObject_disown(v,args); } #endif } @@ -1569,30 +1692,30 @@ PySwigObject_own(PyObject *v, PyObject *args) #ifdef METH_O static PyMethodDef swigobject_methods[] = { - {(char *)"disown", (PyCFunction)PySwigObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)PySwigObject_append, METH_O, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)PySwigObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)PySwigObject_repr, METH_NOARGS, (char *)"returns object representation"}, + {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"}, + {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, + {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"}, + {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, + {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"}, {0, 0, 0, 0} }; #else static PyMethodDef swigobject_methods[] = { - {(char *)"disown", (PyCFunction)PySwigObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)PySwigObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)PySwigObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)PySwigObject_repr, METH_VARARGS, (char *)"returns object representation"}, + {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"}, + {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, + {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, + {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, + {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"}, {0, 0, 0, 0} }; #endif #if PY_VERSION_HEX < 0x02020000 SWIGINTERN PyObject * -PySwigObject_getattr(PySwigObject *sobj,char *name) +SwigPyObject_getattr(SwigPyObject *sobj,char *name) { return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name); } @@ -1602,11 +1725,14 @@ SWIGRUNTIME PyTypeObject* _PySwigObject_type(void) { static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; - static PyNumberMethods PySwigObject_as_number = { + static PyNumberMethods SwigPyObject_as_number = { (binaryfunc)0, /*nb_add*/ (binaryfunc)0, /*nb_subtract*/ (binaryfunc)0, /*nb_multiply*/ + /* nb_divide removed in Python 3 */ +#if PY_VERSION_HEX < 0x03000000 (binaryfunc)0, /*nb_divide*/ +#endif (binaryfunc)0, /*nb_remainder*/ (binaryfunc)0, /*nb_divmod*/ (ternaryfunc)0,/*nb_power*/ @@ -1620,13 +1746,23 @@ _PySwigObject_type(void) { 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ - (coercion)0, /*nb_coerce*/ - (unaryfunc)PySwigObject_long, /*nb_int*/ - (unaryfunc)PySwigObject_long, /*nb_long*/ +#if PY_VERSION_HEX < 0x03000000 + 0, /*nb_coerce*/ +#endif + (unaryfunc)SwigPyObject_long, /*nb_int*/ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc)SwigPyObject_long, /*nb_long*/ +#else + 0, /*nb_reserved*/ +#endif (unaryfunc)0, /*nb_float*/ - (unaryfunc)PySwigObject_oct, /*nb_oct*/ - (unaryfunc)PySwigObject_hex, /*nb_hex*/ -#if PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc)SwigPyObject_oct, /*nb_oct*/ + (unaryfunc)SwigPyObject_hex, /*nb_hex*/ +#endif +#if PY_VERSION_HEX >= 0x03000000 /* 3.0 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ +#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ #elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ @@ -1635,32 +1771,41 @@ _PySwigObject_type(void) { #endif }; - static PyTypeObject pyswigobject_type; + static PyTypeObject swigpyobject_type; static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else PyObject_HEAD_INIT(NULL) 0, /* ob_size */ - (char *)"PySwigObject", /* tp_name */ - sizeof(PySwigObject), /* tp_basicsize */ +#endif + (char *)"SwigPyObject", /* tp_name */ + sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ - (destructor)PySwigObject_dealloc, /* tp_dealloc */ - (printfunc)PySwigObject_print, /* tp_print */ + (destructor)SwigPyObject_dealloc, /* tp_dealloc */ + (printfunc)SwigPyObject_print, /* tp_print */ #if PY_VERSION_HEX < 0x02020000 - (getattrfunc)PySwigObject_getattr, /* tp_getattr */ + (getattrfunc)SwigPyObject_getattr, /* tp_getattr */ #else (getattrfunc)0, /* tp_getattr */ #endif (setattrfunc)0, /* tp_setattr */ - (cmpfunc)PySwigObject_compare, /* tp_compare */ - (reprfunc)PySwigObject_repr, /* tp_repr */ - &PySwigObject_as_number, /* tp_as_number */ +#if PY_VERSION_HEX >= 0x03000000 + 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ +#else + (cmpfunc)SwigPyObject_compare, /* tp_compare */ +#endif + (reprfunc)SwigPyObject_repr, /* tp_repr */ + &SwigPyObject_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ (hashfunc)0, /* tp_hash */ (ternaryfunc)0, /* tp_call */ - (reprfunc)PySwigObject_str, /* tp_str */ + (reprfunc)SwigPyObject_str, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -1668,7 +1813,7 @@ _PySwigObject_type(void) { swigobject_doc, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ - 0, /* tp_richcompare */ + (richcmpfunc)SwigPyObject_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ #if PY_VERSION_HEX >= 0x02020000 0, /* tp_iter */ @@ -1685,11 +1830,11 @@ _PySwigObject_type(void) { 0, /* tp_alloc */ 0, /* tp_new */ 0, /* tp_free */ - 0, /* tp_is_gc */ + 0, /* tp_is_gc */ 0, /* tp_bases */ 0, /* tp_mro */ 0, /* tp_cache */ - 0, /* tp_subclasses */ + 0, /* tp_subclasses */ 0, /* tp_weaklist */ #endif #if PY_VERSION_HEX >= 0x02030000 @@ -1699,17 +1844,20 @@ _PySwigObject_type(void) { 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; - pyswigobject_type = tmp; - pyswigobject_type.ob_type = &PyType_Type; + swigpyobject_type = tmp; + /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 + swigpyobject_type.ob_type = &PyType_Type; +#endif type_init = 1; } - return &pyswigobject_type; + return &swigpyobject_type; } SWIGRUNTIME PyObject * -PySwigObject_New(void *ptr, swig_type_info *ty, int own) +SwigPyObject_New(void *ptr, swig_type_info *ty, int own) { - PySwigObject *sobj = PyObject_NEW(PySwigObject, PySwigObject_type()); + SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); if (sobj) { sobj->ptr = ptr; sobj->ty = ty; @@ -1728,10 +1876,10 @@ typedef struct { void *pack; swig_type_info *ty; size_t size; -} PySwigPacked; +} SwigPyPacked; SWIGRUNTIME int -PySwigPacked_print(PySwigPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) +SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { char result[SWIG_BUFFER_SIZE]; fputs("pack, v->size, 0, sizeof(result))) { - return PyString_FromFormat("", result, v->ty->name); + return SWIG_Python_str_FromFormat("", result, v->ty->name); } else { - return PyString_FromFormat("", v->ty->name); + return SWIG_Python_str_FromFormat("", v->ty->name); } } SWIGRUNTIME PyObject * -PySwigPacked_str(PySwigPacked *v) +SwigPyPacked_str(SwigPyPacked *v) { char result[SWIG_BUFFER_SIZE]; if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ - return PyString_FromFormat("%s%s", result, v->ty->name); + return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name); } else { - return PyString_FromString(v->ty->name); + return SWIG_Python_str_FromChar(v->ty->name); } } SWIGRUNTIME int -PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w) +SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) { size_t i = v->size; size_t j = w->size; @@ -1778,22 +1926,22 @@ PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w) SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void); SWIGRUNTIME PyTypeObject* -PySwigPacked_type(void) { +SwigPyPacked_type(void) { static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigPacked_type(); return type; } SWIGRUNTIMEINLINE int -PySwigPacked_Check(PyObject *op) { +SwigPyPacked_Check(PyObject *op) { return ((op)->ob_type == _PySwigPacked_type()) - || (strcmp((op)->ob_type->tp_name,"PySwigPacked") == 0); + || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); } SWIGRUNTIME void -PySwigPacked_dealloc(PyObject *v) +SwigPyPacked_dealloc(PyObject *v) { - if (PySwigPacked_Check(v)) { - PySwigPacked *sobj = (PySwigPacked *) v; + if (SwigPyPacked_Check(v)) { + SwigPyPacked *sobj = (SwigPyPacked *) v; free(sobj->pack); } PyObject_DEL(v); @@ -1802,28 +1950,37 @@ PySwigPacked_dealloc(PyObject *v) SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void) { static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; - static PyTypeObject pyswigpacked_type; + static PyTypeObject swigpypacked_type; static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX>=0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ - (char *)"PySwigPacked", /* tp_name */ - sizeof(PySwigPacked), /* tp_basicsize */ + 0, /* ob_size */ +#endif + (char *)"SwigPyPacked", /* tp_name */ + sizeof(SwigPyPacked), /* tp_basicsize */ 0, /* tp_itemsize */ - (destructor)PySwigPacked_dealloc, /* tp_dealloc */ - (printfunc)PySwigPacked_print, /* tp_print */ + (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ + (printfunc)SwigPyPacked_print, /* tp_print */ (getattrfunc)0, /* tp_getattr */ (setattrfunc)0, /* tp_setattr */ - (cmpfunc)PySwigPacked_compare, /* tp_compare */ - (reprfunc)PySwigPacked_repr, /* tp_repr */ - 0, /* tp_as_number */ +#if PY_VERSION_HEX>=0x03000000 + 0, /* tp_reserved in 3.0.1 */ +#else + (cmpfunc)SwigPyPacked_compare, /* tp_compare */ +#endif + (reprfunc)SwigPyPacked_repr, /* tp_repr */ + 0, /* tp_as_number */ 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - (reprfunc)PySwigPacked_str, /* tp_str */ + 0, /* tp_as_mapping */ + (hashfunc)0, /* tp_hash */ + (ternaryfunc)0, /* tp_call */ + (reprfunc)SwigPyPacked_str, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -1862,17 +2019,20 @@ _PySwigPacked_type(void) { 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; - pyswigpacked_type = tmp; - pyswigpacked_type.ob_type = &PyType_Type; + swigpypacked_type = tmp; + /* for Python 3 the ob_type already assigned in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 + swigpypacked_type.ob_type = &PyType_Type; +#endif type_init = 1; } - return &pyswigpacked_type; + return &swigpypacked_type; } SWIGRUNTIME PyObject * -PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty) +SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) { - PySwigPacked *sobj = PyObject_NEW(PySwigPacked, PySwigPacked_type()); + SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); if (sobj) { void *pack = malloc(size); if (pack) { @@ -1889,10 +2049,10 @@ PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty) } SWIGRUNTIME swig_type_info * -PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size) +SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) { - if (PySwigPacked_Check(obj)) { - PySwigPacked *sobj = (PySwigPacked *)obj; + if (SwigPyPacked_Check(obj)) { + SwigPyPacked *sobj = (SwigPyPacked *)obj; if (sobj->size != size) return 0; memcpy(ptr, sobj->pack, size); return sobj->ty; @@ -1908,7 +2068,7 @@ PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size) SWIGRUNTIMEINLINE PyObject * _SWIG_This(void) { - return PyString_FromString("this"); + return SWIG_Python_str_FromChar("this"); } SWIGRUNTIME PyObject * @@ -1920,11 +2080,16 @@ SWIG_This(void) /* #define SWIG_PYTHON_SLOW_GETSET_THIS */ -SWIGRUNTIME PySwigObject * +/* TODO: I don't know how to implement the fast getset in Python 3 right now */ +#if PY_VERSION_HEX>=0x03000000 +#define SWIG_PYTHON_SLOW_GETSET_THIS +#endif + +SWIGRUNTIME SwigPyObject * SWIG_Python_GetSwigThis(PyObject *pyobj) { - if (PySwigObject_Check(pyobj)) { - return (PySwigObject *) pyobj; + if (SwigPyObject_Check(pyobj)) { + return (SwigPyObject *) pyobj; } else { PyObject *obj = 0; #if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000)) @@ -1960,12 +2125,12 @@ SWIG_Python_GetSwigThis(PyObject *pyobj) return 0; } #endif - if (obj && !PySwigObject_Check(obj)) { + if (obj && !SwigPyObject_Check(obj)) { /* a PyObject is called 'this', try to get the 'real this' - PySwigObject from it */ + SwigPyObject from it */ return SWIG_Python_GetSwigThis(obj); } - return (PySwigObject *)obj; + return (SwigPyObject *)obj; } } @@ -1974,7 +2139,7 @@ SWIG_Python_GetSwigThis(PyObject *pyobj) SWIGRUNTIME int SWIG_Python_AcquirePtr(PyObject *obj, int own) { if (own == SWIG_POINTER_OWN) { - PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); + SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); if (sobj) { int oldown = sobj->own; sobj->own = own; @@ -1993,7 +2158,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int if (ptr) *ptr = 0; return SWIG_OK; } else { - PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); + SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); if (own) *own = 0; while (sobj) { @@ -2007,7 +2172,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int } else { swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); if (!tc) { - sobj = (PySwigObject *)sobj->next; + sobj = (SwigPyObject *)sobj->next; } else { if (ptr) { int newmemory = 0; @@ -2036,7 +2201,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int } else { int res = SWIG_ERROR; if (flags & SWIG_POINTER_IMPLICIT_CONV) { - PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0; + SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; if (data && !data->implicitconv) { PyObject *klass = data->klass; if (klass) { @@ -2049,7 +2214,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int impconv = 0; } if (impconv) { - PySwigObject *iobj = SWIG_Python_GetSwigThis(impconv); + SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv); if (iobj) { void *vptr; res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0); @@ -2087,10 +2252,10 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { /* here we get the method pointer for callbacks */ const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; - if (desc) { + if (desc) desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; - if (!desc) return SWIG_ERROR; - } + if (!desc) + return SWIG_ERROR; if (ty) { swig_cast_info *tc = SWIG_TypeCheck(desc,ty); if (tc) { @@ -2111,7 +2276,7 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { SWIGRUNTIME int SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { - swig_type_info *to = PySwigPacked_UnpackData(obj, ptr, sz); + swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz); if (!to) return SWIG_ERROR; if (ty) { if (to != ty) { @@ -2128,12 +2293,12 @@ SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *t * ----------------------------------------------------------------------------- */ /* - Create a new instance object, whitout calling __init__, and set the + Create a new instance object, without calling __init__, and set the 'this' attribute. */ SWIGRUNTIME PyObject* -SWIG_Python_NewShadowInstance(PySwigClientData *data, PyObject *swig_this) +SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) { #if (PY_VERSION_HEX >= 0x02020000) PyObject *inst = 0; @@ -2157,10 +2322,16 @@ SWIG_Python_NewShadowInstance(PySwigClientData *data, PyObject *swig_this) #endif } } else { +#if PY_VERSION_HEX >= 0x03000000 + inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None); + PyObject_SetAttr(inst, SWIG_This(), swig_this); + Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; +#else PyObject *dict = PyDict_New(); PyDict_SetItem(dict, SWIG_This(), swig_this); inst = PyInstance_NewRaw(data->newargs, dict); Py_DECREF(dict); +#endif } return inst; #else @@ -2223,9 +2394,9 @@ SWIG_Python_InitShadowInstance(PyObject *args) { if (!SWIG_Python_UnpackTuple(args,(char*)"swiginit", 2, 2, obj)) { return NULL; } else { - PySwigObject *sthis = SWIG_Python_GetSwigThis(obj[0]); + SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); if (sthis) { - PySwigObject_append((PyObject*) sthis, obj[1]); + SwigPyObject_append((PyObject*) sthis, obj[1]); } else { SWIG_Python_SetSwigThis(obj[0], obj[1]); } @@ -2241,8 +2412,8 @@ SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) { return SWIG_Py_Void(); } else { int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; - PyObject *robj = PySwigObject_New(ptr, type, own); - PySwigClientData *clientdata = type ? (PySwigClientData *)(type->clientdata) : 0; + PyObject *robj = SwigPyObject_New(ptr, type, own); + SwigPyClientData *clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0; if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); if (inst) { @@ -2258,7 +2429,7 @@ SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) { SWIGRUNTIMEINLINE PyObject * SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { - return ptr ? PySwigPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); + return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); } /* -----------------------------------------------------------------------------* @@ -2329,8 +2500,8 @@ SWIG_Python_DestroyModule(void *vptr) for (i =0; i < swig_module->size; ++i) { swig_type_info *ty = types[i]; if (ty->owndata) { - PySwigClientData *data = (PySwigClientData *) ty->clientdata; - if (data) PySwigClientData_Del(data); + SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; + if (data) SwigPyClientData_Del(data); } } Py_DECREF(SWIG_This()); @@ -2340,8 +2511,13 @@ SWIGRUNTIME void SWIG_Python_SetModule(swig_module_info *swig_module) { static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */ +#if PY_VERSION_HEX >= 0x03000000 + /* Add a dummy module object into sys.modules */ + PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION); +#else PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); +#endif PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); if (pointer && module) { PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); @@ -2361,7 +2537,7 @@ SWIGRUNTIME swig_type_info * SWIG_Python_TypeQuery(const char *type) { PyObject *cache = SWIG_Python_TypeCache(); - PyObject *key = PyString_FromString(type); + PyObject *key = SWIG_Python_str_FromChar(type); PyObject *obj = PyDict_GetItem(cache, key); swig_type_info *descriptor; if (obj) { @@ -2388,21 +2564,23 @@ SWIG_Python_TypeQuery(const char *type) SWIGRUNTIME int SWIG_Python_AddErrMesg(const char* mesg, int infront) -{ +{ if (PyErr_Occurred()) { PyObject *type = 0; PyObject *value = 0; PyObject *traceback = 0; PyErr_Fetch(&type, &value, &traceback); if (value) { + char *tmp; PyObject *old_str = PyObject_Str(value); Py_XINCREF(type); PyErr_Clear(); if (infront) { - PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str)); + PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str)); } else { - PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg); + PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); } + SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); } return 1; @@ -2425,9 +2603,9 @@ SWIG_Python_ArgFail(int argnum) } SWIGRUNTIMEINLINE const char * -PySwigObject_GetDesc(PyObject *self) +SwigPyObject_GetDesc(PyObject *self) { - PySwigObject *v = (PySwigObject *)self; + SwigPyObject *v = (SwigPyObject *)self; swig_type_info *ty = v ? v->ty : 0; return ty ? ty->str : (char*)""; } @@ -2437,10 +2615,10 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) { if (type) { #if defined(SWIG_COBJECT_TYPES) - if (obj && PySwigObject_Check(obj)) { - const char *otype = (const char *) PySwigObject_GetDesc(obj); + if (obj && SwigPyObject_Check(obj)) { + const char *otype = (const char *) SwigPyObject_GetDesc(obj); if (otype) { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'PySwigObject(%s)' is received", + PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received", type, otype); return; } @@ -2450,10 +2628,11 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) const char *otype = (obj ? obj->ob_type->tp_name : 0); if (otype) { PyObject *str = PyObject_Str(obj); - const char *cstr = str ? PyString_AsString(str) : 0; + const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0; if (cstr) { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", type, otype, cstr); + SWIG_Python_str_DelForPy3(cstr); } else { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); @@ -2475,10 +2654,12 @@ SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) void *result; if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { PyErr_Clear(); - if (flags & SWIG_POINTER_EXCEPTION) { +#if SWIG_POINTER_EXCEPTION + if (flags) { SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); SWIG_Python_ArgFail(argnum); } +#endif } return result; } @@ -2527,7 +2708,7 @@ SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) #define SWIGTYPE_p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t swig_types[20] #define SWIGTYPE_p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t__allocator_type swig_types[21] #define SWIGTYPE_p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t__value_type swig_types[22] -#define SWIGTYPE_p_swig__PySwigIterator swig_types[23] +#define SWIGTYPE_p_swig__SwigPyIterator swig_types[23] #define SWIGTYPE_p_value_type swig_types[24] #define SWIGTYPE_p_vips__VDMask swig_types[25] #define SWIGTYPE_p_vips__VDisplay swig_types[26] @@ -2551,11 +2732,16 @@ static swig_module_info swig_module = {swig_types, 31, 0, 0, 0, 0}; /*----------------------------------------------- @(target):= vimagemodule.so ------------------------------------------------*/ -#define SWIG_init initvimagemodule +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_init PyInit_vimagemodule +#else +# define SWIG_init initvimagemodule + +#endif #define SWIG_name "vimagemodule" -#define SWIGVERSION 0x010336 +#define SWIGVERSION 0x010340 #define SWIG_VERSION SWIGVERSION @@ -2567,28 +2753,28 @@ static swig_module_info swig_module = {swig_types, 31, 0, 0, 0, 0}; namespace swig { - class PyObject_ptr { + class SwigPtr_PyObject { protected: PyObject *_obj; public: - PyObject_ptr() :_obj(0) + SwigPtr_PyObject() :_obj(0) { } - PyObject_ptr(const PyObject_ptr& item) : _obj(item._obj) + SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj) { Py_XINCREF(_obj); } - PyObject_ptr(PyObject *obj, bool initial_ref = true) :_obj(obj) + SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj) { if (initial_ref) { Py_XINCREF(_obj); } } - PyObject_ptr & operator=(const PyObject_ptr& item) + SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) { Py_XINCREF(item._obj); Py_XDECREF(_obj); @@ -2596,7 +2782,7 @@ namespace swig { return *this; } - ~PyObject_ptr() + ~SwigPtr_PyObject() { Py_XDECREF(_obj); } @@ -2615,10 +2801,10 @@ namespace swig { namespace swig { - struct PyObject_var : PyObject_ptr { - PyObject_var(PyObject* obj = 0) : PyObject_ptr(obj, false) { } + struct SwigVar_PyObject : SwigPtr_PyObject { + SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { } - PyObject_var & operator = (PyObject* obj) + SwigVar_PyObject & operator = (PyObject* obj) { Py_XDECREF(_obj); _obj = obj; @@ -2657,43 +2843,43 @@ namespace swig { struct stop_iteration { }; - struct PySwigIterator { + struct SwigPyIterator { private: - PyObject_ptr _seq; + SwigPtr_PyObject _seq; protected: - PySwigIterator(PyObject *seq) : _seq(seq) + SwigPyIterator(PyObject *seq) : _seq(seq) { } public: - virtual ~PySwigIterator() {} + virtual ~SwigPyIterator() {} // Access iterator method, required by Python virtual PyObject *value() const = 0; // Forward iterator method, required by Python - virtual PySwigIterator *incr(size_t n = 1) = 0; + virtual SwigPyIterator *incr(size_t n = 1) = 0; // Backward iterator method, very common in C++, but not required in Python - virtual PySwigIterator *decr(size_t /*n*/ = 1) + virtual SwigPyIterator *decr(size_t /*n*/ = 1) { throw stop_iteration(); } // Random access iterator methods, but not required in Python - virtual ptrdiff_t distance(const PySwigIterator &/*x*/) const + virtual ptrdiff_t distance(const SwigPyIterator &/*x*/) const { throw std::invalid_argument("operation not supported"); } - virtual bool equal (const PySwigIterator &/*x*/) const + virtual bool equal (const SwigPyIterator &/*x*/) const { throw std::invalid_argument("operation not supported"); } // C++ common/needed methods - virtual PySwigIterator *copy() const = 0; + virtual SwigPyIterator *copy() const = 0; PyObject *next() { @@ -2704,6 +2890,12 @@ namespace swig { return obj; } + /* Make an alias for Python 3.x */ + PyObject *__next__() + { + return next(); + } + PyObject *previous() { SWIG_PYTHON_THREAD_BEGIN_BLOCK; // disable threads @@ -2713,42 +2905,42 @@ namespace swig { return obj; } - PySwigIterator *advance(ptrdiff_t n) + SwigPyIterator *advance(ptrdiff_t n) { return (n > 0) ? incr(n) : decr(-n); } - bool operator == (const PySwigIterator& x) const + bool operator == (const SwigPyIterator& x) const { return equal(x); } - bool operator != (const PySwigIterator& x) const + bool operator != (const SwigPyIterator& x) const { return ! operator==(x); } - PySwigIterator& operator += (ptrdiff_t n) + SwigPyIterator& operator += (ptrdiff_t n) { return *advance(n); } - PySwigIterator& operator -= (ptrdiff_t n) + SwigPyIterator& operator -= (ptrdiff_t n) { return *advance(-n); } - PySwigIterator* operator + (ptrdiff_t n) const + SwigPyIterator* operator + (ptrdiff_t n) const { return copy()->advance(n); } - PySwigIterator* operator - (ptrdiff_t n) const + SwigPyIterator* operator - (ptrdiff_t n) const { return copy()->advance(-n); } - ptrdiff_t operator - (const PySwigIterator& x) const + ptrdiff_t operator - (const SwigPyIterator& x) const { return x.distance(*this); } @@ -2757,7 +2949,7 @@ namespace swig { static int init = 0; static swig_type_info* desc = 0; if (!init) { - desc = SWIG_TypeQuery("swig::PySwigIterator *"); + desc = SWIG_TypeQuery("swig::SwigPyIterator *"); init = 1; } return desc; @@ -3099,7 +3291,7 @@ namespace swig { struct traits_asptr { static int asptr(PyObject *obj, Type **val) { Type *p; - int res = (SWIG_ConvertPtr(obj, (void**)&p, type_info(), 0) == SWIG_OK) ? SWIG_OLDOBJ : 0; + int res = SWIG_ConvertPtr(obj, (void**)&p, type_info(), 0); if (SWIG_IsOK(res)) { if (val) *val = p; } @@ -3254,27 +3446,38 @@ namespace std { { bool res; SWIG_PYTHON_THREAD_BEGIN_BLOCK; - res = PyObject_Compare(v, w) < 0; + res = PyObject_RichCompareBool(v, w, Py_LT) ? true : false; + /* This may fall into a case of inconsistent + eg. ObjA > ObjX > ObjB + but ObjA < ObjB + */ + if( PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_TypeError) ) + { + /* Objects can't be compared, this mostly occurred in Python 3.0 */ + /* Compare their ptr directly for a workaround */ + res = (v < w); + PyErr_Clear(); + } SWIG_PYTHON_THREAD_END_BLOCK; return res; } }; template <> - struct less : public binary_function + struct less : public binary_function { bool - operator()(const swig::PyObject_ptr& v, const swig::PyObject_ptr& w) const + operator()(const swig::SwigPtr_PyObject& v, const swig::SwigPtr_PyObject& w) const { return std::less()(v, w); } }; template <> - struct less : public binary_function + struct less : public binary_function { bool - operator()(const swig::PyObject_var& v, const swig::PyObject_var& w) const + operator()(const swig::SwigVar_PyObject& v, const swig::SwigVar_PyObject& w) const { return std::less()(v, w); } @@ -3460,15 +3663,15 @@ namespace std { namespace swig { template - class PySwigIterator_T : public PySwigIterator + class SwigPyIterator_T : public SwigPyIterator { public: typedef OutIterator out_iterator; typedef typename std::iterator_traits::value_type value_type; - typedef PySwigIterator_T self_type; + typedef SwigPyIterator_T self_type; - PySwigIterator_T(out_iterator curr, PyObject *seq) - : PySwigIterator(seq), current(curr) + SwigPyIterator_T(out_iterator curr, PyObject *seq) + : SwigPyIterator(seq), current(curr) { } @@ -3478,7 +3681,7 @@ namespace swig { } - bool equal (const PySwigIterator &iter) const + bool equal (const SwigPyIterator &iter) const { const self_type *iters = dynamic_cast(&iter); if (iters) { @@ -3488,7 +3691,7 @@ namespace swig { } } - ptrdiff_t distance(const PySwigIterator &iter) const + ptrdiff_t distance(const SwigPyIterator &iter) const { const self_type *iters = dynamic_cast(&iter); if (iters) { @@ -3516,17 +3719,17 @@ namespace swig { template::value_type, typename FromOper = from_oper > - class PySwigIteratorOpen_T : public PySwigIterator_T + class SwigPyIteratorOpen_T : public SwigPyIterator_T { public: FromOper from; typedef OutIterator out_iterator; typedef ValueType value_type; - typedef PySwigIterator_T base; - typedef PySwigIteratorOpen_T self_type; + typedef SwigPyIterator_T base; + typedef SwigPyIteratorOpen_T self_type; - PySwigIteratorOpen_T(out_iterator curr, PyObject *seq) - : PySwigIterator_T(curr, seq) + SwigPyIteratorOpen_T(out_iterator curr, PyObject *seq) + : SwigPyIterator_T(curr, seq) { } @@ -3534,12 +3737,12 @@ namespace swig { return from(static_cast(*(base::current))); } - PySwigIterator *copy() const + SwigPyIterator *copy() const { return new self_type(*this); } - PySwigIterator *incr(size_t n = 1) + SwigPyIterator *incr(size_t n = 1) { while (n--) { ++base::current; @@ -3547,7 +3750,7 @@ namespace swig { return this; } - PySwigIterator *decr(size_t n = 1) + SwigPyIterator *decr(size_t n = 1) { while (n--) { --base::current; @@ -3559,17 +3762,17 @@ namespace swig { template::value_type, typename FromOper = from_oper > - class PySwigIteratorClosed_T : public PySwigIterator_T + class SwigPyIteratorClosed_T : public SwigPyIterator_T { public: FromOper from; typedef OutIterator out_iterator; typedef ValueType value_type; - typedef PySwigIterator_T base; - typedef PySwigIteratorClosed_T self_type; + typedef SwigPyIterator_T base; + typedef SwigPyIteratorClosed_T self_type; - PySwigIteratorClosed_T(out_iterator curr, out_iterator first, out_iterator last, PyObject *seq) - : PySwigIterator_T(curr, seq), begin(first), end(last) + SwigPyIteratorClosed_T(out_iterator curr, out_iterator first, out_iterator last, PyObject *seq) + : SwigPyIterator_T(curr, seq), begin(first), end(last) { } @@ -3581,12 +3784,12 @@ namespace swig { } } - PySwigIterator *copy() const + SwigPyIterator *copy() const { return new self_type(*this); } - PySwigIterator *incr(size_t n = 1) + SwigPyIterator *incr(size_t n = 1) { while (n--) { if (base::current == end) { @@ -3598,7 +3801,7 @@ namespace swig { return this; } - PySwigIterator *decr(size_t n = 1) + SwigPyIterator *decr(size_t n = 1) { while (n--) { if (base::current == begin) { @@ -3616,17 +3819,17 @@ namespace swig { }; template - inline PySwigIterator* + inline SwigPyIterator* make_output_iterator(const OutIter& current, const OutIter& begin,const OutIter& end, PyObject *seq = 0) { - return new PySwigIteratorClosed_T(current, begin, end, seq); + return new SwigPyIteratorClosed_T(current, begin, end, seq); } template - inline PySwigIterator* + inline SwigPyIterator* make_output_iterator(const OutIter& current, PyObject *seq = 0) { - return new PySwigIteratorOpen_T(current, seq); + return new SwigPyIteratorOpen_T(current, seq); } } @@ -3634,16 +3837,16 @@ namespace swig { namespace swig { template - struct PySequence_Ref + struct SwigPySequence_Ref { - PySequence_Ref(PyObject* seq, int index) + SwigPySequence_Ref(PyObject* seq, int index) : _seq(seq), _index(index) { } operator T () const { - swig::PyObject_var item = PySequence_GetItem(_seq, _index); + swig::SwigVar_PyObject item = PySequence_GetItem(_seq, _index); try { return swig::as(item, true); } catch (std::exception& e) { @@ -3658,7 +3861,7 @@ namespace swig } } - PySequence_Ref& operator=(const T& v) + SwigPySequence_Ref& operator=(const T& v) { PySequence_SetItem(_seq, _index, swig::from(v)); return *this; @@ -3670,18 +3873,18 @@ namespace swig }; template - struct PySequence_ArrowProxy + struct SwigPySequence_ArrowProxy { - PySequence_ArrowProxy(const T& x): m_value(x) {} + SwigPySequence_ArrowProxy(const T& x): m_value(x) {} const T* operator->() const { return &m_value; } operator const T*() const { return &m_value; } T m_value; }; template - struct PySequence_InputIterator + struct SwigPySequence_InputIterator { - typedef PySequence_InputIterator self; + typedef SwigPySequence_InputIterator self; typedef std::random_access_iterator_tag iterator_category; typedef Reference reference; @@ -3689,11 +3892,11 @@ namespace swig typedef T* pointer; typedef int difference_type; - PySequence_InputIterator() + SwigPySequence_InputIterator() { } - PySequence_InputIterator(PyObject* seq, int index) + SwigPySequence_InputIterator(PyObject* seq, int index) : _seq(seq), _index(index) { } @@ -3703,9 +3906,9 @@ namespace swig return reference(_seq, _index); } - PySequence_ArrowProxy + SwigPySequence_ArrowProxy operator->() const { - return PySequence_ArrowProxy(operator*()); + return SwigPySequence_ArrowProxy(operator*()); } bool operator==(const self& ri) const @@ -3774,19 +3977,19 @@ namespace swig }; template - struct PySequence_Cont + struct SwigPySequence_Cont { - typedef PySequence_Ref reference; - typedef const PySequence_Ref const_reference; + typedef SwigPySequence_Ref reference; + typedef const SwigPySequence_Ref const_reference; typedef T value_type; typedef T* pointer; typedef int difference_type; typedef int size_type; typedef const pointer const_pointer; - typedef PySequence_InputIterator iterator; - typedef PySequence_InputIterator const_iterator; + typedef SwigPySequence_InputIterator iterator; + typedef SwigPySequence_InputIterator const_iterator; - PySequence_Cont(PyObject* seq) : _seq(0) + SwigPySequence_Cont(PyObject* seq) : _seq(0) { if (!PySequence_Check(seq)) { throw std::invalid_argument("a sequence is expected"); @@ -3795,7 +3998,7 @@ namespace swig Py_INCREF(_seq); } - ~PySequence_Cont() + ~SwigPySequence_Cont() { Py_XDECREF(_seq); } @@ -3844,7 +4047,7 @@ namespace swig { int s = size(); for (int i = 0; i < s; ++i) { - swig::PyObject_var item = PySequence_GetItem(_seq, i); + swig::SwigVar_PyObject item = PySequence_GetItem(_seq, i); if (!swig::check(item)) { if (set_err) { char msg[1024]; @@ -3918,13 +4121,13 @@ namespace swig { namespace swig { - template + template inline void - assign(const PySeq& pyseq, Seq* seq) { - // seq->assign(pyseq.begin(), pyseq.end()); // not used as not always implemented - typedef typename PySeq::value_type value_type; - typename PySeq::const_iterator it = pyseq.begin(); - for (;it != pyseq.end(); ++it) { + assign(const SwigPySeq& swigpyseq, Seq* seq) { + // seq->assign(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented + typedef typename SwigPySeq::value_type value_type; + typename SwigPySeq::const_iterator it = swigpyseq.begin(); + for (;it != swigpyseq.end(); ++it) { seq->insert(seq->end(),(value_type)(*it)); } } @@ -3944,14 +4147,14 @@ namespace swig { } } else if (PySequence_Check(obj)) { try { - PySequence_Cont pyseq(obj); + SwigPySequence_Cont swigpyseq(obj); if (seq) { sequence *pseq = new sequence(); - assign(pyseq, pseq); + assign(swigpyseq, pseq); *seq = pseq; return SWIG_NEWOBJ; } else { - return pyseq.check() ? SWIG_OK : SWIG_ERROR; + return swigpyseq.check() ? SWIG_OK : SWIG_ERROR; } } catch (std::exception& e) { if (seq) { @@ -4024,12 +4227,15 @@ namespace swig { }; } -SWIGINTERN swig::PySwigIterator *std_vector_Sl_int_Sg__iterator(std::vector< int > *self,PyObject **PYTHON_SELF){ +SWIGINTERN swig::SwigPyIterator *std_vector_Sl_int_Sg__iterator(std::vector< int > *self,PyObject **PYTHON_SELF){ return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); } SWIGINTERN bool std_vector_Sl_int_Sg____nonzero__(std::vector< int > const *self){ return !(self->empty()); } +SWIGINTERN bool std_vector_Sl_int_Sg____bool__(std::vector< int > const *self){ + return !(self->empty()); + } SWIGINTERN std::vector< int >::size_type std_vector_Sl_int_Sg____len__(std::vector< int > const *self){ return self->size(); } @@ -4064,13 +4270,40 @@ SWIGINTERN void std_vector_Sl_int_Sg____setslice__(std::vector< int > *self,std: SWIGINTERN void std_vector_Sl_int_Sg____delslice__(std::vector< int > *self,std::vector< int >::difference_type i,std::vector< int >::difference_type j){ swig::delslice(self, i, j); } -SWIGINTERN void std_vector_Sl_int_Sg____delitem__(std::vector< int > *self,std::vector< int >::difference_type i){ +SWIGINTERN void std_vector_Sl_int_Sg____delitem____SWIG_0(std::vector< int > *self,std::vector< int >::difference_type i){ self->erase(swig::getpos(self,i)); } -SWIGINTERN std::vector< int >::value_type const &std_vector_Sl_int_Sg____getitem__(std::vector< int > const *self,std::vector< int >::difference_type i){ +SWIGINTERN std::vector< int,std::allocator< int > > *std_vector_Sl_int_Sg____getitem____SWIG_0(std::vector< int > *self,PySliceObject *slice){ + Py_ssize_t i, j, step; + if( !PySlice_Check(slice) ) { + SWIG_Error(SWIG_TypeError, "Slice object expected."); + return NULL; + } + PySlice_GetIndices(slice, self->size(), &i, &j, &step); + return swig::getslice(self, i, j); + } +SWIGINTERN void std_vector_Sl_int_Sg____setitem____SWIG_0(std::vector< int > *self,PySliceObject *slice,std::vector< int,std::allocator< int > > const &v){ + Py_ssize_t i, j, step; + if( !PySlice_Check(slice) ) { + SWIG_Error(SWIG_TypeError, "Slice object expected."); + return; + } + PySlice_GetIndices(slice, self->size(), &i, &j, &step); + swig::setslice(self, i, j, v); + } +SWIGINTERN void std_vector_Sl_int_Sg____delitem____SWIG_1(std::vector< int > *self,PySliceObject *slice){ + Py_ssize_t i, j, step; + if( !PySlice_Check(slice) ) { + SWIG_Error(SWIG_TypeError, "Slice object expected."); + return; + } + PySlice_GetIndices(slice, self->size(), &i, &j, &step); + swig::delslice(self, i,j); + } +SWIGINTERN std::vector< int >::value_type const &std_vector_Sl_int_Sg____getitem____SWIG_1(std::vector< int > const *self,std::vector< int >::difference_type i){ return *(swig::cgetpos(self, i)); } -SWIGINTERN void std_vector_Sl_int_Sg____setitem__(std::vector< int > *self,std::vector< int >::difference_type i,std::vector< int >::value_type const &x){ +SWIGINTERN void std_vector_Sl_int_Sg____setitem____SWIG_1(std::vector< int > *self,std::vector< int >::difference_type i,std::vector< int >::value_type const &x){ *(swig::getpos(self,i)) = x; } SWIGINTERN void std_vector_Sl_int_Sg__append(std::vector< int > *self,std::vector< int >::value_type const &x){ @@ -4109,12 +4342,15 @@ namespace swig { }; } -SWIGINTERN swig::PySwigIterator *std_vector_Sl_double_Sg__iterator(std::vector< double > *self,PyObject **PYTHON_SELF){ +SWIGINTERN swig::SwigPyIterator *std_vector_Sl_double_Sg__iterator(std::vector< double > *self,PyObject **PYTHON_SELF){ return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); } SWIGINTERN bool std_vector_Sl_double_Sg____nonzero__(std::vector< double > const *self){ return !(self->empty()); } +SWIGINTERN bool std_vector_Sl_double_Sg____bool__(std::vector< double > const *self){ + return !(self->empty()); + } SWIGINTERN std::vector< double >::size_type std_vector_Sl_double_Sg____len__(std::vector< double > const *self){ return self->size(); } @@ -4134,13 +4370,40 @@ SWIGINTERN void std_vector_Sl_double_Sg____setslice__(std::vector< double > *sel SWIGINTERN void std_vector_Sl_double_Sg____delslice__(std::vector< double > *self,std::vector< double >::difference_type i,std::vector< double >::difference_type j){ swig::delslice(self, i, j); } -SWIGINTERN void std_vector_Sl_double_Sg____delitem__(std::vector< double > *self,std::vector< double >::difference_type i){ +SWIGINTERN void std_vector_Sl_double_Sg____delitem____SWIG_0(std::vector< double > *self,std::vector< double >::difference_type i){ self->erase(swig::getpos(self,i)); } -SWIGINTERN std::vector< double >::value_type const &std_vector_Sl_double_Sg____getitem__(std::vector< double > const *self,std::vector< double >::difference_type i){ +SWIGINTERN std::vector< double,std::allocator< double > > *std_vector_Sl_double_Sg____getitem____SWIG_0(std::vector< double > *self,PySliceObject *slice){ + Py_ssize_t i, j, step; + if( !PySlice_Check(slice) ) { + SWIG_Error(SWIG_TypeError, "Slice object expected."); + return NULL; + } + PySlice_GetIndices(slice, self->size(), &i, &j, &step); + return swig::getslice(self, i, j); + } +SWIGINTERN void std_vector_Sl_double_Sg____setitem____SWIG_0(std::vector< double > *self,PySliceObject *slice,std::vector< double,std::allocator< double > > const &v){ + Py_ssize_t i, j, step; + if( !PySlice_Check(slice) ) { + SWIG_Error(SWIG_TypeError, "Slice object expected."); + return; + } + PySlice_GetIndices(slice, self->size(), &i, &j, &step); + swig::setslice(self, i, j, v); + } +SWIGINTERN void std_vector_Sl_double_Sg____delitem____SWIG_1(std::vector< double > *self,PySliceObject *slice){ + Py_ssize_t i, j, step; + if( !PySlice_Check(slice) ) { + SWIG_Error(SWIG_TypeError, "Slice object expected."); + return; + } + PySlice_GetIndices(slice, self->size(), &i, &j, &step); + swig::delslice(self, i,j); + } +SWIGINTERN std::vector< double >::value_type const &std_vector_Sl_double_Sg____getitem____SWIG_1(std::vector< double > const *self,std::vector< double >::difference_type i){ return *(swig::cgetpos(self, i)); } -SWIGINTERN void std_vector_Sl_double_Sg____setitem__(std::vector< double > *self,std::vector< double >::difference_type i,std::vector< double >::value_type const &x){ +SWIGINTERN void std_vector_Sl_double_Sg____setitem____SWIG_1(std::vector< double > *self,std::vector< double >::difference_type i,std::vector< double >::value_type const &x){ *(swig::getpos(self,i)) = x; } SWIGINTERN void std_vector_Sl_double_Sg__append(std::vector< double > *self,std::vector< double >::value_type const &x){ @@ -4164,12 +4427,15 @@ SWIGINTERN void std_vector_Sl_double_Sg__append(std::vector< double > *self,std: }; } -SWIGINTERN swig::PySwigIterator *std_vector_Sl_vips_VImage_Sg__iterator(std::vector< vips::VImage > *self,PyObject **PYTHON_SELF){ +SWIGINTERN swig::SwigPyIterator *std_vector_Sl_vips_VImage_Sg__iterator(std::vector< vips::VImage > *self,PyObject **PYTHON_SELF){ return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); } SWIGINTERN bool std_vector_Sl_vips_VImage_Sg____nonzero__(std::vector< vips::VImage > const *self){ return !(self->empty()); } +SWIGINTERN bool std_vector_Sl_vips_VImage_Sg____bool__(std::vector< vips::VImage > const *self){ + return !(self->empty()); + } SWIGINTERN std::vector< vips::VImage >::size_type std_vector_Sl_vips_VImage_Sg____len__(std::vector< vips::VImage > const *self){ return self->size(); } @@ -4189,13 +4455,40 @@ SWIGINTERN void std_vector_Sl_vips_VImage_Sg____setslice__(std::vector< vips::VI SWIGINTERN void std_vector_Sl_vips_VImage_Sg____delslice__(std::vector< vips::VImage > *self,std::vector< vips::VImage >::difference_type i,std::vector< vips::VImage >::difference_type j){ swig::delslice(self, i, j); } -SWIGINTERN void std_vector_Sl_vips_VImage_Sg____delitem__(std::vector< vips::VImage > *self,std::vector< vips::VImage >::difference_type i){ +SWIGINTERN void std_vector_Sl_vips_VImage_Sg____delitem____SWIG_0(std::vector< vips::VImage > *self,std::vector< vips::VImage >::difference_type i){ self->erase(swig::getpos(self,i)); } -SWIGINTERN std::vector< vips::VImage >::value_type const &std_vector_Sl_vips_VImage_Sg____getitem__(std::vector< vips::VImage > const *self,std::vector< vips::VImage >::difference_type i){ +SWIGINTERN std::vector< vips::VImage,std::allocator< vips::VImage > > *std_vector_Sl_vips_VImage_Sg____getitem____SWIG_0(std::vector< vips::VImage > *self,PySliceObject *slice){ + Py_ssize_t i, j, step; + if( !PySlice_Check(slice) ) { + SWIG_Error(SWIG_TypeError, "Slice object expected."); + return NULL; + } + PySlice_GetIndices(slice, self->size(), &i, &j, &step); + return swig::getslice(self, i, j); + } +SWIGINTERN void std_vector_Sl_vips_VImage_Sg____setitem____SWIG_0(std::vector< vips::VImage > *self,PySliceObject *slice,std::vector< vips::VImage,std::allocator< vips::VImage > > const &v){ + Py_ssize_t i, j, step; + if( !PySlice_Check(slice) ) { + SWIG_Error(SWIG_TypeError, "Slice object expected."); + return; + } + PySlice_GetIndices(slice, self->size(), &i, &j, &step); + swig::setslice(self, i, j, v); + } +SWIGINTERN void std_vector_Sl_vips_VImage_Sg____delitem____SWIG_1(std::vector< vips::VImage > *self,PySliceObject *slice){ + Py_ssize_t i, j, step; + if( !PySlice_Check(slice) ) { + SWIG_Error(SWIG_TypeError, "Slice object expected."); + return; + } + PySlice_GetIndices(slice, self->size(), &i, &j, &step); + swig::delslice(self, i,j); + } +SWIGINTERN std::vector< vips::VImage >::value_type const &std_vector_Sl_vips_VImage_Sg____getitem____SWIG_1(std::vector< vips::VImage > const *self,std::vector< vips::VImage >::difference_type i){ return *(swig::cgetpos(self, i)); } -SWIGINTERN void std_vector_Sl_vips_VImage_Sg____setitem__(std::vector< vips::VImage > *self,std::vector< vips::VImage >::difference_type i,std::vector< vips::VImage >::value_type const &x){ +SWIGINTERN void std_vector_Sl_vips_VImage_Sg____setitem____SWIG_1(std::vector< vips::VImage > *self,std::vector< vips::VImage >::difference_type i,std::vector< vips::VImage >::value_type const &x){ *(swig::getpos(self,i)) = x; } SWIGINTERN void std_vector_Sl_vips_VImage_Sg__append(std::vector< vips::VImage > *self,std::vector< vips::VImage >::value_type const &x){ @@ -4224,10 +4517,28 @@ SWIG_pchar_descriptor(void) SWIGINTERN int SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) { - if (PyString_Check(obj)) { +#if PY_VERSION_HEX>=0x03000000 + if (PyUnicode_Check(obj)) +#else + if (PyString_Check(obj)) +#endif + { char *cstr; Py_ssize_t len; +#if PY_VERSION_HEX>=0x03000000 + if (!alloc && cptr) { + /* We can't allow converting without allocation, since the internal + representation of string in Python 3 is UCS-2/UCS-4 but we require + a UTF-8 representation. + TODO(bhy) More detailed explanation */ + return SWIG_RuntimeError; + } + obj = PyUnicode_AsUTF8String(obj); + PyBytes_AsStringAndSize(obj, &cstr, &len); + if(alloc) *alloc = SWIG_NEWOBJ; +#else PyString_AsStringAndSize(obj, &cstr, &len); - if (cptr) { +#endif + if (cptr) { if (alloc) { /* In python the user should not be able to modify the inner @@ -4252,10 +4563,16 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) *alloc = SWIG_OLDOBJ; } } else { - *cptr = PyString_AsString(obj); + #if PY_VERSION_HEX>=0x03000000 + assert(0); /* Should never reach here in Python 3 */ + #endif + *cptr = SWIG_Python_str_AsChar(obj); } } if (psize) *psize = len + 1; +#if PY_VERSION_HEX>=0x03000000 + Py_XDECREF(obj); +#endif return SWIG_OK; } else { swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); @@ -4299,7 +4616,11 @@ SWIG_FromCharPtrAndSize(const char* carray, size_t size) return pchar_descriptor ? SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void(); } else { +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_FromStringAndSize(carray, static_cast< int >(size)); +#else return PyString_FromStringAndSize(carray, static_cast< int >(size)); +#endif } } else { return SWIG_Py_Void(); @@ -4526,19 +4847,19 @@ vips_fatal (const char *msg) #ifdef __cplusplus extern "C" { #endif -SWIGINTERN PyObject *_wrap_delete_PySwigIterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_delete_SwigPyIterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:delete_PySwigIterator",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_DISOWN | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:delete_SwigPyIterator",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_PySwigIterator" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SwigPyIterator" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); } - arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); delete arg1; resultobj = SWIG_Py_Void(); return resultobj; @@ -4547,22 +4868,22 @@ fail: } -SWIGINTERN PyObject *_wrap_PySwigIterator_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:PySwigIterator_value",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_value",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_value" "', argument " "1"" of type '" "swig::PySwigIterator const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_value" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); } - arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); try { - result = (PyObject *)((swig::PySwigIterator const *)arg1)->value(); + result = (PyObject *)((swig::SwigPyIterator const *)arg1)->value(); } catch(swig::stop_iteration &_e) { { @@ -4579,9 +4900,9 @@ fail: } -SWIGINTERN PyObject *_wrap_PySwigIterator_incr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_incr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; size_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; @@ -4589,21 +4910,21 @@ SWIGINTERN PyObject *_wrap_PySwigIterator_incr__SWIG_0(PyObject *SWIGUNUSEDPARM( int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - swig::PySwigIterator *result = 0 ; + swig::SwigPyIterator *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:PySwigIterator_incr",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator_incr",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_incr" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_incr" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); } - arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); ecode2 = SWIG_AsVal_size_t(obj1, &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PySwigIterator_incr" "', argument " "2"" of type '" "size_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator_incr" "', argument " "2"" of type '" "size_t""'"); } arg2 = static_cast< size_t >(val2); try { - result = (swig::PySwigIterator *)(arg1)->incr(arg2); + result = (swig::SwigPyIterator *)(arg1)->incr(arg2); } catch(swig::stop_iteration &_e) { { @@ -4613,29 +4934,29 @@ SWIGINTERN PyObject *_wrap_PySwigIterator_incr__SWIG_0(PyObject *SWIGUNUSEDPARM( } } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_PySwigIterator_incr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_incr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - swig::PySwigIterator *result = 0 ; + swig::SwigPyIterator *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:PySwigIterator_incr",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_incr",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_incr" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_incr" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); } - arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); try { - result = (swig::PySwigIterator *)(arg1)->incr(); + result = (swig::SwigPyIterator *)(arg1)->incr(); } catch(swig::stop_iteration &_e) { { @@ -4645,14 +4966,14 @@ SWIGINTERN PyObject *_wrap_PySwigIterator_incr__SWIG_1(PyObject *SWIGUNUSEDPARM( } } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_PySwigIterator_incr(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_incr(PyObject *self, PyObject *args) { int argc; PyObject *argv[3]; int ii; @@ -4665,16 +4986,16 @@ SWIGINTERN PyObject *_wrap_PySwigIterator_incr(PyObject *self, PyObject *args) { if (argc == 1) { int _v; void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__PySwigIterator, 0); + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0); _v = SWIG_CheckState(res); if (_v) { - return _wrap_PySwigIterator_incr__SWIG_1(self, args); + return _wrap_SwigPyIterator_incr__SWIG_1(self, args); } } if (argc == 2) { int _v; void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__PySwigIterator, 0); + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0); _v = SWIG_CheckState(res); if (_v) { { @@ -4682,23 +5003,23 @@ SWIGINTERN PyObject *_wrap_PySwigIterator_incr(PyObject *self, PyObject *args) { _v = SWIG_CheckState(res); } if (_v) { - return _wrap_PySwigIterator_incr__SWIG_0(self, args); + return _wrap_SwigPyIterator_incr__SWIG_0(self, args); } } } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'PySwigIterator_incr'.\n" + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'SwigPyIterator_incr'.\n" " Possible C/C++ prototypes are:\n" - " incr(swig::PySwigIterator *,size_t)\n" - " incr(swig::PySwigIterator *)\n"); + " incr(swig::SwigPyIterator *,size_t)\n" + " incr(swig::SwigPyIterator *)\n"); return NULL; } -SWIGINTERN PyObject *_wrap_PySwigIterator_decr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_decr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; size_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; @@ -4706,21 +5027,21 @@ SWIGINTERN PyObject *_wrap_PySwigIterator_decr__SWIG_0(PyObject *SWIGUNUSEDPARM( int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - swig::PySwigIterator *result = 0 ; + swig::SwigPyIterator *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:PySwigIterator_decr",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator_decr",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_decr" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_decr" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); } - arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); ecode2 = SWIG_AsVal_size_t(obj1, &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PySwigIterator_decr" "', argument " "2"" of type '" "size_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator_decr" "', argument " "2"" of type '" "size_t""'"); } arg2 = static_cast< size_t >(val2); try { - result = (swig::PySwigIterator *)(arg1)->decr(arg2); + result = (swig::SwigPyIterator *)(arg1)->decr(arg2); } catch(swig::stop_iteration &_e) { { @@ -4730,29 +5051,29 @@ SWIGINTERN PyObject *_wrap_PySwigIterator_decr__SWIG_0(PyObject *SWIGUNUSEDPARM( } } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_PySwigIterator_decr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_decr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - swig::PySwigIterator *result = 0 ; + swig::SwigPyIterator *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:PySwigIterator_decr",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_decr",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_decr" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_decr" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); } - arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); try { - result = (swig::PySwigIterator *)(arg1)->decr(); + result = (swig::SwigPyIterator *)(arg1)->decr(); } catch(swig::stop_iteration &_e) { { @@ -4762,14 +5083,14 @@ SWIGINTERN PyObject *_wrap_PySwigIterator_decr__SWIG_1(PyObject *SWIGUNUSEDPARM( } } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_PySwigIterator_decr(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_decr(PyObject *self, PyObject *args) { int argc; PyObject *argv[3]; int ii; @@ -4782,16 +5103,16 @@ SWIGINTERN PyObject *_wrap_PySwigIterator_decr(PyObject *self, PyObject *args) { if (argc == 1) { int _v; void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__PySwigIterator, 0); + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0); _v = SWIG_CheckState(res); if (_v) { - return _wrap_PySwigIterator_decr__SWIG_1(self, args); + return _wrap_SwigPyIterator_decr__SWIG_1(self, args); } } if (argc == 2) { int _v; void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__PySwigIterator, 0); + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0); _v = SWIG_CheckState(res); if (_v) { { @@ -4799,24 +5120,24 @@ SWIGINTERN PyObject *_wrap_PySwigIterator_decr(PyObject *self, PyObject *args) { _v = SWIG_CheckState(res); } if (_v) { - return _wrap_PySwigIterator_decr__SWIG_0(self, args); + return _wrap_SwigPyIterator_decr__SWIG_0(self, args); } } } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'PySwigIterator_decr'.\n" + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'SwigPyIterator_decr'.\n" " Possible C/C++ prototypes are:\n" - " decr(swig::PySwigIterator *,size_t)\n" - " decr(swig::PySwigIterator *)\n"); + " decr(swig::SwigPyIterator *,size_t)\n" + " decr(swig::SwigPyIterator *)\n"); return NULL; } -SWIGINTERN PyObject *_wrap_PySwigIterator_distance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_distance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; - swig::PySwigIterator *arg2 = 0 ; + swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; + swig::SwigPyIterator *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; @@ -4825,22 +5146,22 @@ SWIGINTERN PyObject *_wrap_PySwigIterator_distance(PyObject *SWIGUNUSEDPARM(self PyObject * obj1 = 0 ; ptrdiff_t result; - if (!PyArg_ParseTuple(args,(char *)"OO:PySwigIterator_distance",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator_distance",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_distance" "', argument " "1"" of type '" "swig::PySwigIterator const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_distance" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); } - arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__PySwigIterator, 0 | 0); + arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator, 0 | 0); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PySwigIterator_distance" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator_distance" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); } if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PySwigIterator_distance" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator_distance" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); } - arg2 = reinterpret_cast< swig::PySwigIterator * >(argp2); + arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2); try { - result = ((swig::PySwigIterator const *)arg1)->distance((swig::PySwigIterator const &)*arg2); + result = ((swig::SwigPyIterator const *)arg1)->distance((swig::SwigPyIterator const &)*arg2); } catch(std::invalid_argument &_e) { SWIG_Python_Raise(SWIG_NewPointerObj((new std::invalid_argument(static_cast< const std::invalid_argument& >(_e))),SWIGTYPE_p_std__invalid_argument,SWIG_POINTER_OWN), "std::invalid_argument", SWIGTYPE_p_std__invalid_argument); SWIG_fail; @@ -4853,10 +5174,10 @@ fail: } -SWIGINTERN PyObject *_wrap_PySwigIterator_equal(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_equal(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; - swig::PySwigIterator *arg2 = 0 ; + swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; + swig::SwigPyIterator *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; @@ -4865,22 +5186,22 @@ SWIGINTERN PyObject *_wrap_PySwigIterator_equal(PyObject *SWIGUNUSEDPARM(self), PyObject * obj1 = 0 ; bool result; - if (!PyArg_ParseTuple(args,(char *)"OO:PySwigIterator_equal",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator_equal",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_equal" "', argument " "1"" of type '" "swig::PySwigIterator const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_equal" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); } - arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__PySwigIterator, 0 | 0); + arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator, 0 | 0); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PySwigIterator_equal" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator_equal" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); } if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PySwigIterator_equal" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator_equal" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); } - arg2 = reinterpret_cast< swig::PySwigIterator * >(argp2); + arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2); try { - result = (bool)((swig::PySwigIterator const *)arg1)->equal((swig::PySwigIterator const &)*arg2); + result = (bool)((swig::SwigPyIterator const *)arg1)->equal((swig::SwigPyIterator const &)*arg2); } catch(std::invalid_argument &_e) { SWIG_Python_Raise(SWIG_NewPointerObj((new std::invalid_argument(static_cast< const std::invalid_argument& >(_e))),SWIGTYPE_p_std__invalid_argument,SWIG_POINTER_OWN), "std::invalid_argument", SWIGTYPE_p_std__invalid_argument); SWIG_fail; @@ -4893,42 +5214,42 @@ fail: } -SWIGINTERN PyObject *_wrap_PySwigIterator_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - swig::PySwigIterator *result = 0 ; + swig::SwigPyIterator *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:PySwigIterator_copy",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_copy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_copy" "', argument " "1"" of type '" "swig::PySwigIterator const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_copy" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); } - arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); - result = (swig::PySwigIterator *)((swig::PySwigIterator const *)arg1)->copy(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_OWN | 0 ); + arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); + result = (swig::SwigPyIterator *)((swig::SwigPyIterator const *)arg1)->copy(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_PySwigIterator_next(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_next(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:PySwigIterator_next",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_next",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_next" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_next" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); } - arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); try { result = (PyObject *)(arg1)->next(); } @@ -4947,20 +5268,52 @@ fail: } -SWIGINTERN PyObject *_wrap_PySwigIterator_previous(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator___next__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:PySwigIterator_previous",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator___next__",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_previous" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___next__" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); } - arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); + try { + result = (PyObject *)(arg1)->__next__(); + } + catch(swig::stop_iteration &_e) { + { + (void)_e; + SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); + SWIG_fail; + } + } + + resultobj = result; + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_SwigPyIterator_previous(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + PyObject *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_previous",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_previous" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); + } + arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); try { result = (PyObject *)(arg1)->previous(); } @@ -4979,9 +5332,9 @@ fail: } -SWIGINTERN PyObject *_wrap_PySwigIterator_advance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator_advance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; ptrdiff_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; @@ -4989,21 +5342,21 @@ SWIGINTERN PyObject *_wrap_PySwigIterator_advance(PyObject *SWIGUNUSEDPARM(self) int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - swig::PySwigIterator *result = 0 ; + swig::SwigPyIterator *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:PySwigIterator_advance",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator_advance",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_advance" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_advance" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); } - arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PySwigIterator_advance" "', argument " "2"" of type '" "ptrdiff_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator_advance" "', argument " "2"" of type '" "ptrdiff_t""'"); } arg2 = static_cast< ptrdiff_t >(val2); try { - result = (swig::PySwigIterator *)(arg1)->advance(arg2); + result = (swig::SwigPyIterator *)(arg1)->advance(arg2); } catch(swig::stop_iteration &_e) { { @@ -5013,17 +5366,17 @@ SWIGINTERN PyObject *_wrap_PySwigIterator_advance(PyObject *SWIGUNUSEDPARM(self) } } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_PySwigIterator___eq__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator___eq__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; - swig::PySwigIterator *arg2 = 0 ; + swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; + swig::SwigPyIterator *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; @@ -5032,21 +5385,21 @@ SWIGINTERN PyObject *_wrap_PySwigIterator___eq__(PyObject *SWIGUNUSEDPARM(self), PyObject * obj1 = 0 ; bool result; - if (!PyArg_ParseTuple(args,(char *)"OO:PySwigIterator___eq__",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___eq__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator___eq__" "', argument " "1"" of type '" "swig::PySwigIterator const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___eq__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); } - arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__PySwigIterator, 0 | 0); + arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator, 0 | 0); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PySwigIterator___eq__" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator___eq__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); } if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PySwigIterator___eq__" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator___eq__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); } - arg2 = reinterpret_cast< swig::PySwigIterator * >(argp2); - result = (bool)((swig::PySwigIterator const *)arg1)->operator ==((swig::PySwigIterator const &)*arg2); + arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2); + result = (bool)((swig::SwigPyIterator const *)arg1)->operator ==((swig::SwigPyIterator const &)*arg2); resultobj = SWIG_From_bool(static_cast< bool >(result)); return resultobj; fail: @@ -5054,10 +5407,10 @@ fail: } -SWIGINTERN PyObject *_wrap_PySwigIterator___ne__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator___ne__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; - swig::PySwigIterator *arg2 = 0 ; + swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; + swig::SwigPyIterator *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; @@ -5066,21 +5419,21 @@ SWIGINTERN PyObject *_wrap_PySwigIterator___ne__(PyObject *SWIGUNUSEDPARM(self), PyObject * obj1 = 0 ; bool result; - if (!PyArg_ParseTuple(args,(char *)"OO:PySwigIterator___ne__",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___ne__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator___ne__" "', argument " "1"" of type '" "swig::PySwigIterator const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___ne__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); } - arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__PySwigIterator, 0 | 0); + arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator, 0 | 0); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PySwigIterator___ne__" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator___ne__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); } if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PySwigIterator___ne__" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator___ne__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); } - arg2 = reinterpret_cast< swig::PySwigIterator * >(argp2); - result = (bool)((swig::PySwigIterator const *)arg1)->operator !=((swig::PySwigIterator const &)*arg2); + arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2); + result = (bool)((swig::SwigPyIterator const *)arg1)->operator !=((swig::SwigPyIterator const &)*arg2); resultobj = SWIG_From_bool(static_cast< bool >(result)); return resultobj; fail: @@ -5088,9 +5441,9 @@ fail: } -SWIGINTERN PyObject *_wrap_PySwigIterator___iadd__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator___iadd__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; ptrdiff_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; @@ -5098,24 +5451,21 @@ SWIGINTERN PyObject *_wrap_PySwigIterator___iadd__(PyObject *SWIGUNUSEDPARM(self int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - swig::PySwigIterator *result = 0 ; + swig::SwigPyIterator *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:PySwigIterator___iadd__",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_DISOWN | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___iadd__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator___iadd__" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___iadd__" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); } - arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PySwigIterator___iadd__" "', argument " "2"" of type '" "ptrdiff_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator___iadd__" "', argument " "2"" of type '" "ptrdiff_t""'"); } arg2 = static_cast< ptrdiff_t >(val2); try { - { - swig::PySwigIterator &_result_ref = (arg1)->operator +=(arg2); - result = (swig::PySwigIterator *) &_result_ref; - } + result = (swig::SwigPyIterator *) &(arg1)->operator +=(arg2); } catch(swig::stop_iteration &_e) { { @@ -5125,16 +5475,16 @@ SWIGINTERN PyObject *_wrap_PySwigIterator___iadd__(PyObject *SWIGUNUSEDPARM(self } } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_OWN | 0 ); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_PySwigIterator___isub__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator___isub__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; ptrdiff_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; @@ -5142,24 +5492,21 @@ SWIGINTERN PyObject *_wrap_PySwigIterator___isub__(PyObject *SWIGUNUSEDPARM(self int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - swig::PySwigIterator *result = 0 ; + swig::SwigPyIterator *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:PySwigIterator___isub__",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_DISOWN | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___isub__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator___isub__" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___isub__" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); } - arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PySwigIterator___isub__" "', argument " "2"" of type '" "ptrdiff_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator___isub__" "', argument " "2"" of type '" "ptrdiff_t""'"); } arg2 = static_cast< ptrdiff_t >(val2); try { - { - swig::PySwigIterator &_result_ref = (arg1)->operator -=(arg2); - result = (swig::PySwigIterator *) &_result_ref; - } + result = (swig::SwigPyIterator *) &(arg1)->operator -=(arg2); } catch(swig::stop_iteration &_e) { { @@ -5169,16 +5516,16 @@ SWIGINTERN PyObject *_wrap_PySwigIterator___isub__(PyObject *SWIGUNUSEDPARM(self } } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_OWN | 0 ); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_PySwigIterator___add__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator___add__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; ptrdiff_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; @@ -5186,21 +5533,21 @@ SWIGINTERN PyObject *_wrap_PySwigIterator___add__(PyObject *SWIGUNUSEDPARM(self) int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - swig::PySwigIterator *result = 0 ; + swig::SwigPyIterator *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:PySwigIterator___add__",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___add__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator___add__" "', argument " "1"" of type '" "swig::PySwigIterator const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___add__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); } - arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PySwigIterator___add__" "', argument " "2"" of type '" "ptrdiff_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator___add__" "', argument " "2"" of type '" "ptrdiff_t""'"); } arg2 = static_cast< ptrdiff_t >(val2); try { - result = (swig::PySwigIterator *)((swig::PySwigIterator const *)arg1)->operator +(arg2); + result = (swig::SwigPyIterator *)((swig::SwigPyIterator const *)arg1)->operator +(arg2); } catch(swig::stop_iteration &_e) { { @@ -5210,16 +5557,16 @@ SWIGINTERN PyObject *_wrap_PySwigIterator___add__(PyObject *SWIGUNUSEDPARM(self) } } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_OWN | 0 ); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_PySwigIterator___sub____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator___sub____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; ptrdiff_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; @@ -5227,21 +5574,21 @@ SWIGINTERN PyObject *_wrap_PySwigIterator___sub____SWIG_0(PyObject *SWIGUNUSEDPA int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - swig::PySwigIterator *result = 0 ; + swig::SwigPyIterator *result = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:PySwigIterator___sub__",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___sub__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator___sub__" "', argument " "1"" of type '" "swig::PySwigIterator const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___sub__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); } - arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PySwigIterator___sub__" "', argument " "2"" of type '" "ptrdiff_t""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator___sub__" "', argument " "2"" of type '" "ptrdiff_t""'"); } arg2 = static_cast< ptrdiff_t >(val2); try { - result = (swig::PySwigIterator *)((swig::PySwigIterator const *)arg1)->operator -(arg2); + result = (swig::SwigPyIterator *)((swig::SwigPyIterator const *)arg1)->operator -(arg2); } catch(swig::stop_iteration &_e) { { @@ -5251,17 +5598,17 @@ SWIGINTERN PyObject *_wrap_PySwigIterator___sub____SWIG_0(PyObject *SWIGUNUSEDPA } } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_OWN | 0 ); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_PySwigIterator___sub____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator___sub____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; - swig::PySwigIterator *arg2 = 0 ; + swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; + swig::SwigPyIterator *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; @@ -5270,21 +5617,21 @@ SWIGINTERN PyObject *_wrap_PySwigIterator___sub____SWIG_1(PyObject *SWIGUNUSEDPA PyObject * obj1 = 0 ; ptrdiff_t result; - if (!PyArg_ParseTuple(args,(char *)"OO:PySwigIterator___sub__",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___sub__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator___sub__" "', argument " "1"" of type '" "swig::PySwigIterator const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___sub__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); } - arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__PySwigIterator, 0 | 0); + arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator, 0 | 0); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PySwigIterator___sub__" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator___sub__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); } if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PySwigIterator___sub__" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator___sub__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); } - arg2 = reinterpret_cast< swig::PySwigIterator * >(argp2); - result = ((swig::PySwigIterator const *)arg1)->operator -((swig::PySwigIterator const &)*arg2); + arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2); + result = ((swig::SwigPyIterator const *)arg1)->operator -((swig::SwigPyIterator const &)*arg2); resultobj = SWIG_From_ptrdiff_t(static_cast< ptrdiff_t >(result)); return resultobj; fail: @@ -5292,7 +5639,7 @@ fail: } -SWIGINTERN PyObject *_wrap_PySwigIterator___sub__(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_SwigPyIterator___sub__(PyObject *self, PyObject *args) { int argc; PyObject *argv[3]; int ii; @@ -5305,20 +5652,20 @@ SWIGINTERN PyObject *_wrap_PySwigIterator___sub__(PyObject *self, PyObject *args if (argc == 2) { int _v; void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__PySwigIterator, 0); + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0); _v = SWIG_CheckState(res); if (_v) { - int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_swig__PySwigIterator, 0); + int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_swig__SwigPyIterator, 0); _v = SWIG_CheckState(res); if (_v) { - return _wrap_PySwigIterator___sub____SWIG_1(self, args); + return _wrap_SwigPyIterator___sub____SWIG_1(self, args); } } } if (argc == 2) { int _v; void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__PySwigIterator, 0); + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0); _v = SWIG_CheckState(res); if (_v) { { @@ -5326,7 +5673,7 @@ SWIGINTERN PyObject *_wrap_PySwigIterator___sub__(PyObject *self, PyObject *args _v = SWIG_CheckState(res); } if (_v) { - return _wrap_PySwigIterator___sub____SWIG_0(self, args); + return _wrap_SwigPyIterator___sub____SWIG_0(self, args); } } } @@ -5337,10 +5684,10 @@ fail: } -SWIGINTERN PyObject *PySwigIterator_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *SwigPyIterator_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_swig__PySwigIterator, SWIG_NewClientData(obj)); + SWIG_TypeNewClientData(SWIGTYPE_p_swig__SwigPyIterator, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } @@ -5351,7 +5698,7 @@ SWIGINTERN PyObject *_wrap_IntVector_iterator(PyObject *SWIGUNUSEDPARM(self), Py void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - swig::PySwigIterator *result = 0 ; + swig::SwigPyIterator *result = 0 ; arg2 = &obj0; if (!PyArg_ParseTuple(args,(char *)"O:IntVector_iterator",&obj0)) SWIG_fail; @@ -5360,8 +5707,8 @@ SWIGINTERN PyObject *_wrap_IntVector_iterator(PyObject *SWIGUNUSEDPARM(self), Py SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_iterator" "', argument " "1"" of type '" "std::vector< int > *""'"); } arg1 = reinterpret_cast< std::vector< int > * >(argp1); - result = (swig::PySwigIterator *)std_vector_Sl_int_Sg__iterator(arg1,arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_OWN | 0 ); + result = (swig::SwigPyIterator *)std_vector_Sl_int_Sg__iterator(arg1,arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; @@ -5390,6 +5737,28 @@ fail: } +SWIGINTERN PyObject *_wrap_IntVector___bool__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector< int > *arg1 = (std::vector< int > *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + bool result; + + if (!PyArg_ParseTuple(args,(char *)"O:IntVector___bool__",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector___bool__" "', argument " "1"" of type '" "std::vector< int > const *""'"); + } + arg1 = reinterpret_cast< std::vector< int > * >(argp1); + result = (bool)std_vector_Sl_int_Sg____bool__((std::vector< int > const *)arg1); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_IntVector___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< int > *arg1 = (std::vector< int > *) 0 ; @@ -5595,7 +5964,7 @@ fail: } -SWIGINTERN PyObject *_wrap_IntVector___delitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_IntVector___delitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< int > *arg1 = (std::vector< int > *) 0 ; std::vector< int >::difference_type arg2 ; @@ -5618,7 +5987,7 @@ SWIGINTERN PyObject *_wrap_IntVector___delitem__(PyObject *SWIGUNUSEDPARM(self), } arg2 = static_cast< std::vector< int >::difference_type >(val2); try { - std_vector_Sl_int_Sg____delitem__(arg1,arg2); + std_vector_Sl_int_Sg____delitem____SWIG_0(arg1,arg2); } catch(std::out_of_range &_e) { SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); @@ -5631,7 +6000,170 @@ fail: } -SWIGINTERN PyObject *_wrap_IntVector___getitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_IntVector___getitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector< int > *arg1 = (std::vector< int > *) 0 ; + PySliceObject *arg2 = (PySliceObject *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + std::vector< int,std::allocator< int > > *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:IntVector___getitem__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector___getitem__" "', argument " "1"" of type '" "std::vector< int > *""'"); + } + arg1 = reinterpret_cast< std::vector< int > * >(argp1); + { + arg2 = (PySliceObject *) obj1; + } + try { + result = (std::vector< int,std::allocator< int > > *)std_vector_Sl_int_Sg____getitem____SWIG_0(arg1,arg2); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_IntVector___setitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector< int > *arg1 = (std::vector< int > *) 0 ; + PySliceObject *arg2 = (PySliceObject *) 0 ; + std::vector< int,std::allocator< int > > *arg3 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res3 = SWIG_OLDOBJ ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:IntVector___setitem__",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector___setitem__" "', argument " "1"" of type '" "std::vector< int > *""'"); + } + arg1 = reinterpret_cast< std::vector< int > * >(argp1); + { + arg2 = (PySliceObject *) obj1; + } + { + std::vector > *ptr = (std::vector > *)0; + res3 = swig::asptr(obj2, &ptr); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IntVector___setitem__" "', argument " "3"" of type '" "std::vector< int,std::allocator< int > > const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IntVector___setitem__" "', argument " "3"" of type '" "std::vector< int,std::allocator< int > > const &""'"); + } + arg3 = ptr; + } + try { + std_vector_Sl_int_Sg____setitem____SWIG_0(arg1,arg2,(std::vector< int,std::allocator< int > > const &)*arg3); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + catch(std::invalid_argument &_e) { + SWIG_exception_fail(SWIG_ValueError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + if (SWIG_IsNewObj(res3)) delete arg3; + return resultobj; +fail: + if (SWIG_IsNewObj(res3)) delete arg3; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_IntVector___delitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector< int > *arg1 = (std::vector< int > *) 0 ; + PySliceObject *arg2 = (PySliceObject *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:IntVector___delitem__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector___delitem__" "', argument " "1"" of type '" "std::vector< int > *""'"); + } + arg1 = reinterpret_cast< std::vector< int > * >(argp1); + { + arg2 = (PySliceObject *) obj1; + } + try { + std_vector_Sl_int_Sg____delitem____SWIG_1(arg1,arg2); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_IntVector___delitem__(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[3]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = (int)PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 2); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 2) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + _v = PySlice_Check(argv[1]); + } + if (_v) { + return _wrap_IntVector___delitem____SWIG_1(self, args); + } + } + } + if (argc == 2) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_IntVector___delitem____SWIG_0(self, args); + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'IntVector___delitem__'.\n" + " Possible C/C++ prototypes are:\n" + " __delitem__(std::vector< int > *,std::vector< int >::difference_type)\n" + " __delitem__(std::vector< int > *,PySliceObject *)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_IntVector___getitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< int > *arg1 = (std::vector< int > *) 0 ; std::vector< int >::difference_type arg2 ; @@ -5655,10 +6187,7 @@ SWIGINTERN PyObject *_wrap_IntVector___getitem__(PyObject *SWIGUNUSEDPARM(self), } arg2 = static_cast< std::vector< int >::difference_type >(val2); try { - { - std::vector< int >::value_type const &_result_ref = std_vector_Sl_int_Sg____getitem__((std::vector< int > const *)arg1,arg2); - result = (std::vector< int >::value_type *) &_result_ref; - } + result = (std::vector< int >::value_type *) &std_vector_Sl_int_Sg____getitem____SWIG_1((std::vector< int > const *)arg1,arg2); } catch(std::out_of_range &_e) { SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); @@ -5671,7 +6200,54 @@ fail: } -SWIGINTERN PyObject *_wrap_IntVector___setitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_IntVector___getitem__(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[3]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = (int)PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 2); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 2) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + _v = PySlice_Check(argv[1]); + } + if (_v) { + return _wrap_IntVector___getitem____SWIG_0(self, args); + } + } + } + if (argc == 2) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_IntVector___getitem____SWIG_1(self, args); + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'IntVector___getitem__'.\n" + " Possible C/C++ prototypes are:\n" + " __getitem__(std::vector< int > *,PySliceObject *)\n" + " __getitem__(std::vector< int > const *,std::vector< int >::difference_type)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_IntVector___setitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< int > *arg1 = (std::vector< int > *) 0 ; std::vector< int >::difference_type arg2 ; @@ -5705,7 +6281,7 @@ SWIGINTERN PyObject *_wrap_IntVector___setitem__(PyObject *SWIGUNUSEDPARM(self), temp3 = static_cast< std::vector< int >::value_type >(val3); arg3 = &temp3; try { - std_vector_Sl_int_Sg____setitem__(arg1,arg2,(int const &)*arg3); + std_vector_Sl_int_Sg____setitem____SWIG_1(arg1,arg2,(int const &)*arg3); } catch(std::out_of_range &_e) { SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); @@ -5718,6 +6294,63 @@ fail: } +SWIGINTERN PyObject *_wrap_IntVector___setitem__(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[4]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = (int)PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 3); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 3) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + _v = PySlice_Check(argv[1]); + } + if (_v) { + int res = swig::asptr(argv[2], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_IntVector___setitem____SWIG_0(self, args); + } + } + } + } + if (argc == 3) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_IntVector___setitem____SWIG_1(self, args); + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'IntVector___setitem__'.\n" + " Possible C/C++ prototypes are:\n" + " __setitem__(std::vector< int > *,PySliceObject *,std::vector< int,std::allocator< int > > const &)\n" + " __setitem__(std::vector< int > *,std::vector< int >::difference_type,std::vector< int >::value_type const &)\n"); + return NULL; +} + + SWIGINTERN PyObject *_wrap_IntVector_append(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< int > *arg1 = (std::vector< int > *) 0 ; @@ -5928,7 +6561,7 @@ SWIGINTERN PyObject *_wrap_IntVector_begin(PyObject *SWIGUNUSEDPARM(self), PyObj arg1 = reinterpret_cast< std::vector< int > * >(argp1); result = ((std::vector< int > const *)arg1)->begin(); resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< int >::const_iterator & >(result)), - swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); return resultobj; fail: return NULL; @@ -5951,7 +6584,7 @@ SWIGINTERN PyObject *_wrap_IntVector_end(PyObject *SWIGUNUSEDPARM(self), PyObjec arg1 = reinterpret_cast< std::vector< int > * >(argp1); result = ((std::vector< int > const *)arg1)->end(); resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< int >::const_iterator & >(result)), - swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); return resultobj; fail: return NULL; @@ -5974,7 +6607,7 @@ SWIGINTERN PyObject *_wrap_IntVector_rbegin(PyObject *SWIGUNUSEDPARM(self), PyOb arg1 = reinterpret_cast< std::vector< int > * >(argp1); result = ((std::vector< int > const *)arg1)->rbegin(); resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< int >::const_reverse_iterator & >(result)), - swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); return resultobj; fail: return NULL; @@ -5997,7 +6630,7 @@ SWIGINTERN PyObject *_wrap_IntVector_rend(PyObject *SWIGUNUSEDPARM(self), PyObje arg1 = reinterpret_cast< std::vector< int > * >(argp1); result = ((std::vector< int > const *)arg1)->rend(); resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< int >::const_reverse_iterator & >(result)), - swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); return resultobj; fail: return NULL; @@ -6083,7 +6716,7 @@ SWIGINTERN PyObject *_wrap_IntVector_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(self std::vector< int >::iterator arg2 ; void *argp1 = 0 ; int res1 = 0 ; - swig::PySwigIterator *iter2 = 0 ; + swig::SwigPyIterator *iter2 = 0 ; int res2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -6095,11 +6728,11 @@ SWIGINTERN PyObject *_wrap_IntVector_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(self SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_erase" "', argument " "1"" of type '" "std::vector< int > *""'"); } arg1 = reinterpret_cast< std::vector< int > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0); if (!SWIG_IsOK(res2) || !iter2) { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "IntVector_erase" "', argument " "2"" of type '" "std::vector< int >::iterator""'"); } else { - swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + swig::SwigPyIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); if (iter_t) { arg2 = iter_t->get_current(); } else { @@ -6108,7 +6741,7 @@ SWIGINTERN PyObject *_wrap_IntVector_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(self } result = (arg1)->erase(arg2); resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< int >::iterator & >(result)), - swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); return resultobj; fail: return NULL; @@ -6122,9 +6755,9 @@ SWIGINTERN PyObject *_wrap_IntVector_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(self std::vector< int >::iterator arg3 ; void *argp1 = 0 ; int res1 = 0 ; - swig::PySwigIterator *iter2 = 0 ; + swig::SwigPyIterator *iter2 = 0 ; int res2 ; - swig::PySwigIterator *iter3 = 0 ; + swig::SwigPyIterator *iter3 = 0 ; int res3 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -6137,22 +6770,22 @@ SWIGINTERN PyObject *_wrap_IntVector_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(self SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_erase" "', argument " "1"" of type '" "std::vector< int > *""'"); } arg1 = reinterpret_cast< std::vector< int > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0); if (!SWIG_IsOK(res2) || !iter2) { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "IntVector_erase" "', argument " "2"" of type '" "std::vector< int >::iterator""'"); } else { - swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + swig::SwigPyIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); if (iter_t) { arg2 = iter_t->get_current(); } else { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "IntVector_erase" "', argument " "2"" of type '" "std::vector< int >::iterator""'"); } } - res3 = SWIG_ConvertPtr(obj2, SWIG_as_voidptrptr(&iter3), swig::PySwigIterator::descriptor(), 0); + res3 = SWIG_ConvertPtr(obj2, SWIG_as_voidptrptr(&iter3), swig::SwigPyIterator::descriptor(), 0); if (!SWIG_IsOK(res3) || !iter3) { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "IntVector_erase" "', argument " "3"" of type '" "std::vector< int >::iterator""'"); } else { - swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter3); + swig::SwigPyIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter3); if (iter_t) { arg3 = iter_t->get_current(); } else { @@ -6161,7 +6794,7 @@ SWIGINTERN PyObject *_wrap_IntVector_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(self } result = (arg1)->erase(arg2,arg3); resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< int >::iterator & >(result)), - swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); return resultobj; fail: return NULL; @@ -6183,9 +6816,9 @@ SWIGINTERN PyObject *_wrap_IntVector_erase(PyObject *self, PyObject *args) { int res = swig::asptr(argv[0], (std::vector >**)(0)); _v = SWIG_CheckState(res); if (_v) { - swig::PySwigIterator *iter = 0; - int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); - _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + swig::SwigPyIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); if (_v) { return _wrap_IntVector_erase__SWIG_0(self, args); } @@ -6196,13 +6829,13 @@ SWIGINTERN PyObject *_wrap_IntVector_erase(PyObject *self, PyObject *args) { int res = swig::asptr(argv[0], (std::vector >**)(0)); _v = SWIG_CheckState(res); if (_v) { - swig::PySwigIterator *iter = 0; - int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); - _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + swig::SwigPyIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); if (_v) { - swig::PySwigIterator *iter = 0; - int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); - _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + swig::SwigPyIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); if (_v) { return _wrap_IntVector_erase__SWIG_1(self, args); } @@ -6357,10 +6990,7 @@ SWIGINTERN PyObject *_wrap_IntVector_front(PyObject *SWIGUNUSEDPARM(self), PyObj SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_front" "', argument " "1"" of type '" "std::vector< int > const *""'"); } arg1 = reinterpret_cast< std::vector< int > * >(argp1); - { - std::vector< int >::value_type const &_result_ref = ((std::vector< int > const *)arg1)->front(); - result = (std::vector< int >::value_type *) &_result_ref; - } + result = (std::vector< int >::value_type *) &((std::vector< int > const *)arg1)->front(); resultobj = SWIG_From_int(static_cast< int >(*result)); return resultobj; fail: @@ -6382,10 +7012,7 @@ SWIGINTERN PyObject *_wrap_IntVector_back(PyObject *SWIGUNUSEDPARM(self), PyObje SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_back" "', argument " "1"" of type '" "std::vector< int > const *""'"); } arg1 = reinterpret_cast< std::vector< int > * >(argp1); - { - std::vector< int >::value_type const &_result_ref = ((std::vector< int > const *)arg1)->back(); - result = (std::vector< int >::value_type *) &_result_ref; - } + result = (std::vector< int >::value_type *) &((std::vector< int > const *)arg1)->back(); resultobj = SWIG_From_int(static_cast< int >(*result)); return resultobj; fail: @@ -6536,7 +7163,7 @@ SWIGINTERN PyObject *_wrap_IntVector_insert__SWIG_0(PyObject *SWIGUNUSEDPARM(sel std::vector< int >::value_type *arg3 = 0 ; void *argp1 = 0 ; int res1 = 0 ; - swig::PySwigIterator *iter2 = 0 ; + swig::SwigPyIterator *iter2 = 0 ; int res2 ; std::vector< int >::value_type temp3 ; int val3 ; @@ -6552,11 +7179,11 @@ SWIGINTERN PyObject *_wrap_IntVector_insert__SWIG_0(PyObject *SWIGUNUSEDPARM(sel SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_insert" "', argument " "1"" of type '" "std::vector< int > *""'"); } arg1 = reinterpret_cast< std::vector< int > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0); if (!SWIG_IsOK(res2) || !iter2) { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "IntVector_insert" "', argument " "2"" of type '" "std::vector< int >::iterator""'"); } else { - swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + swig::SwigPyIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); if (iter_t) { arg2 = iter_t->get_current(); } else { @@ -6571,7 +7198,7 @@ SWIGINTERN PyObject *_wrap_IntVector_insert__SWIG_0(PyObject *SWIGUNUSEDPARM(sel arg3 = &temp3; result = (arg1)->insert(arg2,(std::vector< int >::value_type const &)*arg3); resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< int >::iterator & >(result)), - swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); return resultobj; fail: return NULL; @@ -6586,7 +7213,7 @@ SWIGINTERN PyObject *_wrap_IntVector_insert__SWIG_1(PyObject *SWIGUNUSEDPARM(sel std::vector< int >::value_type *arg4 = 0 ; void *argp1 = 0 ; int res1 = 0 ; - swig::PySwigIterator *iter2 = 0 ; + swig::SwigPyIterator *iter2 = 0 ; int res2 ; size_t val3 ; int ecode3 = 0 ; @@ -6604,11 +7231,11 @@ SWIGINTERN PyObject *_wrap_IntVector_insert__SWIG_1(PyObject *SWIGUNUSEDPARM(sel SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_insert" "', argument " "1"" of type '" "std::vector< int > *""'"); } arg1 = reinterpret_cast< std::vector< int > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0); if (!SWIG_IsOK(res2) || !iter2) { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "IntVector_insert" "', argument " "2"" of type '" "std::vector< int >::iterator""'"); } else { - swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + swig::SwigPyIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); if (iter_t) { arg2 = iter_t->get_current(); } else { @@ -6649,9 +7276,9 @@ SWIGINTERN PyObject *_wrap_IntVector_insert(PyObject *self, PyObject *args) { int res = swig::asptr(argv[0], (std::vector >**)(0)); _v = SWIG_CheckState(res); if (_v) { - swig::PySwigIterator *iter = 0; - int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); - _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + swig::SwigPyIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); if (_v) { { int res = SWIG_AsVal_int(argv[2], NULL); @@ -6668,9 +7295,9 @@ SWIGINTERN PyObject *_wrap_IntVector_insert(PyObject *self, PyObject *args) { int res = swig::asptr(argv[0], (std::vector >**)(0)); _v = SWIG_CheckState(res); if (_v) { - swig::PySwigIterator *iter = 0; - int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); - _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + swig::SwigPyIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); if (_v) { { int res = SWIG_AsVal_size_t(argv[2], NULL); @@ -6785,7 +7412,7 @@ SWIGINTERN PyObject *_wrap_DoubleVector_iterator(PyObject *SWIGUNUSEDPARM(self), void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - swig::PySwigIterator *result = 0 ; + swig::SwigPyIterator *result = 0 ; arg2 = &obj0; if (!PyArg_ParseTuple(args,(char *)"O:DoubleVector_iterator",&obj0)) SWIG_fail; @@ -6794,8 +7421,8 @@ SWIGINTERN PyObject *_wrap_DoubleVector_iterator(PyObject *SWIGUNUSEDPARM(self), SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_iterator" "', argument " "1"" of type '" "std::vector< double > *""'"); } arg1 = reinterpret_cast< std::vector< double > * >(argp1); - result = (swig::PySwigIterator *)std_vector_Sl_double_Sg__iterator(arg1,arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_OWN | 0 ); + result = (swig::SwigPyIterator *)std_vector_Sl_double_Sg__iterator(arg1,arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; @@ -6824,6 +7451,28 @@ fail: } +SWIGINTERN PyObject *_wrap_DoubleVector___bool__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector< double > *arg1 = (std::vector< double > *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + bool result; + + if (!PyArg_ParseTuple(args,(char *)"O:DoubleVector___bool__",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector___bool__" "', argument " "1"" of type '" "std::vector< double > const *""'"); + } + arg1 = reinterpret_cast< std::vector< double > * >(argp1); + result = (bool)std_vector_Sl_double_Sg____bool__((std::vector< double > const *)arg1); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_DoubleVector___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< double > *arg1 = (std::vector< double > *) 0 ; @@ -7029,7 +7678,7 @@ fail: } -SWIGINTERN PyObject *_wrap_DoubleVector___delitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_DoubleVector___delitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< double > *arg1 = (std::vector< double > *) 0 ; std::vector< double >::difference_type arg2 ; @@ -7052,7 +7701,7 @@ SWIGINTERN PyObject *_wrap_DoubleVector___delitem__(PyObject *SWIGUNUSEDPARM(sel } arg2 = static_cast< std::vector< double >::difference_type >(val2); try { - std_vector_Sl_double_Sg____delitem__(arg1,arg2); + std_vector_Sl_double_Sg____delitem____SWIG_0(arg1,arg2); } catch(std::out_of_range &_e) { SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); @@ -7065,7 +7714,170 @@ fail: } -SWIGINTERN PyObject *_wrap_DoubleVector___getitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_DoubleVector___getitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector< double > *arg1 = (std::vector< double > *) 0 ; + PySliceObject *arg2 = (PySliceObject *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + std::vector< double,std::allocator< double > > *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:DoubleVector___getitem__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector___getitem__" "', argument " "1"" of type '" "std::vector< double > *""'"); + } + arg1 = reinterpret_cast< std::vector< double > * >(argp1); + { + arg2 = (PySliceObject *) obj1; + } + try { + result = (std::vector< double,std::allocator< double > > *)std_vector_Sl_double_Sg____getitem____SWIG_0(arg1,arg2); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_DoubleVector___setitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector< double > *arg1 = (std::vector< double > *) 0 ; + PySliceObject *arg2 = (PySliceObject *) 0 ; + std::vector< double,std::allocator< double > > *arg3 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res3 = SWIG_OLDOBJ ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:DoubleVector___setitem__",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector___setitem__" "', argument " "1"" of type '" "std::vector< double > *""'"); + } + arg1 = reinterpret_cast< std::vector< double > * >(argp1); + { + arg2 = (PySliceObject *) obj1; + } + { + std::vector > *ptr = (std::vector > *)0; + res3 = swig::asptr(obj2, &ptr); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "DoubleVector___setitem__" "', argument " "3"" of type '" "std::vector< double,std::allocator< double > > const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "DoubleVector___setitem__" "', argument " "3"" of type '" "std::vector< double,std::allocator< double > > const &""'"); + } + arg3 = ptr; + } + try { + std_vector_Sl_double_Sg____setitem____SWIG_0(arg1,arg2,(std::vector< double,std::allocator< double > > const &)*arg3); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + catch(std::invalid_argument &_e) { + SWIG_exception_fail(SWIG_ValueError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + if (SWIG_IsNewObj(res3)) delete arg3; + return resultobj; +fail: + if (SWIG_IsNewObj(res3)) delete arg3; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_DoubleVector___delitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector< double > *arg1 = (std::vector< double > *) 0 ; + PySliceObject *arg2 = (PySliceObject *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:DoubleVector___delitem__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector___delitem__" "', argument " "1"" of type '" "std::vector< double > *""'"); + } + arg1 = reinterpret_cast< std::vector< double > * >(argp1); + { + arg2 = (PySliceObject *) obj1; + } + try { + std_vector_Sl_double_Sg____delitem____SWIG_1(arg1,arg2); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_DoubleVector___delitem__(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[3]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = (int)PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 2); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 2) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + _v = PySlice_Check(argv[1]); + } + if (_v) { + return _wrap_DoubleVector___delitem____SWIG_1(self, args); + } + } + } + if (argc == 2) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_DoubleVector___delitem____SWIG_0(self, args); + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'DoubleVector___delitem__'.\n" + " Possible C/C++ prototypes are:\n" + " __delitem__(std::vector< double > *,std::vector< double >::difference_type)\n" + " __delitem__(std::vector< double > *,PySliceObject *)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_DoubleVector___getitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< double > *arg1 = (std::vector< double > *) 0 ; std::vector< double >::difference_type arg2 ; @@ -7089,10 +7901,7 @@ SWIGINTERN PyObject *_wrap_DoubleVector___getitem__(PyObject *SWIGUNUSEDPARM(sel } arg2 = static_cast< std::vector< double >::difference_type >(val2); try { - { - std::vector< double >::value_type const &_result_ref = std_vector_Sl_double_Sg____getitem__((std::vector< double > const *)arg1,arg2); - result = (std::vector< double >::value_type *) &_result_ref; - } + result = (std::vector< double >::value_type *) &std_vector_Sl_double_Sg____getitem____SWIG_1((std::vector< double > const *)arg1,arg2); } catch(std::out_of_range &_e) { SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); @@ -7105,7 +7914,54 @@ fail: } -SWIGINTERN PyObject *_wrap_DoubleVector___setitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_DoubleVector___getitem__(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[3]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = (int)PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 2); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 2) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + _v = PySlice_Check(argv[1]); + } + if (_v) { + return _wrap_DoubleVector___getitem____SWIG_0(self, args); + } + } + } + if (argc == 2) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_DoubleVector___getitem____SWIG_1(self, args); + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'DoubleVector___getitem__'.\n" + " Possible C/C++ prototypes are:\n" + " __getitem__(std::vector< double > *,PySliceObject *)\n" + " __getitem__(std::vector< double > const *,std::vector< double >::difference_type)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_DoubleVector___setitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< double > *arg1 = (std::vector< double > *) 0 ; std::vector< double >::difference_type arg2 ; @@ -7139,7 +7995,7 @@ SWIGINTERN PyObject *_wrap_DoubleVector___setitem__(PyObject *SWIGUNUSEDPARM(sel temp3 = static_cast< std::vector< double >::value_type >(val3); arg3 = &temp3; try { - std_vector_Sl_double_Sg____setitem__(arg1,arg2,(double const &)*arg3); + std_vector_Sl_double_Sg____setitem____SWIG_1(arg1,arg2,(double const &)*arg3); } catch(std::out_of_range &_e) { SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); @@ -7152,6 +8008,63 @@ fail: } +SWIGINTERN PyObject *_wrap_DoubleVector___setitem__(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[4]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = (int)PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 3); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 3) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + _v = PySlice_Check(argv[1]); + } + if (_v) { + int res = swig::asptr(argv[2], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_DoubleVector___setitem____SWIG_0(self, args); + } + } + } + } + if (argc == 3) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_double(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_DoubleVector___setitem____SWIG_1(self, args); + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'DoubleVector___setitem__'.\n" + " Possible C/C++ prototypes are:\n" + " __setitem__(std::vector< double > *,PySliceObject *,std::vector< double,std::allocator< double > > const &)\n" + " __setitem__(std::vector< double > *,std::vector< double >::difference_type,std::vector< double >::value_type const &)\n"); + return NULL; +} + + SWIGINTERN PyObject *_wrap_DoubleVector_append(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< double > *arg1 = (std::vector< double > *) 0 ; @@ -7362,7 +8275,7 @@ SWIGINTERN PyObject *_wrap_DoubleVector_begin(PyObject *SWIGUNUSEDPARM(self), Py arg1 = reinterpret_cast< std::vector< double > * >(argp1); result = ((std::vector< double > const *)arg1)->begin(); resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< double >::const_iterator & >(result)), - swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); return resultobj; fail: return NULL; @@ -7385,7 +8298,7 @@ SWIGINTERN PyObject *_wrap_DoubleVector_end(PyObject *SWIGUNUSEDPARM(self), PyOb arg1 = reinterpret_cast< std::vector< double > * >(argp1); result = ((std::vector< double > const *)arg1)->end(); resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< double >::const_iterator & >(result)), - swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); return resultobj; fail: return NULL; @@ -7408,7 +8321,7 @@ SWIGINTERN PyObject *_wrap_DoubleVector_rbegin(PyObject *SWIGUNUSEDPARM(self), P arg1 = reinterpret_cast< std::vector< double > * >(argp1); result = ((std::vector< double > const *)arg1)->rbegin(); resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< double >::const_reverse_iterator & >(result)), - swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); return resultobj; fail: return NULL; @@ -7431,7 +8344,7 @@ SWIGINTERN PyObject *_wrap_DoubleVector_rend(PyObject *SWIGUNUSEDPARM(self), PyO arg1 = reinterpret_cast< std::vector< double > * >(argp1); result = ((std::vector< double > const *)arg1)->rend(); resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< double >::const_reverse_iterator & >(result)), - swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); return resultobj; fail: return NULL; @@ -7517,7 +8430,7 @@ SWIGINTERN PyObject *_wrap_DoubleVector_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(s std::vector< double >::iterator arg2 ; void *argp1 = 0 ; int res1 = 0 ; - swig::PySwigIterator *iter2 = 0 ; + swig::SwigPyIterator *iter2 = 0 ; int res2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -7529,11 +8442,11 @@ SWIGINTERN PyObject *_wrap_DoubleVector_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(s SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_erase" "', argument " "1"" of type '" "std::vector< double > *""'"); } arg1 = reinterpret_cast< std::vector< double > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0); if (!SWIG_IsOK(res2) || !iter2) { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleVector_erase" "', argument " "2"" of type '" "std::vector< double >::iterator""'"); } else { - swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + swig::SwigPyIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); if (iter_t) { arg2 = iter_t->get_current(); } else { @@ -7542,7 +8455,7 @@ SWIGINTERN PyObject *_wrap_DoubleVector_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(s } result = (arg1)->erase(arg2); resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< double >::iterator & >(result)), - swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); return resultobj; fail: return NULL; @@ -7556,9 +8469,9 @@ SWIGINTERN PyObject *_wrap_DoubleVector_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(s std::vector< double >::iterator arg3 ; void *argp1 = 0 ; int res1 = 0 ; - swig::PySwigIterator *iter2 = 0 ; + swig::SwigPyIterator *iter2 = 0 ; int res2 ; - swig::PySwigIterator *iter3 = 0 ; + swig::SwigPyIterator *iter3 = 0 ; int res3 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -7571,22 +8484,22 @@ SWIGINTERN PyObject *_wrap_DoubleVector_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(s SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_erase" "', argument " "1"" of type '" "std::vector< double > *""'"); } arg1 = reinterpret_cast< std::vector< double > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0); if (!SWIG_IsOK(res2) || !iter2) { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleVector_erase" "', argument " "2"" of type '" "std::vector< double >::iterator""'"); } else { - swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + swig::SwigPyIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); if (iter_t) { arg2 = iter_t->get_current(); } else { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleVector_erase" "', argument " "2"" of type '" "std::vector< double >::iterator""'"); } } - res3 = SWIG_ConvertPtr(obj2, SWIG_as_voidptrptr(&iter3), swig::PySwigIterator::descriptor(), 0); + res3 = SWIG_ConvertPtr(obj2, SWIG_as_voidptrptr(&iter3), swig::SwigPyIterator::descriptor(), 0); if (!SWIG_IsOK(res3) || !iter3) { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleVector_erase" "', argument " "3"" of type '" "std::vector< double >::iterator""'"); } else { - swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter3); + swig::SwigPyIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter3); if (iter_t) { arg3 = iter_t->get_current(); } else { @@ -7595,7 +8508,7 @@ SWIGINTERN PyObject *_wrap_DoubleVector_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(s } result = (arg1)->erase(arg2,arg3); resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< double >::iterator & >(result)), - swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); return resultobj; fail: return NULL; @@ -7617,9 +8530,9 @@ SWIGINTERN PyObject *_wrap_DoubleVector_erase(PyObject *self, PyObject *args) { int res = swig::asptr(argv[0], (std::vector >**)(0)); _v = SWIG_CheckState(res); if (_v) { - swig::PySwigIterator *iter = 0; - int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); - _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + swig::SwigPyIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); if (_v) { return _wrap_DoubleVector_erase__SWIG_0(self, args); } @@ -7630,13 +8543,13 @@ SWIGINTERN PyObject *_wrap_DoubleVector_erase(PyObject *self, PyObject *args) { int res = swig::asptr(argv[0], (std::vector >**)(0)); _v = SWIG_CheckState(res); if (_v) { - swig::PySwigIterator *iter = 0; - int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); - _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + swig::SwigPyIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); if (_v) { - swig::PySwigIterator *iter = 0; - int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); - _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + swig::SwigPyIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); if (_v) { return _wrap_DoubleVector_erase__SWIG_1(self, args); } @@ -7791,10 +8704,7 @@ SWIGINTERN PyObject *_wrap_DoubleVector_front(PyObject *SWIGUNUSEDPARM(self), Py SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_front" "', argument " "1"" of type '" "std::vector< double > const *""'"); } arg1 = reinterpret_cast< std::vector< double > * >(argp1); - { - std::vector< double >::value_type const &_result_ref = ((std::vector< double > const *)arg1)->front(); - result = (std::vector< double >::value_type *) &_result_ref; - } + result = (std::vector< double >::value_type *) &((std::vector< double > const *)arg1)->front(); resultobj = SWIG_From_double(static_cast< double >(*result)); return resultobj; fail: @@ -7816,10 +8726,7 @@ SWIGINTERN PyObject *_wrap_DoubleVector_back(PyObject *SWIGUNUSEDPARM(self), PyO SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_back" "', argument " "1"" of type '" "std::vector< double > const *""'"); } arg1 = reinterpret_cast< std::vector< double > * >(argp1); - { - std::vector< double >::value_type const &_result_ref = ((std::vector< double > const *)arg1)->back(); - result = (std::vector< double >::value_type *) &_result_ref; - } + result = (std::vector< double >::value_type *) &((std::vector< double > const *)arg1)->back(); resultobj = SWIG_From_double(static_cast< double >(*result)); return resultobj; fail: @@ -7970,7 +8877,7 @@ SWIGINTERN PyObject *_wrap_DoubleVector_insert__SWIG_0(PyObject *SWIGUNUSEDPARM( std::vector< double >::value_type *arg3 = 0 ; void *argp1 = 0 ; int res1 = 0 ; - swig::PySwigIterator *iter2 = 0 ; + swig::SwigPyIterator *iter2 = 0 ; int res2 ; std::vector< double >::value_type temp3 ; double val3 ; @@ -7986,11 +8893,11 @@ SWIGINTERN PyObject *_wrap_DoubleVector_insert__SWIG_0(PyObject *SWIGUNUSEDPARM( SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_insert" "', argument " "1"" of type '" "std::vector< double > *""'"); } arg1 = reinterpret_cast< std::vector< double > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0); if (!SWIG_IsOK(res2) || !iter2) { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleVector_insert" "', argument " "2"" of type '" "std::vector< double >::iterator""'"); } else { - swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + swig::SwigPyIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); if (iter_t) { arg2 = iter_t->get_current(); } else { @@ -8005,7 +8912,7 @@ SWIGINTERN PyObject *_wrap_DoubleVector_insert__SWIG_0(PyObject *SWIGUNUSEDPARM( arg3 = &temp3; result = (arg1)->insert(arg2,(std::vector< double >::value_type const &)*arg3); resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< double >::iterator & >(result)), - swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); return resultobj; fail: return NULL; @@ -8020,7 +8927,7 @@ SWIGINTERN PyObject *_wrap_DoubleVector_insert__SWIG_1(PyObject *SWIGUNUSEDPARM( std::vector< double >::value_type *arg4 = 0 ; void *argp1 = 0 ; int res1 = 0 ; - swig::PySwigIterator *iter2 = 0 ; + swig::SwigPyIterator *iter2 = 0 ; int res2 ; size_t val3 ; int ecode3 = 0 ; @@ -8038,11 +8945,11 @@ SWIGINTERN PyObject *_wrap_DoubleVector_insert__SWIG_1(PyObject *SWIGUNUSEDPARM( SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_insert" "', argument " "1"" of type '" "std::vector< double > *""'"); } arg1 = reinterpret_cast< std::vector< double > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0); if (!SWIG_IsOK(res2) || !iter2) { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleVector_insert" "', argument " "2"" of type '" "std::vector< double >::iterator""'"); } else { - swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + swig::SwigPyIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); if (iter_t) { arg2 = iter_t->get_current(); } else { @@ -8083,9 +8990,9 @@ SWIGINTERN PyObject *_wrap_DoubleVector_insert(PyObject *self, PyObject *args) { int res = swig::asptr(argv[0], (std::vector >**)(0)); _v = SWIG_CheckState(res); if (_v) { - swig::PySwigIterator *iter = 0; - int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); - _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + swig::SwigPyIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); if (_v) { { int res = SWIG_AsVal_double(argv[2], NULL); @@ -8102,9 +9009,9 @@ SWIGINTERN PyObject *_wrap_DoubleVector_insert(PyObject *self, PyObject *args) { int res = swig::asptr(argv[0], (std::vector >**)(0)); _v = SWIG_CheckState(res); if (_v) { - swig::PySwigIterator *iter = 0; - int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); - _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + swig::SwigPyIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); if (_v) { { int res = SWIG_AsVal_size_t(argv[2], NULL); @@ -8219,7 +9126,7 @@ SWIGINTERN PyObject *_wrap_ImageVector_iterator(PyObject *SWIGUNUSEDPARM(self), void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - swig::PySwigIterator *result = 0 ; + swig::SwigPyIterator *result = 0 ; arg2 = &obj0; if (!PyArg_ParseTuple(args,(char *)"O:ImageVector_iterator",&obj0)) SWIG_fail; @@ -8228,8 +9135,8 @@ SWIGINTERN PyObject *_wrap_ImageVector_iterator(PyObject *SWIGUNUSEDPARM(self), SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImageVector_iterator" "', argument " "1"" of type '" "std::vector< vips::VImage > *""'"); } arg1 = reinterpret_cast< std::vector< vips::VImage > * >(argp1); - result = (swig::PySwigIterator *)std_vector_Sl_vips_VImage_Sg__iterator(arg1,arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_OWN | 0 ); + result = (swig::SwigPyIterator *)std_vector_Sl_vips_VImage_Sg__iterator(arg1,arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; @@ -8258,6 +9165,28 @@ fail: } +SWIGINTERN PyObject *_wrap_ImageVector___bool__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector< vips::VImage > *arg1 = (std::vector< vips::VImage > *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + bool result; + + if (!PyArg_ParseTuple(args,(char *)"O:ImageVector___bool__",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImageVector___bool__" "', argument " "1"" of type '" "std::vector< vips::VImage > const *""'"); + } + arg1 = reinterpret_cast< std::vector< vips::VImage > * >(argp1); + result = (bool)std_vector_Sl_vips_VImage_Sg____bool__((std::vector< vips::VImage > const *)arg1); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_ImageVector___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< vips::VImage > *arg1 = (std::vector< vips::VImage > *) 0 ; @@ -8463,7 +9392,7 @@ fail: } -SWIGINTERN PyObject *_wrap_ImageVector___delitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_ImageVector___delitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< vips::VImage > *arg1 = (std::vector< vips::VImage > *) 0 ; std::vector< vips::VImage >::difference_type arg2 ; @@ -8486,7 +9415,7 @@ SWIGINTERN PyObject *_wrap_ImageVector___delitem__(PyObject *SWIGUNUSEDPARM(self } arg2 = static_cast< std::vector< vips::VImage >::difference_type >(val2); try { - std_vector_Sl_vips_VImage_Sg____delitem__(arg1,arg2); + std_vector_Sl_vips_VImage_Sg____delitem____SWIG_0(arg1,arg2); } catch(std::out_of_range &_e) { SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); @@ -8499,7 +9428,170 @@ fail: } -SWIGINTERN PyObject *_wrap_ImageVector___getitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_ImageVector___getitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector< vips::VImage > *arg1 = (std::vector< vips::VImage > *) 0 ; + PySliceObject *arg2 = (PySliceObject *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + std::vector< vips::VImage,std::allocator< vips::VImage > > *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:ImageVector___getitem__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImageVector___getitem__" "', argument " "1"" of type '" "std::vector< vips::VImage > *""'"); + } + arg1 = reinterpret_cast< std::vector< vips::VImage > * >(argp1); + { + arg2 = (PySliceObject *) obj1; + } + try { + result = (std::vector< vips::VImage,std::allocator< vips::VImage > > *)std_vector_Sl_vips_VImage_Sg____getitem____SWIG_0(arg1,arg2); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ImageVector___setitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector< vips::VImage > *arg1 = (std::vector< vips::VImage > *) 0 ; + PySliceObject *arg2 = (PySliceObject *) 0 ; + std::vector< vips::VImage,std::allocator< vips::VImage > > *arg3 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res3 = SWIG_OLDOBJ ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:ImageVector___setitem__",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImageVector___setitem__" "', argument " "1"" of type '" "std::vector< vips::VImage > *""'"); + } + arg1 = reinterpret_cast< std::vector< vips::VImage > * >(argp1); + { + arg2 = (PySliceObject *) obj1; + } + { + std::vector > *ptr = (std::vector > *)0; + res3 = swig::asptr(obj2, &ptr); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ImageVector___setitem__" "', argument " "3"" of type '" "std::vector< vips::VImage,std::allocator< vips::VImage > > const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ImageVector___setitem__" "', argument " "3"" of type '" "std::vector< vips::VImage,std::allocator< vips::VImage > > const &""'"); + } + arg3 = ptr; + } + try { + std_vector_Sl_vips_VImage_Sg____setitem____SWIG_0(arg1,arg2,(std::vector< vips::VImage,std::allocator< vips::VImage > > const &)*arg3); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + catch(std::invalid_argument &_e) { + SWIG_exception_fail(SWIG_ValueError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + if (SWIG_IsNewObj(res3)) delete arg3; + return resultobj; +fail: + if (SWIG_IsNewObj(res3)) delete arg3; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ImageVector___delitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector< vips::VImage > *arg1 = (std::vector< vips::VImage > *) 0 ; + PySliceObject *arg2 = (PySliceObject *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:ImageVector___delitem__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImageVector___delitem__" "', argument " "1"" of type '" "std::vector< vips::VImage > *""'"); + } + arg1 = reinterpret_cast< std::vector< vips::VImage > * >(argp1); + { + arg2 = (PySliceObject *) obj1; + } + try { + std_vector_Sl_vips_VImage_Sg____delitem____SWIG_1(arg1,arg2); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ImageVector___delitem__(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[3]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = (int)PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 2); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 2) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + _v = PySlice_Check(argv[1]); + } + if (_v) { + return _wrap_ImageVector___delitem____SWIG_1(self, args); + } + } + } + if (argc == 2) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_ImageVector___delitem____SWIG_0(self, args); + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'ImageVector___delitem__'.\n" + " Possible C/C++ prototypes are:\n" + " __delitem__(std::vector< vips::VImage > *,std::vector< vips::VImage >::difference_type)\n" + " __delitem__(std::vector< vips::VImage > *,PySliceObject *)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ImageVector___getitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< vips::VImage > *arg1 = (std::vector< vips::VImage > *) 0 ; std::vector< vips::VImage >::difference_type arg2 ; @@ -8523,10 +9615,7 @@ SWIGINTERN PyObject *_wrap_ImageVector___getitem__(PyObject *SWIGUNUSEDPARM(self } arg2 = static_cast< std::vector< vips::VImage >::difference_type >(val2); try { - { - std::vector< vips::VImage >::value_type const &_result_ref = std_vector_Sl_vips_VImage_Sg____getitem__((std::vector< vips::VImage > const *)arg1,arg2); - result = (std::vector< vips::VImage >::value_type *) &_result_ref; - } + result = (std::vector< vips::VImage >::value_type *) &std_vector_Sl_vips_VImage_Sg____getitem____SWIG_1((std::vector< vips::VImage > const *)arg1,arg2); } catch(std::out_of_range &_e) { SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); @@ -8539,7 +9628,54 @@ fail: } -SWIGINTERN PyObject *_wrap_ImageVector___setitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_ImageVector___getitem__(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[3]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = (int)PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 2); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 2) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + _v = PySlice_Check(argv[1]); + } + if (_v) { + return _wrap_ImageVector___getitem____SWIG_0(self, args); + } + } + } + if (argc == 2) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_ImageVector___getitem____SWIG_1(self, args); + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'ImageVector___getitem__'.\n" + " Possible C/C++ prototypes are:\n" + " __getitem__(std::vector< vips::VImage > *,PySliceObject *)\n" + " __getitem__(std::vector< vips::VImage > const *,std::vector< vips::VImage >::difference_type)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ImageVector___setitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< vips::VImage > *arg1 = (std::vector< vips::VImage > *) 0 ; std::vector< vips::VImage >::difference_type arg2 ; @@ -8574,7 +9710,7 @@ SWIGINTERN PyObject *_wrap_ImageVector___setitem__(PyObject *SWIGUNUSEDPARM(self } arg3 = reinterpret_cast< std::vector< vips::VImage >::value_type * >(argp3); try { - std_vector_Sl_vips_VImage_Sg____setitem__(arg1,arg2,(vips::VImage const &)*arg3); + std_vector_Sl_vips_VImage_Sg____setitem____SWIG_1(arg1,arg2,(vips::VImage const &)*arg3); } catch(std::out_of_range &_e) { SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); @@ -8587,6 +9723,61 @@ fail: } +SWIGINTERN PyObject *_wrap_ImageVector___setitem__(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[4]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = (int)PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 3); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 3) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + _v = PySlice_Check(argv[1]); + } + if (_v) { + int res = swig::asptr(argv[2], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_ImageVector___setitem____SWIG_0(self, args); + } + } + } + } + if (argc == 3) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t__value_type, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_ImageVector___setitem____SWIG_1(self, args); + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'ImageVector___setitem__'.\n" + " Possible C/C++ prototypes are:\n" + " __setitem__(std::vector< vips::VImage > *,PySliceObject *,std::vector< vips::VImage,std::allocator< vips::VImage > > const &)\n" + " __setitem__(std::vector< vips::VImage > *,std::vector< vips::VImage >::difference_type,std::vector< vips::VImage >::value_type const &)\n"); + return NULL; +} + + SWIGINTERN PyObject *_wrap_ImageVector_append(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< vips::VImage > *arg1 = (std::vector< vips::VImage > *) 0 ; @@ -8798,7 +9989,7 @@ SWIGINTERN PyObject *_wrap_ImageVector_begin(PyObject *SWIGUNUSEDPARM(self), PyO arg1 = reinterpret_cast< std::vector< vips::VImage > * >(argp1); result = ((std::vector< vips::VImage > const *)arg1)->begin(); resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< vips::VImage >::const_iterator & >(result)), - swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); return resultobj; fail: return NULL; @@ -8821,7 +10012,7 @@ SWIGINTERN PyObject *_wrap_ImageVector_end(PyObject *SWIGUNUSEDPARM(self), PyObj arg1 = reinterpret_cast< std::vector< vips::VImage > * >(argp1); result = ((std::vector< vips::VImage > const *)arg1)->end(); resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< vips::VImage >::const_iterator & >(result)), - swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); return resultobj; fail: return NULL; @@ -8844,7 +10035,7 @@ SWIGINTERN PyObject *_wrap_ImageVector_rbegin(PyObject *SWIGUNUSEDPARM(self), Py arg1 = reinterpret_cast< std::vector< vips::VImage > * >(argp1); result = ((std::vector< vips::VImage > const *)arg1)->rbegin(); resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< vips::VImage >::const_reverse_iterator & >(result)), - swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); return resultobj; fail: return NULL; @@ -8867,7 +10058,7 @@ SWIGINTERN PyObject *_wrap_ImageVector_rend(PyObject *SWIGUNUSEDPARM(self), PyOb arg1 = reinterpret_cast< std::vector< vips::VImage > * >(argp1); result = ((std::vector< vips::VImage > const *)arg1)->rend(); resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< vips::VImage >::const_reverse_iterator & >(result)), - swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); return resultobj; fail: return NULL; @@ -8953,7 +10144,7 @@ SWIGINTERN PyObject *_wrap_ImageVector_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(se std::vector< vips::VImage >::iterator arg2 ; void *argp1 = 0 ; int res1 = 0 ; - swig::PySwigIterator *iter2 = 0 ; + swig::SwigPyIterator *iter2 = 0 ; int res2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -8965,11 +10156,11 @@ SWIGINTERN PyObject *_wrap_ImageVector_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(se SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImageVector_erase" "', argument " "1"" of type '" "std::vector< vips::VImage > *""'"); } arg1 = reinterpret_cast< std::vector< vips::VImage > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0); if (!SWIG_IsOK(res2) || !iter2) { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "ImageVector_erase" "', argument " "2"" of type '" "std::vector< vips::VImage >::iterator""'"); } else { - swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + swig::SwigPyIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); if (iter_t) { arg2 = iter_t->get_current(); } else { @@ -8978,7 +10169,7 @@ SWIGINTERN PyObject *_wrap_ImageVector_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(se } result = (arg1)->erase(arg2); resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< vips::VImage >::iterator & >(result)), - swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); return resultobj; fail: return NULL; @@ -8992,9 +10183,9 @@ SWIGINTERN PyObject *_wrap_ImageVector_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(se std::vector< vips::VImage >::iterator arg3 ; void *argp1 = 0 ; int res1 = 0 ; - swig::PySwigIterator *iter2 = 0 ; + swig::SwigPyIterator *iter2 = 0 ; int res2 ; - swig::PySwigIterator *iter3 = 0 ; + swig::SwigPyIterator *iter3 = 0 ; int res3 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -9007,22 +10198,22 @@ SWIGINTERN PyObject *_wrap_ImageVector_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(se SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImageVector_erase" "', argument " "1"" of type '" "std::vector< vips::VImage > *""'"); } arg1 = reinterpret_cast< std::vector< vips::VImage > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0); if (!SWIG_IsOK(res2) || !iter2) { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "ImageVector_erase" "', argument " "2"" of type '" "std::vector< vips::VImage >::iterator""'"); } else { - swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + swig::SwigPyIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); if (iter_t) { arg2 = iter_t->get_current(); } else { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "ImageVector_erase" "', argument " "2"" of type '" "std::vector< vips::VImage >::iterator""'"); } } - res3 = SWIG_ConvertPtr(obj2, SWIG_as_voidptrptr(&iter3), swig::PySwigIterator::descriptor(), 0); + res3 = SWIG_ConvertPtr(obj2, SWIG_as_voidptrptr(&iter3), swig::SwigPyIterator::descriptor(), 0); if (!SWIG_IsOK(res3) || !iter3) { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "ImageVector_erase" "', argument " "3"" of type '" "std::vector< vips::VImage >::iterator""'"); } else { - swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter3); + swig::SwigPyIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter3); if (iter_t) { arg3 = iter_t->get_current(); } else { @@ -9031,7 +10222,7 @@ SWIGINTERN PyObject *_wrap_ImageVector_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(se } result = (arg1)->erase(arg2,arg3); resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< vips::VImage >::iterator & >(result)), - swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); return resultobj; fail: return NULL; @@ -9053,9 +10244,9 @@ SWIGINTERN PyObject *_wrap_ImageVector_erase(PyObject *self, PyObject *args) { int res = swig::asptr(argv[0], (std::vector >**)(0)); _v = SWIG_CheckState(res); if (_v) { - swig::PySwigIterator *iter = 0; - int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); - _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + swig::SwigPyIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); if (_v) { return _wrap_ImageVector_erase__SWIG_0(self, args); } @@ -9066,13 +10257,13 @@ SWIGINTERN PyObject *_wrap_ImageVector_erase(PyObject *self, PyObject *args) { int res = swig::asptr(argv[0], (std::vector >**)(0)); _v = SWIG_CheckState(res); if (_v) { - swig::PySwigIterator *iter = 0; - int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); - _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + swig::SwigPyIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); if (_v) { - swig::PySwigIterator *iter = 0; - int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); - _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + swig::SwigPyIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); if (_v) { return _wrap_ImageVector_erase__SWIG_1(self, args); } @@ -9227,10 +10418,7 @@ SWIGINTERN PyObject *_wrap_ImageVector_front(PyObject *SWIGUNUSEDPARM(self), PyO SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImageVector_front" "', argument " "1"" of type '" "std::vector< vips::VImage > const *""'"); } arg1 = reinterpret_cast< std::vector< vips::VImage > * >(argp1); - { - std::vector< vips::VImage >::value_type const &_result_ref = ((std::vector< vips::VImage > const *)arg1)->front(); - result = (std::vector< vips::VImage >::value_type *) &_result_ref; - } + result = (std::vector< vips::VImage >::value_type *) &((std::vector< vips::VImage > const *)arg1)->front(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t__value_type, 0 | 0 ); return resultobj; fail: @@ -9252,10 +10440,7 @@ SWIGINTERN PyObject *_wrap_ImageVector_back(PyObject *SWIGUNUSEDPARM(self), PyOb SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImageVector_back" "', argument " "1"" of type '" "std::vector< vips::VImage > const *""'"); } arg1 = reinterpret_cast< std::vector< vips::VImage > * >(argp1); - { - std::vector< vips::VImage >::value_type const &_result_ref = ((std::vector< vips::VImage > const *)arg1)->back(); - result = (std::vector< vips::VImage >::value_type *) &_result_ref; - } + result = (std::vector< vips::VImage >::value_type *) &((std::vector< vips::VImage > const *)arg1)->back(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t__value_type, 0 | 0 ); return resultobj; fail: @@ -9406,7 +10591,7 @@ SWIGINTERN PyObject *_wrap_ImageVector_insert__SWIG_0(PyObject *SWIGUNUSEDPARM(s std::vector< vips::VImage >::value_type *arg3 = 0 ; void *argp1 = 0 ; int res1 = 0 ; - swig::PySwigIterator *iter2 = 0 ; + swig::SwigPyIterator *iter2 = 0 ; int res2 ; void *argp3 = 0 ; int res3 = 0 ; @@ -9421,11 +10606,11 @@ SWIGINTERN PyObject *_wrap_ImageVector_insert__SWIG_0(PyObject *SWIGUNUSEDPARM(s SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImageVector_insert" "', argument " "1"" of type '" "std::vector< vips::VImage > *""'"); } arg1 = reinterpret_cast< std::vector< vips::VImage > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0); if (!SWIG_IsOK(res2) || !iter2) { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "ImageVector_insert" "', argument " "2"" of type '" "std::vector< vips::VImage >::iterator""'"); } else { - swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + swig::SwigPyIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); if (iter_t) { arg2 = iter_t->get_current(); } else { @@ -9442,7 +10627,7 @@ SWIGINTERN PyObject *_wrap_ImageVector_insert__SWIG_0(PyObject *SWIGUNUSEDPARM(s arg3 = reinterpret_cast< std::vector< vips::VImage >::value_type * >(argp3); result = (arg1)->insert(arg2,(std::vector< vips::VImage >::value_type const &)*arg3); resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< vips::VImage >::iterator & >(result)), - swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); return resultobj; fail: return NULL; @@ -9457,7 +10642,7 @@ SWIGINTERN PyObject *_wrap_ImageVector_insert__SWIG_1(PyObject *SWIGUNUSEDPARM(s std::vector< vips::VImage >::value_type *arg4 = 0 ; void *argp1 = 0 ; int res1 = 0 ; - swig::PySwigIterator *iter2 = 0 ; + swig::SwigPyIterator *iter2 = 0 ; int res2 ; size_t val3 ; int ecode3 = 0 ; @@ -9474,11 +10659,11 @@ SWIGINTERN PyObject *_wrap_ImageVector_insert__SWIG_1(PyObject *SWIGUNUSEDPARM(s SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImageVector_insert" "', argument " "1"" of type '" "std::vector< vips::VImage > *""'"); } arg1 = reinterpret_cast< std::vector< vips::VImage > * >(argp1); - res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0); if (!SWIG_IsOK(res2) || !iter2) { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "ImageVector_insert" "', argument " "2"" of type '" "std::vector< vips::VImage >::iterator""'"); } else { - swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + swig::SwigPyIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); if (iter_t) { arg2 = iter_t->get_current(); } else { @@ -9521,9 +10706,9 @@ SWIGINTERN PyObject *_wrap_ImageVector_insert(PyObject *self, PyObject *args) { int res = swig::asptr(argv[0], (std::vector >**)(0)); _v = SWIG_CheckState(res); if (_v) { - swig::PySwigIterator *iter = 0; - int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); - _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + swig::SwigPyIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); if (_v) { int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t__value_type, 0); _v = SWIG_CheckState(res); @@ -9538,9 +10723,9 @@ SWIGINTERN PyObject *_wrap_ImageVector_insert(PyObject *self, PyObject *args) { int res = swig::asptr(argv[0], (std::vector >**)(0)); _v = SWIG_CheckState(res); if (_v) { - swig::PySwigIterator *iter = 0; - int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); - _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + swig::SwigPyIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); if (_v) { { int res = SWIG_AsVal_size_t(argv[2], NULL); @@ -10039,10 +11224,7 @@ SWIGINTERN PyObject *_wrap_VImage___assign__(PyObject *SWIGUNUSEDPARM(self), PyO } arg2 = reinterpret_cast< vips::VImage * >(argp2); try { - { - vips::VImage &_result_ref = (arg1)->operator =((vips::VImage const &)*arg2); - result = (vips::VImage *) &_result_ref; - } + result = (vips::VImage *) &(arg1)->operator =((vips::VImage const &)*arg2); } catch(vips::VError &_e) { SWIG_Python_Raise(SWIG_NewPointerObj((new vips::VError(static_cast< const vips::VError& >(_e))),SWIGTYPE_p_vips__VError,SWIG_POINTER_OWN), "vips::VError", SWIGTYPE_p_vips__VError); SWIG_fail; @@ -27507,25 +28689,28 @@ fail: static PyMethodDef SwigMethods[] = { - { (char *)"delete_PySwigIterator", _wrap_delete_PySwigIterator, METH_VARARGS, NULL}, - { (char *)"PySwigIterator_value", _wrap_PySwigIterator_value, METH_VARARGS, NULL}, - { (char *)"PySwigIterator_incr", _wrap_PySwigIterator_incr, METH_VARARGS, NULL}, - { (char *)"PySwigIterator_decr", _wrap_PySwigIterator_decr, METH_VARARGS, NULL}, - { (char *)"PySwigIterator_distance", _wrap_PySwigIterator_distance, METH_VARARGS, NULL}, - { (char *)"PySwigIterator_equal", _wrap_PySwigIterator_equal, METH_VARARGS, NULL}, - { (char *)"PySwigIterator_copy", _wrap_PySwigIterator_copy, METH_VARARGS, NULL}, - { (char *)"PySwigIterator_next", _wrap_PySwigIterator_next, METH_VARARGS, NULL}, - { (char *)"PySwigIterator_previous", _wrap_PySwigIterator_previous, METH_VARARGS, NULL}, - { (char *)"PySwigIterator_advance", _wrap_PySwigIterator_advance, METH_VARARGS, NULL}, - { (char *)"PySwigIterator___eq__", _wrap_PySwigIterator___eq__, METH_VARARGS, NULL}, - { (char *)"PySwigIterator___ne__", _wrap_PySwigIterator___ne__, METH_VARARGS, NULL}, - { (char *)"PySwigIterator___iadd__", _wrap_PySwigIterator___iadd__, METH_VARARGS, NULL}, - { (char *)"PySwigIterator___isub__", _wrap_PySwigIterator___isub__, METH_VARARGS, NULL}, - { (char *)"PySwigIterator___add__", _wrap_PySwigIterator___add__, METH_VARARGS, NULL}, - { (char *)"PySwigIterator___sub__", _wrap_PySwigIterator___sub__, METH_VARARGS, NULL}, - { (char *)"PySwigIterator_swigregister", PySwigIterator_swigregister, METH_VARARGS, NULL}, + { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL}, + { (char *)"delete_SwigPyIterator", _wrap_delete_SwigPyIterator, METH_VARARGS, NULL}, + { (char *)"SwigPyIterator_value", _wrap_SwigPyIterator_value, METH_VARARGS, NULL}, + { (char *)"SwigPyIterator_incr", _wrap_SwigPyIterator_incr, METH_VARARGS, NULL}, + { (char *)"SwigPyIterator_decr", _wrap_SwigPyIterator_decr, METH_VARARGS, NULL}, + { (char *)"SwigPyIterator_distance", _wrap_SwigPyIterator_distance, METH_VARARGS, NULL}, + { (char *)"SwigPyIterator_equal", _wrap_SwigPyIterator_equal, METH_VARARGS, NULL}, + { (char *)"SwigPyIterator_copy", _wrap_SwigPyIterator_copy, METH_VARARGS, NULL}, + { (char *)"SwigPyIterator_next", _wrap_SwigPyIterator_next, METH_VARARGS, NULL}, + { (char *)"SwigPyIterator___next__", _wrap_SwigPyIterator___next__, METH_VARARGS, NULL}, + { (char *)"SwigPyIterator_previous", _wrap_SwigPyIterator_previous, METH_VARARGS, NULL}, + { (char *)"SwigPyIterator_advance", _wrap_SwigPyIterator_advance, METH_VARARGS, NULL}, + { (char *)"SwigPyIterator___eq__", _wrap_SwigPyIterator___eq__, METH_VARARGS, NULL}, + { (char *)"SwigPyIterator___ne__", _wrap_SwigPyIterator___ne__, METH_VARARGS, NULL}, + { (char *)"SwigPyIterator___iadd__", _wrap_SwigPyIterator___iadd__, METH_VARARGS, NULL}, + { (char *)"SwigPyIterator___isub__", _wrap_SwigPyIterator___isub__, METH_VARARGS, NULL}, + { (char *)"SwigPyIterator___add__", _wrap_SwigPyIterator___add__, METH_VARARGS, NULL}, + { (char *)"SwigPyIterator___sub__", _wrap_SwigPyIterator___sub__, METH_VARARGS, NULL}, + { (char *)"SwigPyIterator_swigregister", SwigPyIterator_swigregister, METH_VARARGS, NULL}, { (char *)"IntVector_iterator", _wrap_IntVector_iterator, METH_VARARGS, NULL}, { (char *)"IntVector___nonzero__", _wrap_IntVector___nonzero__, METH_VARARGS, NULL}, + { (char *)"IntVector___bool__", _wrap_IntVector___bool__, METH_VARARGS, NULL}, { (char *)"IntVector___len__", _wrap_IntVector___len__, METH_VARARGS, NULL}, { (char *)"IntVector_pop", _wrap_IntVector_pop, METH_VARARGS, NULL}, { (char *)"IntVector___getslice__", _wrap_IntVector___getslice__, METH_VARARGS, NULL}, @@ -27559,6 +28744,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"IntVector_swigregister", IntVector_swigregister, METH_VARARGS, NULL}, { (char *)"DoubleVector_iterator", _wrap_DoubleVector_iterator, METH_VARARGS, NULL}, { (char *)"DoubleVector___nonzero__", _wrap_DoubleVector___nonzero__, METH_VARARGS, NULL}, + { (char *)"DoubleVector___bool__", _wrap_DoubleVector___bool__, METH_VARARGS, NULL}, { (char *)"DoubleVector___len__", _wrap_DoubleVector___len__, METH_VARARGS, NULL}, { (char *)"DoubleVector_pop", _wrap_DoubleVector_pop, METH_VARARGS, NULL}, { (char *)"DoubleVector___getslice__", _wrap_DoubleVector___getslice__, METH_VARARGS, NULL}, @@ -27592,6 +28778,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"DoubleVector_swigregister", DoubleVector_swigregister, METH_VARARGS, NULL}, { (char *)"ImageVector_iterator", _wrap_ImageVector_iterator, METH_VARARGS, NULL}, { (char *)"ImageVector___nonzero__", _wrap_ImageVector___nonzero__, METH_VARARGS, NULL}, + { (char *)"ImageVector___bool__", _wrap_ImageVector___bool__, METH_VARARGS, NULL}, { (char *)"ImageVector___len__", _wrap_ImageVector___len__, METH_VARARGS, NULL}, { (char *)"ImageVector_pop", _wrap_ImageVector_pop, METH_VARARGS, NULL}, { (char *)"ImageVector___getslice__", _wrap_ImageVector___getslice__, METH_VARARGS, NULL}, @@ -27983,7 +29170,7 @@ static swig_type_info _swigt__p_std__vectorT_int_std__allocatorT_int_t_t__alloca static swig_type_info _swigt__p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t = {"_p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t", "std::vector< vips::VImage > *|std::vector< vips::VImage,std::allocator< vips::VImage > > *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t__allocator_type = {"_p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t__allocator_type", "std::vector< vips::VImage >::allocator_type *|std::allocator< vips::VImage > *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t__value_type = {"_p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t__value_type", "vips::VImage *|std::vector< vips::VImage >::value_type *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_swig__PySwigIterator = {"_p_swig__PySwigIterator", "swig::PySwigIterator *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_swig__SwigPyIterator = {"_p_swig__SwigPyIterator", "swig::SwigPyIterator *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_value_type = {"_p_value_type", "value_type *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_vips__VDMask = {"_p_vips__VDMask", "vips::VDMask *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_vips__VDisplay = {"_p_vips__VDisplay", "vips::VDisplay *", 0, 0, (void*)0, 0}; @@ -28016,7 +29203,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t, &_swigt__p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t__allocator_type, &_swigt__p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t__value_type, - &_swigt__p_swig__PySwigIterator, + &_swigt__p_swig__SwigPyIterator, &_swigt__p_value_type, &_swigt__p_vips__VDMask, &_swigt__p_vips__VDisplay, @@ -28049,7 +29236,7 @@ static swig_cast_info _swigc__p_std__vectorT_int_std__allocatorT_int_t_t__alloca static swig_cast_info _swigc__p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t[] = { {&_swigt__p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t__allocator_type[] = { {&_swigt__p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t__allocator_type, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t__value_type[] = { {&_swigt__p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t__value_type, 0, 0, 0}, {&_swigt__p_vips__VImage, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_swig__PySwigIterator[] = { {&_swigt__p_swig__PySwigIterator, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_swig__SwigPyIterator[] = { {&_swigt__p_swig__SwigPyIterator, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_value_type[] = { {&_swigt__p_value_type, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_vips__VDMask[] = { {&_swigt__p_vips__VDMask, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_vips__VDisplay[] = { {&_swigt__p_vips__VDisplay, 0, 0, 0},{0, 0, 0, 0}}; @@ -28082,7 +29269,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t, _swigc__p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t__allocator_type, _swigc__p_std__vectorT_vips__VImage_std__allocatorT_vips__VImage_t_t__value_type, - _swigc__p_swig__PySwigIterator, + _swigc__p_swig__SwigPyIterator, _swigc__p_value_type, _swigc__p_vips__VDMask, _swigc__p_vips__VDisplay, @@ -28367,26 +29554,58 @@ extern "C" { SWIGINTERN PyObject * swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) { +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_InternFromString(""); +#else return PyString_FromString(""); +#endif } SWIGINTERN PyObject * swig_varlink_str(swig_varlinkobject *v) { +#if PY_VERSION_HEX >= 0x03000000 + PyObject *str = PyUnicode_InternFromString("("); + PyObject *tail; + PyObject *joined; + swig_globalvar *var; + for (var = v->vars; var; var=var->next) { + tail = PyUnicode_FromString(var->name); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; + if (var->next) { + tail = PyUnicode_InternFromString(", "); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; + } + } + tail = PyUnicode_InternFromString(")"); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; +#else PyObject *str = PyString_FromString("("); - swig_globalvar *var; + swig_globalvar *var; for (var = v->vars; var; var=var->next) { PyString_ConcatAndDel(&str,PyString_FromString(var->name)); if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", ")); } PyString_ConcatAndDel(&str,PyString_FromString(")")); +#endif return str; } SWIGINTERN int swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { + char *tmp; PyObject *str = swig_varlink_str(v); fprintf(fp,"Swig global variables "); - fprintf(fp,"%s\n", PyString_AsString(str)); + fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str)); + SWIG_Python_str_DelForPy3(tmp); Py_DECREF(str); return 0; } @@ -28444,12 +29663,17 @@ extern "C" { if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else PyObject_HEAD_INIT(NULL) 0, /* Number of items in variable part (ob_size) */ +#endif (char *)"swigvarlink", /* Type name (tp_name) */ sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */ 0, /* Itemsize (tp_itemsize) */ - (destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */ + (destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */ (printfunc) swig_varlink_print, /* Print (tp_print) */ (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */ (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */ @@ -28460,7 +29684,7 @@ extern "C" { 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ - (reprfunc)swig_varlink_str, /* tp_str */ + (reprfunc) swig_varlink_str, /* tp_str */ 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -28481,7 +29705,10 @@ extern "C" { #endif }; varlink_type = tmp; + /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 varlink_type.ob_type = &PyType_Type; +#endif type_init = 1; } return &varlink_type; @@ -28606,13 +29833,37 @@ extern "C" { #ifdef __cplusplus extern "C" #endif -SWIGEXPORT void SWIG_init(void) { - PyObject *m, *d; + +SWIGEXPORT +#if PY_VERSION_HEX >= 0x03000000 +PyObject* +#else +void +#endif +SWIG_init(void) { + PyObject *m, *d; +#if PY_VERSION_HEX >= 0x03000000 + static struct PyModuleDef SWIG_module = { + PyModuleDef_HEAD_INIT, + (char *) SWIG_name, + NULL, + -1, + SwigMethods, + NULL, + NULL, + NULL, + NULL + }; +#endif /* Fix SwigMethods to carry the callback ptrs when needed */ SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); +#if PY_VERSION_HEX >= 0x03000000 + m = PyModule_Create(&SWIG_module); +#else m = Py_InitModule((char *) SWIG_name, SwigMethods); +#endif d = PyModule_GetDict(m); SWIG_InitializeModule(0); @@ -28713,5 +29964,10 @@ SWIGEXPORT void SWIG_init(void) { args_free (args); } +#if PY_VERSION_HEX >= 0x03000000 + return m; +#else + return; +#endif } diff --git a/swig/python/vipsCC/VDisplay.py b/swig/python/vipsCC/VDisplay.py index f34c2a0f..a581a8c2 100644 --- a/swig/python/vipsCC/VDisplay.py +++ b/swig/python/vipsCC/VDisplay.py @@ -1,12 +1,32 @@ # This file was automatically generated by SWIG (http://www.swig.org). -# Version 1.3.36 +# Version 1.3.40 # -# Don't modify this file, modify the SWIG interface instead. +# Do not make changes to this file unless you know what you are doing--modify +# the SWIG interface file instead. # This file is compatible with both classic and new-style classes. -import vdisplaymodule -import new -new_instancemethod = new.instancemethod +from sys import version_info +if version_info >= (2,6,0): + def swig_import_helper(): + from os.path import dirname + import imp + fp = None + try: + fp, pathname, description = imp.find_module('vdisplaymodule', [dirname(__file__)]) + except ImportError: + import vdisplaymodule + return vdisplaymodule + if fp is not None: + try: + _mod = imp.load_module('vdisplaymodule', fp, pathname, description) + finally: + fp.close() + return _mod + vdisplaymodule = swig_import_helper() + del swig_import_helper +else: + import vdisplaymodule +del version_info try: _swig_property = property except NameError: @@ -14,7 +34,7 @@ except NameError: def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "thisown"): return self.this.own(value) if (name == "this"): - if type(value).__name__ == 'PySwigObject': + if type(value).__name__ == 'SwigPyObject': self.__dict__[name] = value return method = class_type.__swig_setmethods__.get(name,None) @@ -31,21 +51,19 @@ def _swig_getattr(self,class_type,name): if (name == "thisown"): return self.this.own() method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) - raise AttributeError,name + raise AttributeError(name) def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() except: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) -import types try: - _object = types.ObjectType + _object = object _newclass = 1 except AttributeError: class _object : pass _newclass = 0 -del types import VError @@ -61,11 +79,11 @@ class VDisplay(_object): this = vdisplaymodule.new_VDisplay(*args) try: self.this.append(this) except: self.this = this - def __assign__(*args): return vdisplaymodule.VDisplay___assign__(*args) + def __assign__(self, *args): return vdisplaymodule.VDisplay___assign__(self, *args) __swig_destroy__ = vdisplaymodule.delete_VDisplay __del__ = lambda self : None; - def disp(*args): return vdisplaymodule.VDisplay_disp(*args) - def luts(*args): return vdisplaymodule.VDisplay_luts(*args) + def disp(self): return vdisplaymodule.VDisplay_disp(self) + def luts(self): return vdisplaymodule.VDisplay_luts(self) VDisplay_swigregister = vdisplaymodule.VDisplay_swigregister VDisplay_swigregister(VDisplay) diff --git a/swig/python/vipsCC/VError.py b/swig/python/vipsCC/VError.py index ad5562d5..8927ebb4 100644 --- a/swig/python/vipsCC/VError.py +++ b/swig/python/vipsCC/VError.py @@ -1,12 +1,32 @@ # This file was automatically generated by SWIG (http://www.swig.org). -# Version 1.3.36 +# Version 1.3.40 # -# Don't modify this file, modify the SWIG interface instead. +# Do not make changes to this file unless you know what you are doing--modify +# the SWIG interface file instead. # This file is compatible with both classic and new-style classes. -import verrormodule -import new -new_instancemethod = new.instancemethod +from sys import version_info +if version_info >= (2,6,0): + def swig_import_helper(): + from os.path import dirname + import imp + fp = None + try: + fp, pathname, description = imp.find_module('verrormodule', [dirname(__file__)]) + except ImportError: + import verrormodule + return verrormodule + if fp is not None: + try: + _mod = imp.load_module('verrormodule', fp, pathname, description) + finally: + fp.close() + return _mod + verrormodule = swig_import_helper() + del swig_import_helper +else: + import verrormodule +del version_info try: _swig_property = property except NameError: @@ -14,7 +34,7 @@ except NameError: def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "thisown"): return self.this.own(value) if (name == "this"): - if type(value).__name__ == 'PySwigObject': + if type(value).__name__ == 'SwigPyObject': self.__dict__[name] = value return method = class_type.__swig_setmethods__.get(name,None) @@ -31,24 +51,22 @@ def _swig_getattr(self,class_type,name): if (name == "thisown"): return self.this.own() method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) - raise AttributeError,name + raise AttributeError(name) def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() except: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) -import types try: - _object = types.ObjectType + _object = object _newclass = 1 except AttributeError: class _object : pass _newclass = 0 -del types -class VError: +class VError(Exception): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, VError, name, value) __swig_getmethods__ = {} @@ -60,15 +78,21 @@ class VError: except: self.this = this __swig_destroy__ = verrormodule.delete_VError __del__ = lambda self : None; - def perror(*args): return verrormodule.VError_perror(*args) - def app(*args): return verrormodule.VError_app(*args) - def what(*args): return verrormodule.VError_what(*args) - def ostream_print(*args): return verrormodule.VError_ostream_print(*args) - def __str__(*args): return verrormodule.VError___str__(*args) + def perror(self, *args): return verrormodule.VError_perror(self, *args) + def app(self, *args): return verrormodule.VError_app(self, *args) + def what(self): return verrormodule.VError_what(self) + def ostream_print(self, *args): return verrormodule.VError_ostream_print(self, *args) + def __str__(self): return verrormodule.VError___str__(self) VError_swigregister = verrormodule.VError_swigregister VError_swigregister(VError) + +def __lshift__(*args): + return verrormodule.__lshift__(*args) __lshift__ = verrormodule.__lshift__ + +def verror(str = ""): + return verrormodule.verror(str) verror = verrormodule.verror diff --git a/swig/python/vipsCC/VImage.py b/swig/python/vipsCC/VImage.py index cddf1ac7..da9501a4 100644 --- a/swig/python/vipsCC/VImage.py +++ b/swig/python/vipsCC/VImage.py @@ -1,12 +1,32 @@ # This file was automatically generated by SWIG (http://www.swig.org). -# Version 1.3.36 +# Version 1.3.40 # -# Don't modify this file, modify the SWIG interface instead. +# Do not make changes to this file unless you know what you are doing--modify +# the SWIG interface file instead. # This file is compatible with both classic and new-style classes. -import vimagemodule -import new -new_instancemethod = new.instancemethod +from sys import version_info +if version_info >= (2,6,0): + def swig_import_helper(): + from os.path import dirname + import imp + fp = None + try: + fp, pathname, description = imp.find_module('vimagemodule', [dirname(__file__)]) + except ImportError: + import vimagemodule + return vimagemodule + if fp is not None: + try: + _mod = imp.load_module('vimagemodule', fp, pathname, description) + finally: + fp.close() + return _mod + vimagemodule = swig_import_helper() + del swig_import_helper +else: + import vimagemodule +del version_info try: _swig_property = property except NameError: @@ -14,7 +34,7 @@ except NameError: def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "thisown"): return self.this.own(value) if (name == "this"): - if type(value).__name__ == 'PySwigObject': + if type(value).__name__ == 'SwigPyObject': self.__dict__[name] = value return method = class_type.__swig_setmethods__.get(name,None) @@ -31,50 +51,49 @@ def _swig_getattr(self,class_type,name): if (name == "thisown"): return self.this.own() method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) - raise AttributeError,name + raise AttributeError(name) def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() except: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) -import types try: - _object = types.ObjectType + _object = object _newclass = 1 except AttributeError: class _object : pass _newclass = 0 -del types -class PySwigIterator(_object): +class SwigPyIterator(_object): __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, PySwigIterator, name, value) + __setattr__ = lambda self, name, value: _swig_setattr(self, SwigPyIterator, name, value) __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, PySwigIterator, name) - def __init__(self, *args, **kwargs): raise AttributeError, "No constructor defined" + __getattr__ = lambda self, name: _swig_getattr(self, SwigPyIterator, name) + def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract") __repr__ = _swig_repr - __swig_destroy__ = vimagemodule.delete_PySwigIterator + __swig_destroy__ = vimagemodule.delete_SwigPyIterator __del__ = lambda self : None; - def value(*args): return vimagemodule.PySwigIterator_value(*args) - def incr(*args): return vimagemodule.PySwigIterator_incr(*args) - def decr(*args): return vimagemodule.PySwigIterator_decr(*args) - def distance(*args): return vimagemodule.PySwigIterator_distance(*args) - def equal(*args): return vimagemodule.PySwigIterator_equal(*args) - def copy(*args): return vimagemodule.PySwigIterator_copy(*args) - def next(*args): return vimagemodule.PySwigIterator_next(*args) - def previous(*args): return vimagemodule.PySwigIterator_previous(*args) - def advance(*args): return vimagemodule.PySwigIterator_advance(*args) - def __eq__(*args): return vimagemodule.PySwigIterator___eq__(*args) - def __ne__(*args): return vimagemodule.PySwigIterator___ne__(*args) - def __iadd__(*args): return vimagemodule.PySwigIterator___iadd__(*args) - def __isub__(*args): return vimagemodule.PySwigIterator___isub__(*args) - def __add__(*args): return vimagemodule.PySwigIterator___add__(*args) - def __sub__(*args): return vimagemodule.PySwigIterator___sub__(*args) + def value(self): return vimagemodule.SwigPyIterator_value(self) + def incr(self, n = 1): return vimagemodule.SwigPyIterator_incr(self, n) + def decr(self, n = 1): return vimagemodule.SwigPyIterator_decr(self, n) + def distance(self, *args): return vimagemodule.SwigPyIterator_distance(self, *args) + def equal(self, *args): return vimagemodule.SwigPyIterator_equal(self, *args) + def copy(self): return vimagemodule.SwigPyIterator_copy(self) + def next(self): return vimagemodule.SwigPyIterator_next(self) + def __next__(self): return vimagemodule.SwigPyIterator___next__(self) + def previous(self): return vimagemodule.SwigPyIterator_previous(self) + def advance(self, *args): return vimagemodule.SwigPyIterator_advance(self, *args) + def __eq__(self, *args): return vimagemodule.SwigPyIterator___eq__(self, *args) + def __ne__(self, *args): return vimagemodule.SwigPyIterator___ne__(self, *args) + def __iadd__(self, *args): return vimagemodule.SwigPyIterator___iadd__(self, *args) + def __isub__(self, *args): return vimagemodule.SwigPyIterator___isub__(self, *args) + def __add__(self, *args): return vimagemodule.SwigPyIterator___add__(self, *args) + def __sub__(self, *args): return vimagemodule.SwigPyIterator___sub__(self, *args) def __iter__(self): return self -PySwigIterator_swigregister = vimagemodule.PySwigIterator_swigregister -PySwigIterator_swigregister(PySwigIterator) +SwigPyIterator_swigregister = vimagemodule.SwigPyIterator_swigregister +SwigPyIterator_swigregister(SwigPyIterator) import VError import VMask @@ -85,41 +104,42 @@ class IntVector(_object): __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, IntVector, name) __repr__ = _swig_repr - def iterator(*args): return vimagemodule.IntVector_iterator(*args) + def iterator(self): return vimagemodule.IntVector_iterator(self) def __iter__(self): return self.iterator() - def __nonzero__(*args): return vimagemodule.IntVector___nonzero__(*args) - def __len__(*args): return vimagemodule.IntVector___len__(*args) - def pop(*args): return vimagemodule.IntVector_pop(*args) - def __getslice__(*args): return vimagemodule.IntVector___getslice__(*args) - def __setslice__(*args): return vimagemodule.IntVector___setslice__(*args) - def __delslice__(*args): return vimagemodule.IntVector___delslice__(*args) - def __delitem__(*args): return vimagemodule.IntVector___delitem__(*args) - def __getitem__(*args): return vimagemodule.IntVector___getitem__(*args) - def __setitem__(*args): return vimagemodule.IntVector___setitem__(*args) - def append(*args): return vimagemodule.IntVector_append(*args) - def empty(*args): return vimagemodule.IntVector_empty(*args) - def size(*args): return vimagemodule.IntVector_size(*args) - def clear(*args): return vimagemodule.IntVector_clear(*args) - def swap(*args): return vimagemodule.IntVector_swap(*args) - def get_allocator(*args): return vimagemodule.IntVector_get_allocator(*args) - def begin(*args): return vimagemodule.IntVector_begin(*args) - def end(*args): return vimagemodule.IntVector_end(*args) - def rbegin(*args): return vimagemodule.IntVector_rbegin(*args) - def rend(*args): return vimagemodule.IntVector_rend(*args) - def pop_back(*args): return vimagemodule.IntVector_pop_back(*args) - def erase(*args): return vimagemodule.IntVector_erase(*args) + def __nonzero__(self): return vimagemodule.IntVector___nonzero__(self) + def __bool__(self): return vimagemodule.IntVector___bool__(self) + def __len__(self): return vimagemodule.IntVector___len__(self) + def pop(self): return vimagemodule.IntVector_pop(self) + def __getslice__(self, *args): return vimagemodule.IntVector___getslice__(self, *args) + def __setslice__(self, *args): return vimagemodule.IntVector___setslice__(self, *args) + def __delslice__(self, *args): return vimagemodule.IntVector___delslice__(self, *args) + def __delitem__(self, *args): return vimagemodule.IntVector___delitem__(self, *args) + def __getitem__(self, *args): return vimagemodule.IntVector___getitem__(self, *args) + def __setitem__(self, *args): return vimagemodule.IntVector___setitem__(self, *args) + def append(self, *args): return vimagemodule.IntVector_append(self, *args) + def empty(self): return vimagemodule.IntVector_empty(self) + def size(self): return vimagemodule.IntVector_size(self) + def clear(self): return vimagemodule.IntVector_clear(self) + def swap(self, *args): return vimagemodule.IntVector_swap(self, *args) + def get_allocator(self): return vimagemodule.IntVector_get_allocator(self) + def begin(self): return vimagemodule.IntVector_begin(self) + def end(self): return vimagemodule.IntVector_end(self) + def rbegin(self): return vimagemodule.IntVector_rbegin(self) + def rend(self): return vimagemodule.IntVector_rend(self) + def pop_back(self): return vimagemodule.IntVector_pop_back(self) + def erase(self, *args): return vimagemodule.IntVector_erase(self, *args) def __init__(self, *args): this = vimagemodule.new_IntVector(*args) try: self.this.append(this) except: self.this = this - def push_back(*args): return vimagemodule.IntVector_push_back(*args) - def front(*args): return vimagemodule.IntVector_front(*args) - def back(*args): return vimagemodule.IntVector_back(*args) - def assign(*args): return vimagemodule.IntVector_assign(*args) - def resize(*args): return vimagemodule.IntVector_resize(*args) - def insert(*args): return vimagemodule.IntVector_insert(*args) - def reserve(*args): return vimagemodule.IntVector_reserve(*args) - def capacity(*args): return vimagemodule.IntVector_capacity(*args) + def push_back(self, *args): return vimagemodule.IntVector_push_back(self, *args) + def front(self): return vimagemodule.IntVector_front(self) + def back(self): return vimagemodule.IntVector_back(self) + def assign(self, *args): return vimagemodule.IntVector_assign(self, *args) + def resize(self, *args): return vimagemodule.IntVector_resize(self, *args) + def insert(self, *args): return vimagemodule.IntVector_insert(self, *args) + def reserve(self, *args): return vimagemodule.IntVector_reserve(self, *args) + def capacity(self): return vimagemodule.IntVector_capacity(self) __swig_destroy__ = vimagemodule.delete_IntVector __del__ = lambda self : None; IntVector_swigregister = vimagemodule.IntVector_swigregister @@ -131,41 +151,42 @@ class DoubleVector(_object): __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, DoubleVector, name) __repr__ = _swig_repr - def iterator(*args): return vimagemodule.DoubleVector_iterator(*args) + def iterator(self): return vimagemodule.DoubleVector_iterator(self) def __iter__(self): return self.iterator() - def __nonzero__(*args): return vimagemodule.DoubleVector___nonzero__(*args) - def __len__(*args): return vimagemodule.DoubleVector___len__(*args) - def pop(*args): return vimagemodule.DoubleVector_pop(*args) - def __getslice__(*args): return vimagemodule.DoubleVector___getslice__(*args) - def __setslice__(*args): return vimagemodule.DoubleVector___setslice__(*args) - def __delslice__(*args): return vimagemodule.DoubleVector___delslice__(*args) - def __delitem__(*args): return vimagemodule.DoubleVector___delitem__(*args) - def __getitem__(*args): return vimagemodule.DoubleVector___getitem__(*args) - def __setitem__(*args): return vimagemodule.DoubleVector___setitem__(*args) - def append(*args): return vimagemodule.DoubleVector_append(*args) - def empty(*args): return vimagemodule.DoubleVector_empty(*args) - def size(*args): return vimagemodule.DoubleVector_size(*args) - def clear(*args): return vimagemodule.DoubleVector_clear(*args) - def swap(*args): return vimagemodule.DoubleVector_swap(*args) - def get_allocator(*args): return vimagemodule.DoubleVector_get_allocator(*args) - def begin(*args): return vimagemodule.DoubleVector_begin(*args) - def end(*args): return vimagemodule.DoubleVector_end(*args) - def rbegin(*args): return vimagemodule.DoubleVector_rbegin(*args) - def rend(*args): return vimagemodule.DoubleVector_rend(*args) - def pop_back(*args): return vimagemodule.DoubleVector_pop_back(*args) - def erase(*args): return vimagemodule.DoubleVector_erase(*args) + def __nonzero__(self): return vimagemodule.DoubleVector___nonzero__(self) + def __bool__(self): return vimagemodule.DoubleVector___bool__(self) + def __len__(self): return vimagemodule.DoubleVector___len__(self) + def pop(self): return vimagemodule.DoubleVector_pop(self) + def __getslice__(self, *args): return vimagemodule.DoubleVector___getslice__(self, *args) + def __setslice__(self, *args): return vimagemodule.DoubleVector___setslice__(self, *args) + def __delslice__(self, *args): return vimagemodule.DoubleVector___delslice__(self, *args) + def __delitem__(self, *args): return vimagemodule.DoubleVector___delitem__(self, *args) + def __getitem__(self, *args): return vimagemodule.DoubleVector___getitem__(self, *args) + def __setitem__(self, *args): return vimagemodule.DoubleVector___setitem__(self, *args) + def append(self, *args): return vimagemodule.DoubleVector_append(self, *args) + def empty(self): return vimagemodule.DoubleVector_empty(self) + def size(self): return vimagemodule.DoubleVector_size(self) + def clear(self): return vimagemodule.DoubleVector_clear(self) + def swap(self, *args): return vimagemodule.DoubleVector_swap(self, *args) + def get_allocator(self): return vimagemodule.DoubleVector_get_allocator(self) + def begin(self): return vimagemodule.DoubleVector_begin(self) + def end(self): return vimagemodule.DoubleVector_end(self) + def rbegin(self): return vimagemodule.DoubleVector_rbegin(self) + def rend(self): return vimagemodule.DoubleVector_rend(self) + def pop_back(self): return vimagemodule.DoubleVector_pop_back(self) + def erase(self, *args): return vimagemodule.DoubleVector_erase(self, *args) def __init__(self, *args): this = vimagemodule.new_DoubleVector(*args) try: self.this.append(this) except: self.this = this - def push_back(*args): return vimagemodule.DoubleVector_push_back(*args) - def front(*args): return vimagemodule.DoubleVector_front(*args) - def back(*args): return vimagemodule.DoubleVector_back(*args) - def assign(*args): return vimagemodule.DoubleVector_assign(*args) - def resize(*args): return vimagemodule.DoubleVector_resize(*args) - def insert(*args): return vimagemodule.DoubleVector_insert(*args) - def reserve(*args): return vimagemodule.DoubleVector_reserve(*args) - def capacity(*args): return vimagemodule.DoubleVector_capacity(*args) + def push_back(self, *args): return vimagemodule.DoubleVector_push_back(self, *args) + def front(self): return vimagemodule.DoubleVector_front(self) + def back(self): return vimagemodule.DoubleVector_back(self) + def assign(self, *args): return vimagemodule.DoubleVector_assign(self, *args) + def resize(self, *args): return vimagemodule.DoubleVector_resize(self, *args) + def insert(self, *args): return vimagemodule.DoubleVector_insert(self, *args) + def reserve(self, *args): return vimagemodule.DoubleVector_reserve(self, *args) + def capacity(self): return vimagemodule.DoubleVector_capacity(self) __swig_destroy__ = vimagemodule.delete_DoubleVector __del__ = lambda self : None; DoubleVector_swigregister = vimagemodule.DoubleVector_swigregister @@ -177,41 +198,42 @@ class ImageVector(_object): __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, ImageVector, name) __repr__ = _swig_repr - def iterator(*args): return vimagemodule.ImageVector_iterator(*args) + def iterator(self): return vimagemodule.ImageVector_iterator(self) def __iter__(self): return self.iterator() - def __nonzero__(*args): return vimagemodule.ImageVector___nonzero__(*args) - def __len__(*args): return vimagemodule.ImageVector___len__(*args) - def pop(*args): return vimagemodule.ImageVector_pop(*args) - def __getslice__(*args): return vimagemodule.ImageVector___getslice__(*args) - def __setslice__(*args): return vimagemodule.ImageVector___setslice__(*args) - def __delslice__(*args): return vimagemodule.ImageVector___delslice__(*args) - def __delitem__(*args): return vimagemodule.ImageVector___delitem__(*args) - def __getitem__(*args): return vimagemodule.ImageVector___getitem__(*args) - def __setitem__(*args): return vimagemodule.ImageVector___setitem__(*args) - def append(*args): return vimagemodule.ImageVector_append(*args) - def empty(*args): return vimagemodule.ImageVector_empty(*args) - def size(*args): return vimagemodule.ImageVector_size(*args) - def clear(*args): return vimagemodule.ImageVector_clear(*args) - def swap(*args): return vimagemodule.ImageVector_swap(*args) - def get_allocator(*args): return vimagemodule.ImageVector_get_allocator(*args) - def begin(*args): return vimagemodule.ImageVector_begin(*args) - def end(*args): return vimagemodule.ImageVector_end(*args) - def rbegin(*args): return vimagemodule.ImageVector_rbegin(*args) - def rend(*args): return vimagemodule.ImageVector_rend(*args) - def pop_back(*args): return vimagemodule.ImageVector_pop_back(*args) - def erase(*args): return vimagemodule.ImageVector_erase(*args) + def __nonzero__(self): return vimagemodule.ImageVector___nonzero__(self) + def __bool__(self): return vimagemodule.ImageVector___bool__(self) + def __len__(self): return vimagemodule.ImageVector___len__(self) + def pop(self): return vimagemodule.ImageVector_pop(self) + def __getslice__(self, *args): return vimagemodule.ImageVector___getslice__(self, *args) + def __setslice__(self, *args): return vimagemodule.ImageVector___setslice__(self, *args) + def __delslice__(self, *args): return vimagemodule.ImageVector___delslice__(self, *args) + def __delitem__(self, *args): return vimagemodule.ImageVector___delitem__(self, *args) + def __getitem__(self, *args): return vimagemodule.ImageVector___getitem__(self, *args) + def __setitem__(self, *args): return vimagemodule.ImageVector___setitem__(self, *args) + def append(self, *args): return vimagemodule.ImageVector_append(self, *args) + def empty(self): return vimagemodule.ImageVector_empty(self) + def size(self): return vimagemodule.ImageVector_size(self) + def clear(self): return vimagemodule.ImageVector_clear(self) + def swap(self, *args): return vimagemodule.ImageVector_swap(self, *args) + def get_allocator(self): return vimagemodule.ImageVector_get_allocator(self) + def begin(self): return vimagemodule.ImageVector_begin(self) + def end(self): return vimagemodule.ImageVector_end(self) + def rbegin(self): return vimagemodule.ImageVector_rbegin(self) + def rend(self): return vimagemodule.ImageVector_rend(self) + def pop_back(self): return vimagemodule.ImageVector_pop_back(self) + def erase(self, *args): return vimagemodule.ImageVector_erase(self, *args) def __init__(self, *args): this = vimagemodule.new_ImageVector(*args) try: self.this.append(this) except: self.this = this - def push_back(*args): return vimagemodule.ImageVector_push_back(*args) - def front(*args): return vimagemodule.ImageVector_front(*args) - def back(*args): return vimagemodule.ImageVector_back(*args) - def assign(*args): return vimagemodule.ImageVector_assign(*args) - def resize(*args): return vimagemodule.ImageVector_resize(*args) - def insert(*args): return vimagemodule.ImageVector_insert(*args) - def reserve(*args): return vimagemodule.ImageVector_reserve(*args) - def capacity(*args): return vimagemodule.ImageVector_capacity(*args) + def push_back(self, *args): return vimagemodule.ImageVector_push_back(self, *args) + def front(self): return vimagemodule.ImageVector_front(self) + def back(self): return vimagemodule.ImageVector_back(self) + def assign(self, *args): return vimagemodule.ImageVector_assign(self, *args) + def resize(self, *args): return vimagemodule.ImageVector_resize(self, *args) + def insert(self, *args): return vimagemodule.ImageVector_insert(self, *args) + def reserve(self, *args): return vimagemodule.ImageVector_reserve(self, *args) + def capacity(self): return vimagemodule.ImageVector_capacity(self) __swig_destroy__ = vimagemodule.delete_ImageVector __del__ = lambda self : None; ImageVector_swigregister = vimagemodule.ImageVector_swigregister @@ -278,228 +300,228 @@ class VImage(_object): this = vimagemodule.new_VImage(*args) try: self.this.append(this) except: self.this = this - def __assign__(*args): return vimagemodule.VImage___assign__(*args) + def __assign__(self, *args): return vimagemodule.VImage___assign__(self, *args) __swig_destroy__ = vimagemodule.delete_VImage __del__ = lambda self : None; - def image(*args): return vimagemodule.VImage_image(*args) - def data(*args): return vimagemodule.VImage_data(*args) - def write(*args): return vimagemodule.VImage_write(*args) - def debug_print(*args): return vimagemodule.VImage_debug_print(*args) - def Xsize(*args): return vimagemodule.VImage_Xsize(*args) - def Ysize(*args): return vimagemodule.VImage_Ysize(*args) - def Bands(*args): return vimagemodule.VImage_Bands(*args) - def BandFmt(*args): return vimagemodule.VImage_BandFmt(*args) - def Coding(*args): return vimagemodule.VImage_Coding(*args) - def Type(*args): return vimagemodule.VImage_Type(*args) - def Xres(*args): return vimagemodule.VImage_Xres(*args) - def Yres(*args): return vimagemodule.VImage_Yres(*args) - def Length(*args): return vimagemodule.VImage_Length(*args) - def Compression(*args): return vimagemodule.VImage_Compression(*args) - def Level(*args): return vimagemodule.VImage_Level(*args) - def Xoffset(*args): return vimagemodule.VImage_Xoffset(*args) - def Yoffset(*args): return vimagemodule.VImage_Yoffset(*args) - def filename(*args): return vimagemodule.VImage_filename(*args) - def Hist(*args): return vimagemodule.VImage_Hist(*args) - def meta_remove(*args): return vimagemodule.VImage_meta_remove(*args) - def meta_get_typeof(*args): return vimagemodule.VImage_meta_get_typeof(*args) - def meta_get_int(*args): return vimagemodule.VImage_meta_get_int(*args) - def meta_get_double(*args): return vimagemodule.VImage_meta_get_double(*args) - def meta_get_string(*args): return vimagemodule.VImage_meta_get_string(*args) - def meta_get_area(*args): return vimagemodule.VImage_meta_get_area(*args) - def meta_get_blob(*args): return vimagemodule.VImage_meta_get_blob(*args) - def meta_set(*args): return vimagemodule.VImage_meta_set(*args) - def initdesc(*args): return vimagemodule.VImage_initdesc(*args) - def abs(*args): return vimagemodule.VImage_abs(*args) - def acos(*args): return vimagemodule.VImage_acos(*args) - def add(*args): return vimagemodule.VImage_add(*args) - def asin(*args): return vimagemodule.VImage_asin(*args) - def atan(*args): return vimagemodule.VImage_atan(*args) - def avg(*args): return vimagemodule.VImage_avg(*args) - def point_bilinear(*args): return vimagemodule.VImage_point_bilinear(*args) - def bandmean(*args): return vimagemodule.VImage_bandmean(*args) - def ceil(*args): return vimagemodule.VImage_ceil(*args) - def cmulnorm(*args): return vimagemodule.VImage_cmulnorm(*args) - def cos(*args): return vimagemodule.VImage_cos(*args) - def cross_phase(*args): return vimagemodule.VImage_cross_phase(*args) - def deviate(*args): return vimagemodule.VImage_deviate(*args) - def divide(*args): return vimagemodule.VImage_divide(*args) - def exp10(*args): return vimagemodule.VImage_exp10(*args) - def expn(*args): return vimagemodule.VImage_expn(*args) - def exp(*args): return vimagemodule.VImage_exp(*args) - def fav4(*args): return vimagemodule.VImage_fav4(*args) - def floor(*args): return vimagemodule.VImage_floor(*args) - def gadd(*args): return vimagemodule.VImage_gadd(*args) - def invert(*args): return vimagemodule.VImage_invert(*args) + def image(self): return vimagemodule.VImage_image(self) + def data(self): return vimagemodule.VImage_data(self) + def write(self, *args): return vimagemodule.VImage_write(self, *args) + def debug_print(self): return vimagemodule.VImage_debug_print(self) + def Xsize(self): return vimagemodule.VImage_Xsize(self) + def Ysize(self): return vimagemodule.VImage_Ysize(self) + def Bands(self): return vimagemodule.VImage_Bands(self) + def BandFmt(self): return vimagemodule.VImage_BandFmt(self) + def Coding(self): return vimagemodule.VImage_Coding(self) + def Type(self): return vimagemodule.VImage_Type(self) + def Xres(self): return vimagemodule.VImage_Xres(self) + def Yres(self): return vimagemodule.VImage_Yres(self) + def Length(self): return vimagemodule.VImage_Length(self) + def Compression(self): return vimagemodule.VImage_Compression(self) + def Level(self): return vimagemodule.VImage_Level(self) + def Xoffset(self): return vimagemodule.VImage_Xoffset(self) + def Yoffset(self): return vimagemodule.VImage_Yoffset(self) + def filename(self): return vimagemodule.VImage_filename(self) + def Hist(self): return vimagemodule.VImage_Hist(self) + def meta_remove(self, *args): return vimagemodule.VImage_meta_remove(self, *args) + def meta_get_typeof(self, *args): return vimagemodule.VImage_meta_get_typeof(self, *args) + def meta_get_int(self, *args): return vimagemodule.VImage_meta_get_int(self, *args) + def meta_get_double(self, *args): return vimagemodule.VImage_meta_get_double(self, *args) + def meta_get_string(self, *args): return vimagemodule.VImage_meta_get_string(self, *args) + def meta_get_area(self, *args): return vimagemodule.VImage_meta_get_area(self, *args) + def meta_get_blob(self, *args): return vimagemodule.VImage_meta_get_blob(self, *args) + def meta_set(self, *args): return vimagemodule.VImage_meta_set(self, *args) + def initdesc(self, *args): return vimagemodule.VImage_initdesc(self, *args) + def abs(self): return vimagemodule.VImage_abs(self) + def acos(self): return vimagemodule.VImage_acos(self) + def add(self, *args): return vimagemodule.VImage_add(self, *args) + def asin(self): return vimagemodule.VImage_asin(self) + def atan(self): return vimagemodule.VImage_atan(self) + def avg(self): return vimagemodule.VImage_avg(self) + def point_bilinear(self, *args): return vimagemodule.VImage_point_bilinear(self, *args) + def bandmean(self): return vimagemodule.VImage_bandmean(self) + def ceil(self): return vimagemodule.VImage_ceil(self) + def cmulnorm(self, *args): return vimagemodule.VImage_cmulnorm(self, *args) + def cos(self): return vimagemodule.VImage_cos(self) + def cross_phase(self, *args): return vimagemodule.VImage_cross_phase(self, *args) + def deviate(self): return vimagemodule.VImage_deviate(self) + def divide(self, *args): return vimagemodule.VImage_divide(self, *args) + def exp10(self): return vimagemodule.VImage_exp10(self) + def expn(self, *args): return vimagemodule.VImage_expn(self, *args) + def exp(self): return vimagemodule.VImage_exp(self) + def fav4(self, *args): return vimagemodule.VImage_fav4(self, *args) + def floor(self): return vimagemodule.VImage_floor(self) + def gadd(self, *args): return vimagemodule.VImage_gadd(self, *args) + def invert(self): return vimagemodule.VImage_invert(self) __swig_getmethods__["linreg"] = lambda x: vimagemodule.VImage_linreg if _newclass:linreg = staticmethod(vimagemodule.VImage_linreg) - def lin(*args): return vimagemodule.VImage_lin(*args) - def litecor(*args): return vimagemodule.VImage_litecor(*args) - def log10(*args): return vimagemodule.VImage_log10(*args) - def log(*args): return vimagemodule.VImage_log(*args) - def max(*args): return vimagemodule.VImage_max(*args) - def maxpos(*args): return vimagemodule.VImage_maxpos(*args) - def maxpos_avg(*args): return vimagemodule.VImage_maxpos_avg(*args) - def measure(*args): return vimagemodule.VImage_measure(*args) - def min(*args): return vimagemodule.VImage_min(*args) - def minpos(*args): return vimagemodule.VImage_minpos(*args) - def multiply(*args): return vimagemodule.VImage_multiply(*args) - def pow(*args): return vimagemodule.VImage_pow(*args) - def remainder(*args): return vimagemodule.VImage_remainder(*args) - def rint(*args): return vimagemodule.VImage_rint(*args) - def sign(*args): return vimagemodule.VImage_sign(*args) - def sin(*args): return vimagemodule.VImage_sin(*args) - def stats(*args): return vimagemodule.VImage_stats(*args) - def subtract(*args): return vimagemodule.VImage_subtract(*args) - def tan(*args): return vimagemodule.VImage_tan(*args) - def andimage(*args): return vimagemodule.VImage_andimage(*args) - def orimage(*args): return vimagemodule.VImage_orimage(*args) - def eorimage(*args): return vimagemodule.VImage_eorimage(*args) - def shiftleft(*args): return vimagemodule.VImage_shiftleft(*args) - def shiftright(*args): return vimagemodule.VImage_shiftright(*args) - def greyc(*args): return vimagemodule.VImage_greyc(*args) - def greyc_mask(*args): return vimagemodule.VImage_greyc_mask(*args) - def LCh2Lab(*args): return vimagemodule.VImage_LCh2Lab(*args) - def LCh2UCS(*args): return vimagemodule.VImage_LCh2UCS(*args) - def Lab2LCh(*args): return vimagemodule.VImage_Lab2LCh(*args) - def Lab2LabQ(*args): return vimagemodule.VImage_Lab2LabQ(*args) - def Lab2LabS(*args): return vimagemodule.VImage_Lab2LabS(*args) - def Lab2UCS(*args): return vimagemodule.VImage_Lab2UCS(*args) - def Lab2XYZ(*args): return vimagemodule.VImage_Lab2XYZ(*args) - def Lab2XYZ_temp(*args): return vimagemodule.VImage_Lab2XYZ_temp(*args) - def Lab2disp(*args): return vimagemodule.VImage_Lab2disp(*args) - def LabQ2LabS(*args): return vimagemodule.VImage_LabQ2LabS(*args) - def LabQ2Lab(*args): return vimagemodule.VImage_LabQ2Lab(*args) - def LabQ2XYZ(*args): return vimagemodule.VImage_LabQ2XYZ(*args) - def LabQ2disp(*args): return vimagemodule.VImage_LabQ2disp(*args) - def LabS2LabQ(*args): return vimagemodule.VImage_LabS2LabQ(*args) - def LabS2Lab(*args): return vimagemodule.VImage_LabS2Lab(*args) - def UCS2LCh(*args): return vimagemodule.VImage_UCS2LCh(*args) - def UCS2Lab(*args): return vimagemodule.VImage_UCS2Lab(*args) - def UCS2XYZ(*args): return vimagemodule.VImage_UCS2XYZ(*args) - def XYZ2Lab(*args): return vimagemodule.VImage_XYZ2Lab(*args) - def XYZ2Lab_temp(*args): return vimagemodule.VImage_XYZ2Lab_temp(*args) - def XYZ2UCS(*args): return vimagemodule.VImage_XYZ2UCS(*args) - def XYZ2Yxy(*args): return vimagemodule.VImage_XYZ2Yxy(*args) - def XYZ2disp(*args): return vimagemodule.VImage_XYZ2disp(*args) - def XYZ2sRGB(*args): return vimagemodule.VImage_XYZ2sRGB(*args) - def Yxy2XYZ(*args): return vimagemodule.VImage_Yxy2XYZ(*args) - def dE00_fromLab(*args): return vimagemodule.VImage_dE00_fromLab(*args) - def dECMC_fromLab(*args): return vimagemodule.VImage_dECMC_fromLab(*args) - def dECMC_fromdisp(*args): return vimagemodule.VImage_dECMC_fromdisp(*args) - def dE_fromLab(*args): return vimagemodule.VImage_dE_fromLab(*args) - def dE_fromXYZ(*args): return vimagemodule.VImage_dE_fromXYZ(*args) - def dE_fromdisp(*args): return vimagemodule.VImage_dE_fromdisp(*args) - def disp2Lab(*args): return vimagemodule.VImage_disp2Lab(*args) - def disp2XYZ(*args): return vimagemodule.VImage_disp2XYZ(*args) - def float2rad(*args): return vimagemodule.VImage_float2rad(*args) - def icc_ac2rc(*args): return vimagemodule.VImage_icc_ac2rc(*args) - def icc_export(*args): return vimagemodule.VImage_icc_export(*args) - def icc_export_depth(*args): return vimagemodule.VImage_icc_export_depth(*args) - def icc_import(*args): return vimagemodule.VImage_icc_import(*args) - def icc_import_embedded(*args): return vimagemodule.VImage_icc_import_embedded(*args) - def icc_transform(*args): return vimagemodule.VImage_icc_transform(*args) - def lab_morph(*args): return vimagemodule.VImage_lab_morph(*args) - def rad2float(*args): return vimagemodule.VImage_rad2float(*args) - def sRGB2XYZ(*args): return vimagemodule.VImage_sRGB2XYZ(*args) - def bandjoin(*args): return vimagemodule.VImage_bandjoin(*args) + def lin(self, *args): return vimagemodule.VImage_lin(self, *args) + def litecor(self, *args): return vimagemodule.VImage_litecor(self, *args) + def log10(self): return vimagemodule.VImage_log10(self) + def log(self): return vimagemodule.VImage_log(self) + def max(self): return vimagemodule.VImage_max(self) + def maxpos(self): return vimagemodule.VImage_maxpos(self) + def maxpos_avg(self, *args): return vimagemodule.VImage_maxpos_avg(self, *args) + def measure(self, *args): return vimagemodule.VImage_measure(self, *args) + def min(self): return vimagemodule.VImage_min(self) + def minpos(self): return vimagemodule.VImage_minpos(self) + def multiply(self, *args): return vimagemodule.VImage_multiply(self, *args) + def pow(self, *args): return vimagemodule.VImage_pow(self, *args) + def remainder(self, *args): return vimagemodule.VImage_remainder(self, *args) + def rint(self): return vimagemodule.VImage_rint(self) + def sign(self): return vimagemodule.VImage_sign(self) + def sin(self): return vimagemodule.VImage_sin(self) + def stats(self): return vimagemodule.VImage_stats(self) + def subtract(self, *args): return vimagemodule.VImage_subtract(self, *args) + def tan(self): return vimagemodule.VImage_tan(self) + def andimage(self, *args): return vimagemodule.VImage_andimage(self, *args) + def orimage(self, *args): return vimagemodule.VImage_orimage(self, *args) + def eorimage(self, *args): return vimagemodule.VImage_eorimage(self, *args) + def shiftleft(self, *args): return vimagemodule.VImage_shiftleft(self, *args) + def shiftright(self, *args): return vimagemodule.VImage_shiftright(self, *args) + def greyc(self, *args): return vimagemodule.VImage_greyc(self, *args) + def greyc_mask(self, *args): return vimagemodule.VImage_greyc_mask(self, *args) + def LCh2Lab(self): return vimagemodule.VImage_LCh2Lab(self) + def LCh2UCS(self): return vimagemodule.VImage_LCh2UCS(self) + def Lab2LCh(self): return vimagemodule.VImage_Lab2LCh(self) + def Lab2LabQ(self): return vimagemodule.VImage_Lab2LabQ(self) + def Lab2LabS(self): return vimagemodule.VImage_Lab2LabS(self) + def Lab2UCS(self): return vimagemodule.VImage_Lab2UCS(self) + def Lab2XYZ(self): return vimagemodule.VImage_Lab2XYZ(self) + def Lab2XYZ_temp(self, *args): return vimagemodule.VImage_Lab2XYZ_temp(self, *args) + def Lab2disp(self, *args): return vimagemodule.VImage_Lab2disp(self, *args) + def LabQ2LabS(self): return vimagemodule.VImage_LabQ2LabS(self) + def LabQ2Lab(self): return vimagemodule.VImage_LabQ2Lab(self) + def LabQ2XYZ(self): return vimagemodule.VImage_LabQ2XYZ(self) + def LabQ2disp(self, *args): return vimagemodule.VImage_LabQ2disp(self, *args) + def LabS2LabQ(self): return vimagemodule.VImage_LabS2LabQ(self) + def LabS2Lab(self): return vimagemodule.VImage_LabS2Lab(self) + def UCS2LCh(self): return vimagemodule.VImage_UCS2LCh(self) + def UCS2Lab(self): return vimagemodule.VImage_UCS2Lab(self) + def UCS2XYZ(self): return vimagemodule.VImage_UCS2XYZ(self) + def XYZ2Lab(self): return vimagemodule.VImage_XYZ2Lab(self) + def XYZ2Lab_temp(self, *args): return vimagemodule.VImage_XYZ2Lab_temp(self, *args) + def XYZ2UCS(self): return vimagemodule.VImage_XYZ2UCS(self) + def XYZ2Yxy(self): return vimagemodule.VImage_XYZ2Yxy(self) + def XYZ2disp(self, *args): return vimagemodule.VImage_XYZ2disp(self, *args) + def XYZ2sRGB(self): return vimagemodule.VImage_XYZ2sRGB(self) + def Yxy2XYZ(self): return vimagemodule.VImage_Yxy2XYZ(self) + def dE00_fromLab(self, *args): return vimagemodule.VImage_dE00_fromLab(self, *args) + def dECMC_fromLab(self, *args): return vimagemodule.VImage_dECMC_fromLab(self, *args) + def dECMC_fromdisp(self, *args): return vimagemodule.VImage_dECMC_fromdisp(self, *args) + def dE_fromLab(self, *args): return vimagemodule.VImage_dE_fromLab(self, *args) + def dE_fromXYZ(self, *args): return vimagemodule.VImage_dE_fromXYZ(self, *args) + def dE_fromdisp(self, *args): return vimagemodule.VImage_dE_fromdisp(self, *args) + def disp2Lab(self, *args): return vimagemodule.VImage_disp2Lab(self, *args) + def disp2XYZ(self, *args): return vimagemodule.VImage_disp2XYZ(self, *args) + def float2rad(self): return vimagemodule.VImage_float2rad(self) + def icc_ac2rc(self, *args): return vimagemodule.VImage_icc_ac2rc(self, *args) + def icc_export(self, *args): return vimagemodule.VImage_icc_export(self, *args) + def icc_export_depth(self, *args): return vimagemodule.VImage_icc_export_depth(self, *args) + def icc_import(self, *args): return vimagemodule.VImage_icc_import(self, *args) + def icc_import_embedded(self, *args): return vimagemodule.VImage_icc_import_embedded(self, *args) + def icc_transform(self, *args): return vimagemodule.VImage_icc_transform(self, *args) + def lab_morph(self, *args): return vimagemodule.VImage_lab_morph(self, *args) + def rad2float(self): return vimagemodule.VImage_rad2float(self) + def sRGB2XYZ(self): return vimagemodule.VImage_sRGB2XYZ(self) + def bandjoin(self, *args): return vimagemodule.VImage_bandjoin(self, *args) __swig_getmethods__["black"] = lambda x: vimagemodule.VImage_black if _newclass:black = staticmethod(vimagemodule.VImage_black) - def c2amph(*args): return vimagemodule.VImage_c2amph(*args) - def c2imag(*args): return vimagemodule.VImage_c2imag(*args) - def c2ps(*args): return vimagemodule.VImage_c2ps(*args) - def c2real(*args): return vimagemodule.VImage_c2real(*args) - def c2rect(*args): return vimagemodule.VImage_c2rect(*args) - def clip2c(*args): return vimagemodule.VImage_clip2c(*args) - def clip2cm(*args): return vimagemodule.VImage_clip2cm(*args) - def clip2d(*args): return vimagemodule.VImage_clip2d(*args) - def clip2dcm(*args): return vimagemodule.VImage_clip2dcm(*args) - def clip2f(*args): return vimagemodule.VImage_clip2f(*args) - def clip2fmt(*args): return vimagemodule.VImage_clip2fmt(*args) - def clip2i(*args): return vimagemodule.VImage_clip2i(*args) - def clip2s(*args): return vimagemodule.VImage_clip2s(*args) - def clip2ui(*args): return vimagemodule.VImage_clip2ui(*args) - def clip2us(*args): return vimagemodule.VImage_clip2us(*args) - def clip(*args): return vimagemodule.VImage_clip(*args) - def copy(*args): return vimagemodule.VImage_copy(*args) - def copy_morph(*args): return vimagemodule.VImage_copy_morph(*args) - def copy_swap(*args): return vimagemodule.VImage_copy_swap(*args) - def copy_set(*args): return vimagemodule.VImage_copy_set(*args) - def extract_area(*args): return vimagemodule.VImage_extract_area(*args) - def extract_areabands(*args): return vimagemodule.VImage_extract_areabands(*args) - def extract_band(*args): return vimagemodule.VImage_extract_band(*args) - def extract_bands(*args): return vimagemodule.VImage_extract_bands(*args) - def extract(*args): return vimagemodule.VImage_extract(*args) - def falsecolour(*args): return vimagemodule.VImage_falsecolour(*args) - def fliphor(*args): return vimagemodule.VImage_fliphor(*args) - def flipver(*args): return vimagemodule.VImage_flipver(*args) + def c2amph(self): return vimagemodule.VImage_c2amph(self) + def c2imag(self): return vimagemodule.VImage_c2imag(self) + def c2ps(self): return vimagemodule.VImage_c2ps(self) + def c2real(self): return vimagemodule.VImage_c2real(self) + def c2rect(self): return vimagemodule.VImage_c2rect(self) + def clip2c(self): return vimagemodule.VImage_clip2c(self) + def clip2cm(self): return vimagemodule.VImage_clip2cm(self) + def clip2d(self): return vimagemodule.VImage_clip2d(self) + def clip2dcm(self): return vimagemodule.VImage_clip2dcm(self) + def clip2f(self): return vimagemodule.VImage_clip2f(self) + def clip2fmt(self, *args): return vimagemodule.VImage_clip2fmt(self, *args) + def clip2i(self): return vimagemodule.VImage_clip2i(self) + def clip2s(self): return vimagemodule.VImage_clip2s(self) + def clip2ui(self): return vimagemodule.VImage_clip2ui(self) + def clip2us(self): return vimagemodule.VImage_clip2us(self) + def clip(self): return vimagemodule.VImage_clip(self) + def copy(self): return vimagemodule.VImage_copy(self) + def copy_morph(self, *args): return vimagemodule.VImage_copy_morph(self, *args) + def copy_swap(self): return vimagemodule.VImage_copy_swap(self) + def copy_set(self, *args): return vimagemodule.VImage_copy_set(self, *args) + def extract_area(self, *args): return vimagemodule.VImage_extract_area(self, *args) + def extract_areabands(self, *args): return vimagemodule.VImage_extract_areabands(self, *args) + def extract_band(self, *args): return vimagemodule.VImage_extract_band(self, *args) + def extract_bands(self, *args): return vimagemodule.VImage_extract_bands(self, *args) + def extract(self, *args): return vimagemodule.VImage_extract(self, *args) + def falsecolour(self): return vimagemodule.VImage_falsecolour(self) + def fliphor(self): return vimagemodule.VImage_fliphor(self) + def flipver(self): return vimagemodule.VImage_flipver(self) __swig_getmethods__["gbandjoin"] = lambda x: vimagemodule.VImage_gbandjoin if _newclass:gbandjoin = staticmethod(vimagemodule.VImage_gbandjoin) - def grid(*args): return vimagemodule.VImage_grid(*args) - def insert(*args): return vimagemodule.VImage_insert(*args) - def insert_noexpand(*args): return vimagemodule.VImage_insert_noexpand(*args) - def lrjoin(*args): return vimagemodule.VImage_lrjoin(*args) + def grid(self, *args): return vimagemodule.VImage_grid(self, *args) + def insert(self, *args): return vimagemodule.VImage_insert(self, *args) + def insert_noexpand(self, *args): return vimagemodule.VImage_insert_noexpand(self, *args) + def lrjoin(self, *args): return vimagemodule.VImage_lrjoin(self, *args) __swig_getmethods__["mask2vips"] = lambda x: vimagemodule.VImage_mask2vips if _newclass:mask2vips = staticmethod(vimagemodule.VImage_mask2vips) - def msb(*args): return vimagemodule.VImage_msb(*args) - def msb_band(*args): return vimagemodule.VImage_msb_band(*args) - def recomb(*args): return vimagemodule.VImage_recomb(*args) - def replicate(*args): return vimagemodule.VImage_replicate(*args) - def ri2c(*args): return vimagemodule.VImage_ri2c(*args) - def rot180(*args): return vimagemodule.VImage_rot180(*args) - def rot270(*args): return vimagemodule.VImage_rot270(*args) - def rot90(*args): return vimagemodule.VImage_rot90(*args) - def scale(*args): return vimagemodule.VImage_scale(*args) - def scaleps(*args): return vimagemodule.VImage_scaleps(*args) - def rightshift_size(*args): return vimagemodule.VImage_rightshift_size(*args) - def slice(*args): return vimagemodule.VImage_slice(*args) - def subsample(*args): return vimagemodule.VImage_subsample(*args) - def system(*args): return vimagemodule.VImage_system(*args) - def tbjoin(*args): return vimagemodule.VImage_tbjoin(*args) + def msb(self): return vimagemodule.VImage_msb(self) + def msb_band(self, *args): return vimagemodule.VImage_msb_band(self, *args) + def recomb(self, *args): return vimagemodule.VImage_recomb(self, *args) + def replicate(self, *args): return vimagemodule.VImage_replicate(self, *args) + def ri2c(self, *args): return vimagemodule.VImage_ri2c(self, *args) + def rot180(self): return vimagemodule.VImage_rot180(self) + def rot270(self): return vimagemodule.VImage_rot270(self) + def rot90(self): return vimagemodule.VImage_rot90(self) + def scale(self): return vimagemodule.VImage_scale(self) + def scaleps(self): return vimagemodule.VImage_scaleps(self) + def rightshift_size(self, *args): return vimagemodule.VImage_rightshift_size(self, *args) + def slice(self, *args): return vimagemodule.VImage_slice(self, *args) + def subsample(self, *args): return vimagemodule.VImage_subsample(self, *args) + def system(self, *args): return vimagemodule.VImage_system(self, *args) + def tbjoin(self, *args): return vimagemodule.VImage_tbjoin(self, *args) __swig_getmethods__["text"] = lambda x: vimagemodule.VImage_text if _newclass:text = staticmethod(vimagemodule.VImage_text) - def thresh(*args): return vimagemodule.VImage_thresh(*args) - def vips2mask(*args): return vimagemodule.VImage_vips2mask(*args) - def wrap(*args): return vimagemodule.VImage_wrap(*args) - def zoom(*args): return vimagemodule.VImage_zoom(*args) - def addgnoise(*args): return vimagemodule.VImage_addgnoise(*args) - def compass(*args): return vimagemodule.VImage_compass(*args) - def contrast_surface(*args): return vimagemodule.VImage_contrast_surface(*args) - def contrast_surface_raw(*args): return vimagemodule.VImage_contrast_surface_raw(*args) - def conv(*args): return vimagemodule.VImage_conv(*args) - def conv_raw(*args): return vimagemodule.VImage_conv_raw(*args) - def convf(*args): return vimagemodule.VImage_convf(*args) - def convf_raw(*args): return vimagemodule.VImage_convf_raw(*args) - def convsep(*args): return vimagemodule.VImage_convsep(*args) - def convsep_raw(*args): return vimagemodule.VImage_convsep_raw(*args) - def convsepf(*args): return vimagemodule.VImage_convsepf(*args) - def convsepf_raw(*args): return vimagemodule.VImage_convsepf_raw(*args) - def convsub(*args): return vimagemodule.VImage_convsub(*args) - def embed(*args): return vimagemodule.VImage_embed(*args) - def fastcor(*args): return vimagemodule.VImage_fastcor(*args) - def fastcor_raw(*args): return vimagemodule.VImage_fastcor_raw(*args) + def thresh(self, *args): return vimagemodule.VImage_thresh(self, *args) + def vips2mask(self): return vimagemodule.VImage_vips2mask(self) + def wrap(self, *args): return vimagemodule.VImage_wrap(self, *args) + def zoom(self, *args): return vimagemodule.VImage_zoom(self, *args) + def addgnoise(self, *args): return vimagemodule.VImage_addgnoise(self, *args) + def compass(self, *args): return vimagemodule.VImage_compass(self, *args) + def contrast_surface(self, *args): return vimagemodule.VImage_contrast_surface(self, *args) + def contrast_surface_raw(self, *args): return vimagemodule.VImage_contrast_surface_raw(self, *args) + def conv(self, *args): return vimagemodule.VImage_conv(self, *args) + def conv_raw(self, *args): return vimagemodule.VImage_conv_raw(self, *args) + def convf(self, *args): return vimagemodule.VImage_convf(self, *args) + def convf_raw(self, *args): return vimagemodule.VImage_convf_raw(self, *args) + def convsep(self, *args): return vimagemodule.VImage_convsep(self, *args) + def convsep_raw(self, *args): return vimagemodule.VImage_convsep_raw(self, *args) + def convsepf(self, *args): return vimagemodule.VImage_convsepf(self, *args) + def convsepf_raw(self, *args): return vimagemodule.VImage_convsepf_raw(self, *args) + def convsub(self, *args): return vimagemodule.VImage_convsub(self, *args) + def embed(self, *args): return vimagemodule.VImage_embed(self, *args) + def fastcor(self, *args): return vimagemodule.VImage_fastcor(self, *args) + def fastcor_raw(self, *args): return vimagemodule.VImage_fastcor_raw(self, *args) __swig_getmethods__["gaussnoise"] = lambda x: vimagemodule.VImage_gaussnoise if _newclass:gaussnoise = staticmethod(vimagemodule.VImage_gaussnoise) - def grad_x(*args): return vimagemodule.VImage_grad_x(*args) - def grad_y(*args): return vimagemodule.VImage_grad_y(*args) - def gradcor(*args): return vimagemodule.VImage_gradcor(*args) - def gradcor_raw(*args): return vimagemodule.VImage_gradcor_raw(*args) - def gradient(*args): return vimagemodule.VImage_gradient(*args) + def grad_x(self): return vimagemodule.VImage_grad_x(self) + def grad_y(self): return vimagemodule.VImage_grad_y(self) + def gradcor(self, *args): return vimagemodule.VImage_gradcor(self, *args) + def gradcor_raw(self, *args): return vimagemodule.VImage_gradcor_raw(self, *args) + def gradient(self, *args): return vimagemodule.VImage_gradient(self, *args) __swig_getmethods__["rank_image"] = lambda x: vimagemodule.VImage_rank_image if _newclass:rank_image = staticmethod(vimagemodule.VImage_rank_image) - def lindetect(*args): return vimagemodule.VImage_lindetect(*args) + def lindetect(self, *args): return vimagemodule.VImage_lindetect(self, *args) __swig_getmethods__["maxvalue"] = lambda x: vimagemodule.VImage_maxvalue if _newclass:maxvalue = staticmethod(vimagemodule.VImage_maxvalue) - def mpercent(*args): return vimagemodule.VImage_mpercent(*args) - def phasecor_fft(*args): return vimagemodule.VImage_phasecor_fft(*args) - def rank(*args): return vimagemodule.VImage_rank(*args) - def rank_raw(*args): return vimagemodule.VImage_rank_raw(*args) - def resize_linear(*args): return vimagemodule.VImage_resize_linear(*args) - def sharpen(*args): return vimagemodule.VImage_sharpen(*args) - def shrink(*args): return vimagemodule.VImage_shrink(*args) - def spcor(*args): return vimagemodule.VImage_spcor(*args) - def spcor_raw(*args): return vimagemodule.VImage_spcor_raw(*args) - def stretch3(*args): return vimagemodule.VImage_stretch3(*args) - def zerox(*args): return vimagemodule.VImage_zerox(*args) + def mpercent(self, *args): return vimagemodule.VImage_mpercent(self, *args) + def phasecor_fft(self, *args): return vimagemodule.VImage_phasecor_fft(self, *args) + def rank(self, *args): return vimagemodule.VImage_rank(self, *args) + def rank_raw(self, *args): return vimagemodule.VImage_rank_raw(self, *args) + def resize_linear(self, *args): return vimagemodule.VImage_resize_linear(self, *args) + def sharpen(self, *args): return vimagemodule.VImage_sharpen(self, *args) + def shrink(self, *args): return vimagemodule.VImage_shrink(self, *args) + def spcor(self, *args): return vimagemodule.VImage_spcor(self, *args) + def spcor_raw(self, *args): return vimagemodule.VImage_spcor_raw(self, *args) + def stretch3(self, *args): return vimagemodule.VImage_stretch3(self, *args) + def zerox(self, *args): return vimagemodule.VImage_zerox(self, *args) __swig_getmethods__["csv2vips"] = lambda x: vimagemodule.VImage_csv2vips if _newclass:csv2vips = staticmethod(vimagemodule.VImage_csv2vips) __swig_getmethods__["jpeg2vips"] = lambda x: vimagemodule.VImage_jpeg2vips @@ -516,94 +538,94 @@ class VImage(_object): if _newclass:analyze2vips = staticmethod(vimagemodule.VImage_analyze2vips) __swig_getmethods__["tiff2vips"] = lambda x: vimagemodule.VImage_tiff2vips if _newclass:tiff2vips = staticmethod(vimagemodule.VImage_tiff2vips) - def vips2csv(*args): return vimagemodule.VImage_vips2csv(*args) - def vips2jpeg(*args): return vimagemodule.VImage_vips2jpeg(*args) - def vips2mimejpeg(*args): return vimagemodule.VImage_vips2mimejpeg(*args) - def vips2png(*args): return vimagemodule.VImage_vips2png(*args) - def vips2ppm(*args): return vimagemodule.VImage_vips2ppm(*args) - def vips2tiff(*args): return vimagemodule.VImage_vips2tiff(*args) + def vips2csv(self, *args): return vimagemodule.VImage_vips2csv(self, *args) + def vips2jpeg(self, *args): return vimagemodule.VImage_vips2jpeg(self, *args) + def vips2mimejpeg(self, *args): return vimagemodule.VImage_vips2mimejpeg(self, *args) + def vips2png(self, *args): return vimagemodule.VImage_vips2png(self, *args) + def vips2ppm(self, *args): return vimagemodule.VImage_vips2ppm(self, *args) + def vips2tiff(self, *args): return vimagemodule.VImage_vips2tiff(self, *args) __swig_getmethods__["create_fmask"] = lambda x: vimagemodule.VImage_create_fmask if _newclass:create_fmask = staticmethod(vimagemodule.VImage_create_fmask) - def disp_ps(*args): return vimagemodule.VImage_disp_ps(*args) - def flt_image_freq(*args): return vimagemodule.VImage_flt_image_freq(*args) + def disp_ps(self): return vimagemodule.VImage_disp_ps(self) + def flt_image_freq(self, *args): return vimagemodule.VImage_flt_image_freq(self, *args) __swig_getmethods__["fractsurf"] = lambda x: vimagemodule.VImage_fractsurf if _newclass:fractsurf = staticmethod(vimagemodule.VImage_fractsurf) - def freqflt(*args): return vimagemodule.VImage_freqflt(*args) - def fwfft(*args): return vimagemodule.VImage_fwfft(*args) - def rotquad(*args): return vimagemodule.VImage_rotquad(*args) - def invfft(*args): return vimagemodule.VImage_invfft(*args) - def invfftr(*args): return vimagemodule.VImage_invfftr(*args) - def gammacorrect(*args): return vimagemodule.VImage_gammacorrect(*args) - def heq(*args): return vimagemodule.VImage_heq(*args) - def hist(*args): return vimagemodule.VImage_hist(*args) - def histcum(*args): return vimagemodule.VImage_histcum(*args) - def histeq(*args): return vimagemodule.VImage_histeq(*args) - def histgr(*args): return vimagemodule.VImage_histgr(*args) - def histnD(*args): return vimagemodule.VImage_histnD(*args) - def histnorm(*args): return vimagemodule.VImage_histnorm(*args) - def histplot(*args): return vimagemodule.VImage_histplot(*args) - def histspec(*args): return vimagemodule.VImage_histspec(*args) - def hsp(*args): return vimagemodule.VImage_hsp(*args) + def freqflt(self, *args): return vimagemodule.VImage_freqflt(self, *args) + def fwfft(self): return vimagemodule.VImage_fwfft(self) + def rotquad(self): return vimagemodule.VImage_rotquad(self) + def invfft(self): return vimagemodule.VImage_invfft(self) + def invfftr(self): return vimagemodule.VImage_invfftr(self) + def gammacorrect(self, *args): return vimagemodule.VImage_gammacorrect(self, *args) + def heq(self, *args): return vimagemodule.VImage_heq(self, *args) + def hist(self, *args): return vimagemodule.VImage_hist(self, *args) + def histcum(self): return vimagemodule.VImage_histcum(self) + def histeq(self): return vimagemodule.VImage_histeq(self) + def histgr(self, *args): return vimagemodule.VImage_histgr(self, *args) + def histnD(self, *args): return vimagemodule.VImage_histnD(self, *args) + def histnorm(self): return vimagemodule.VImage_histnorm(self) + def histplot(self): return vimagemodule.VImage_histplot(self) + def histspec(self, *args): return vimagemodule.VImage_histspec(self, *args) + def hsp(self, *args): return vimagemodule.VImage_hsp(self, *args) __swig_getmethods__["identity"] = lambda x: vimagemodule.VImage_identity if _newclass:identity = staticmethod(vimagemodule.VImage_identity) __swig_getmethods__["identity_ushort"] = lambda x: vimagemodule.VImage_identity_ushort if _newclass:identity_ushort = staticmethod(vimagemodule.VImage_identity_ushort) - def ismonotonic(*args): return vimagemodule.VImage_ismonotonic(*args) - def lhisteq(*args): return vimagemodule.VImage_lhisteq(*args) - def lhisteq_raw(*args): return vimagemodule.VImage_lhisteq_raw(*args) + def ismonotonic(self): return vimagemodule.VImage_ismonotonic(self) + def lhisteq(self, *args): return vimagemodule.VImage_lhisteq(self, *args) + def lhisteq_raw(self, *args): return vimagemodule.VImage_lhisteq_raw(self, *args) __swig_getmethods__["invertlut"] = lambda x: vimagemodule.VImage_invertlut if _newclass:invertlut = staticmethod(vimagemodule.VImage_invertlut) __swig_getmethods__["buildlut"] = lambda x: vimagemodule.VImage_buildlut if _newclass:buildlut = staticmethod(vimagemodule.VImage_buildlut) - def maplut(*args): return vimagemodule.VImage_maplut(*args) - def project(*args): return vimagemodule.VImage_project(*args) - def stdif(*args): return vimagemodule.VImage_stdif(*args) - def stdif_raw(*args): return vimagemodule.VImage_stdif_raw(*args) - def tone_analyse(*args): return vimagemodule.VImage_tone_analyse(*args) + def maplut(self, *args): return vimagemodule.VImage_maplut(self, *args) + def project(self, *args): return vimagemodule.VImage_project(self, *args) + def stdif(self, *args): return vimagemodule.VImage_stdif(self, *args) + def stdif_raw(self, *args): return vimagemodule.VImage_stdif_raw(self, *args) + def tone_analyse(self, *args): return vimagemodule.VImage_tone_analyse(self, *args) __swig_getmethods__["tone_build"] = lambda x: vimagemodule.VImage_tone_build if _newclass:tone_build = staticmethod(vimagemodule.VImage_tone_build) __swig_getmethods__["tone_build_range"] = lambda x: vimagemodule.VImage_tone_build_range if _newclass:tone_build_range = staticmethod(vimagemodule.VImage_tone_build_range) - def tone_map(*args): return vimagemodule.VImage_tone_map(*args) - def circle(*args): return vimagemodule.VImage_circle(*args) - def flood_blob_copy(*args): return vimagemodule.VImage_flood_blob_copy(*args) - def insertplace(*args): return vimagemodule.VImage_insertplace(*args) - def line(*args): return vimagemodule.VImage_line(*args) - def lineset(*args): return vimagemodule.VImage_lineset(*args) + def tone_map(self, *args): return vimagemodule.VImage_tone_map(self, *args) + def circle(self, *args): return vimagemodule.VImage_circle(self, *args) + def flood_blob_copy(self, *args): return vimagemodule.VImage_flood_blob_copy(self, *args) + def insertplace(self, *args): return vimagemodule.VImage_insertplace(self, *args) + def line(self, *args): return vimagemodule.VImage_line(self, *args) + def lineset(self, *args): return vimagemodule.VImage_lineset(self, *args) __swig_getmethods__["binfile"] = lambda x: vimagemodule.VImage_binfile if _newclass:binfile = staticmethod(vimagemodule.VImage_binfile) - def cache(*args): return vimagemodule.VImage_cache(*args) - def header_get_type(*args): return vimagemodule.VImage_header_get_type(*args) - def header_int(*args): return vimagemodule.VImage_header_int(*args) - def header_double(*args): return vimagemodule.VImage_header_double(*args) - def header_string(*args): return vimagemodule.VImage_header_string(*args) - def cntlines(*args): return vimagemodule.VImage_cntlines(*args) - def dilate(*args): return vimagemodule.VImage_dilate(*args) - def dilate_raw(*args): return vimagemodule.VImage_dilate_raw(*args) - def erode(*args): return vimagemodule.VImage_erode(*args) - def erode_raw(*args): return vimagemodule.VImage_erode_raw(*args) - def profile(*args): return vimagemodule.VImage_profile(*args) - def align_bands(*args): return vimagemodule.VImage_align_bands(*args) - def correl(*args): return vimagemodule.VImage_correl(*args) - def _find_lroverlap(*args): return vimagemodule.VImage__find_lroverlap(*args) - def _find_tboverlap(*args): return vimagemodule.VImage__find_tboverlap(*args) - def global_balance(*args): return vimagemodule.VImage_global_balance(*args) - def global_balancef(*args): return vimagemodule.VImage_global_balancef(*args) - def lrmerge(*args): return vimagemodule.VImage_lrmerge(*args) - def lrmerge1(*args): return vimagemodule.VImage_lrmerge1(*args) - def lrmosaic(*args): return vimagemodule.VImage_lrmosaic(*args) - def lrmosaic1(*args): return vimagemodule.VImage_lrmosaic1(*args) - def match_linear(*args): return vimagemodule.VImage_match_linear(*args) - def match_linear_search(*args): return vimagemodule.VImage_match_linear_search(*args) - def maxpos_subpel(*args): return vimagemodule.VImage_maxpos_subpel(*args) - def remosaic(*args): return vimagemodule.VImage_remosaic(*args) - def tbmerge(*args): return vimagemodule.VImage_tbmerge(*args) - def tbmerge1(*args): return vimagemodule.VImage_tbmerge1(*args) - def tbmosaic(*args): return vimagemodule.VImage_tbmosaic(*args) - def tbmosaic1(*args): return vimagemodule.VImage_tbmosaic1(*args) - def benchmark(*args): return vimagemodule.VImage_benchmark(*args) - def benchmark2(*args): return vimagemodule.VImage_benchmark2(*args) - def benchmarkn(*args): return vimagemodule.VImage_benchmarkn(*args) + def cache(self, *args): return vimagemodule.VImage_cache(self, *args) + def header_get_type(self, *args): return vimagemodule.VImage_header_get_type(self, *args) + def header_int(self, *args): return vimagemodule.VImage_header_int(self, *args) + def header_double(self, *args): return vimagemodule.VImage_header_double(self, *args) + def header_string(self, *args): return vimagemodule.VImage_header_string(self, *args) + def cntlines(self, *args): return vimagemodule.VImage_cntlines(self, *args) + def dilate(self, *args): return vimagemodule.VImage_dilate(self, *args) + def dilate_raw(self, *args): return vimagemodule.VImage_dilate_raw(self, *args) + def erode(self, *args): return vimagemodule.VImage_erode(self, *args) + def erode_raw(self, *args): return vimagemodule.VImage_erode_raw(self, *args) + def profile(self, *args): return vimagemodule.VImage_profile(self, *args) + def align_bands(self): return vimagemodule.VImage_align_bands(self) + def correl(self, *args): return vimagemodule.VImage_correl(self, *args) + def _find_lroverlap(self, *args): return vimagemodule.VImage__find_lroverlap(self, *args) + def _find_tboverlap(self, *args): return vimagemodule.VImage__find_tboverlap(self, *args) + def global_balance(self, *args): return vimagemodule.VImage_global_balance(self, *args) + def global_balancef(self, *args): return vimagemodule.VImage_global_balancef(self, *args) + def lrmerge(self, *args): return vimagemodule.VImage_lrmerge(self, *args) + def lrmerge1(self, *args): return vimagemodule.VImage_lrmerge1(self, *args) + def lrmosaic(self, *args): return vimagemodule.VImage_lrmosaic(self, *args) + def lrmosaic1(self, *args): return vimagemodule.VImage_lrmosaic1(self, *args) + def match_linear(self, *args): return vimagemodule.VImage_match_linear(self, *args) + def match_linear_search(self, *args): return vimagemodule.VImage_match_linear_search(self, *args) + def maxpos_subpel(self, *args): return vimagemodule.VImage_maxpos_subpel(self, *args) + def remosaic(self, *args): return vimagemodule.VImage_remosaic(self, *args) + def tbmerge(self, *args): return vimagemodule.VImage_tbmerge(self, *args) + def tbmerge1(self, *args): return vimagemodule.VImage_tbmerge1(self, *args) + def tbmosaic(self, *args): return vimagemodule.VImage_tbmosaic(self, *args) + def tbmosaic1(self, *args): return vimagemodule.VImage_tbmosaic1(self, *args) + def benchmark(self): return vimagemodule.VImage_benchmark(self) + def benchmark2(self): return vimagemodule.VImage_benchmark2(self) + def benchmarkn(self, *args): return vimagemodule.VImage_benchmarkn(self, *args) __swig_getmethods__["eye"] = lambda x: vimagemodule.VImage_eye if _newclass:eye = staticmethod(vimagemodule.VImage_eye) __swig_getmethods__["grey"] = lambda x: vimagemodule.VImage_grey @@ -618,70 +640,193 @@ class VImage(_object): if _newclass:make_xy = staticmethod(vimagemodule.VImage_make_xy) __swig_getmethods__["zone"] = lambda x: vimagemodule.VImage_zone if _newclass:zone = staticmethod(vimagemodule.VImage_zone) - def blend(*args): return vimagemodule.VImage_blend(*args) - def equal(*args): return vimagemodule.VImage_equal(*args) - def ifthenelse(*args): return vimagemodule.VImage_ifthenelse(*args) - def less(*args): return vimagemodule.VImage_less(*args) - def lesseq(*args): return vimagemodule.VImage_lesseq(*args) - def more(*args): return vimagemodule.VImage_more(*args) - def moreeq(*args): return vimagemodule.VImage_moreeq(*args) - def notequal(*args): return vimagemodule.VImage_notequal(*args) - def affine(*args): return vimagemodule.VImage_affine(*args) - def similarity_area(*args): return vimagemodule.VImage_similarity_area(*args) - def similarity(*args): return vimagemodule.VImage_similarity(*args) + def blend(self, *args): return vimagemodule.VImage_blend(self, *args) + def equal(self, *args): return vimagemodule.VImage_equal(self, *args) + def ifthenelse(self, *args): return vimagemodule.VImage_ifthenelse(self, *args) + def less(self, *args): return vimagemodule.VImage_less(self, *args) + def lesseq(self, *args): return vimagemodule.VImage_lesseq(self, *args) + def more(self, *args): return vimagemodule.VImage_more(self, *args) + def moreeq(self, *args): return vimagemodule.VImage_moreeq(self, *args) + def notequal(self, *args): return vimagemodule.VImage_notequal(self, *args) + def affine(self, *args): return vimagemodule.VImage_affine(self, *args) + def similarity_area(self, *args): return vimagemodule.VImage_similarity_area(self, *args) + def similarity(self, *args): return vimagemodule.VImage_similarity(self, *args) __swig_getmethods__["video_test"] = lambda x: vimagemodule.VImage_video_test if _newclass:video_test = staticmethod(vimagemodule.VImage_video_test) __swig_getmethods__["video_v4l1"] = lambda x: vimagemodule.VImage_video_v4l1 if _newclass:video_v4l1 = staticmethod(vimagemodule.VImage_video_v4l1) - def tobuffer(*args): return vimagemodule.VImage_tobuffer(*args) + def tobuffer(self): return vimagemodule.VImage_tobuffer(self) __swig_getmethods__["frombuffer"] = lambda x: vimagemodule.VImage_frombuffer if _newclass:frombuffer = staticmethod(vimagemodule.VImage_frombuffer) - def tostring(*args): return vimagemodule.VImage_tostring(*args) + def tostring(self): return vimagemodule.VImage_tostring(self) __swig_getmethods__["fromstring"] = lambda x: vimagemodule.VImage_fromstring if _newclass:fromstring = staticmethod(vimagemodule.VImage_fromstring) VImage_swigregister = vimagemodule.VImage_swigregister VImage_swigregister(VImage) + +def VImage_print_all(): + return vimagemodule.VImage_print_all() VImage_print_all = vimagemodule.VImage_print_all + +def VImage_convert2disc(*args): + return vimagemodule.VImage_convert2disc(*args) VImage_convert2disc = vimagemodule.VImage_convert2disc + +def VImage_linreg(*args): + return vimagemodule.VImage_linreg(*args) VImage_linreg = vimagemodule.VImage_linreg + +def VImage_black(*args): + return vimagemodule.VImage_black(*args) VImage_black = vimagemodule.VImage_black + +def VImage_gbandjoin(*args): + return vimagemodule.VImage_gbandjoin(*args) VImage_gbandjoin = vimagemodule.VImage_gbandjoin + +def VImage_mask2vips(*args): + return vimagemodule.VImage_mask2vips(*args) VImage_mask2vips = vimagemodule.VImage_mask2vips + +def VImage_text(*args): + return vimagemodule.VImage_text(*args) VImage_text = vimagemodule.VImage_text + +def VImage_gaussnoise(*args): + return vimagemodule.VImage_gaussnoise(*args) VImage_gaussnoise = vimagemodule.VImage_gaussnoise + +def VImage_rank_image(*args): + return vimagemodule.VImage_rank_image(*args) VImage_rank_image = vimagemodule.VImage_rank_image + +def VImage_maxvalue(*args): + return vimagemodule.VImage_maxvalue(*args) VImage_maxvalue = vimagemodule.VImage_maxvalue + +def VImage_csv2vips(*args): + return vimagemodule.VImage_csv2vips(*args) VImage_csv2vips = vimagemodule.VImage_csv2vips + +def VImage_jpeg2vips(*args): + return vimagemodule.VImage_jpeg2vips(*args) VImage_jpeg2vips = vimagemodule.VImage_jpeg2vips + +def VImage_magick2vips(*args): + return vimagemodule.VImage_magick2vips(*args) VImage_magick2vips = vimagemodule.VImage_magick2vips + +def VImage_png2vips(*args): + return vimagemodule.VImage_png2vips(*args) VImage_png2vips = vimagemodule.VImage_png2vips + +def VImage_exr2vips(*args): + return vimagemodule.VImage_exr2vips(*args) VImage_exr2vips = vimagemodule.VImage_exr2vips + +def VImage_ppm2vips(*args): + return vimagemodule.VImage_ppm2vips(*args) VImage_ppm2vips = vimagemodule.VImage_ppm2vips + +def VImage_analyze2vips(*args): + return vimagemodule.VImage_analyze2vips(*args) VImage_analyze2vips = vimagemodule.VImage_analyze2vips + +def VImage_tiff2vips(*args): + return vimagemodule.VImage_tiff2vips(*args) VImage_tiff2vips = vimagemodule.VImage_tiff2vips + +def VImage_create_fmask(*args): + return vimagemodule.VImage_create_fmask(*args) VImage_create_fmask = vimagemodule.VImage_create_fmask + +def VImage_fractsurf(*args): + return vimagemodule.VImage_fractsurf(*args) VImage_fractsurf = vimagemodule.VImage_fractsurf + +def VImage_identity(*args): + return vimagemodule.VImage_identity(*args) VImage_identity = vimagemodule.VImage_identity + +def VImage_identity_ushort(*args): + return vimagemodule.VImage_identity_ushort(*args) VImage_identity_ushort = vimagemodule.VImage_identity_ushort + +def VImage_invertlut(*args): + return vimagemodule.VImage_invertlut(*args) VImage_invertlut = vimagemodule.VImage_invertlut + +def VImage_buildlut(*args): + return vimagemodule.VImage_buildlut(*args) VImage_buildlut = vimagemodule.VImage_buildlut + +def VImage_tone_build(*args): + return vimagemodule.VImage_tone_build(*args) VImage_tone_build = vimagemodule.VImage_tone_build + +def VImage_tone_build_range(*args): + return vimagemodule.VImage_tone_build_range(*args) VImage_tone_build_range = vimagemodule.VImage_tone_build_range + +def VImage_binfile(*args): + return vimagemodule.VImage_binfile(*args) VImage_binfile = vimagemodule.VImage_binfile + +def VImage_eye(*args): + return vimagemodule.VImage_eye(*args) VImage_eye = vimagemodule.VImage_eye + +def VImage_grey(*args): + return vimagemodule.VImage_grey(*args) VImage_grey = vimagemodule.VImage_grey + +def VImage_feye(*args): + return vimagemodule.VImage_feye(*args) VImage_feye = vimagemodule.VImage_feye + +def VImage_fgrey(*args): + return vimagemodule.VImage_fgrey(*args) VImage_fgrey = vimagemodule.VImage_fgrey + +def VImage_fzone(*args): + return vimagemodule.VImage_fzone(*args) VImage_fzone = vimagemodule.VImage_fzone + +def VImage_make_xy(*args): + return vimagemodule.VImage_make_xy(*args) VImage_make_xy = vimagemodule.VImage_make_xy + +def VImage_zone(*args): + return vimagemodule.VImage_zone(*args) VImage_zone = vimagemodule.VImage_zone + +def VImage_video_test(*args): + return vimagemodule.VImage_video_test(*args) VImage_video_test = vimagemodule.VImage_video_test + +def VImage_video_v4l1(*args): + return vimagemodule.VImage_video_v4l1(*args) VImage_video_v4l1 = vimagemodule.VImage_video_v4l1 + +def VImage_frombuffer(*args): + return vimagemodule.VImage_frombuffer(*args) VImage_frombuffer = vimagemodule.VImage_frombuffer + +def VImage_fromstring(*args): + return vimagemodule.VImage_fromstring(*args) VImage_fromstring = vimagemodule.VImage_fromstring + +def im_init_world(*args): + return vimagemodule.im_init_world(*args) im_init_world = vimagemodule.im_init_world + +def im__print_all(): + return vimagemodule.im__print_all() im__print_all = vimagemodule.im__print_all + +def im_col_Lab2XYZ(*args): + return vimagemodule.im_col_Lab2XYZ(*args) im_col_Lab2XYZ = vimagemodule.im_col_Lab2XYZ # try to guess a PIL mode string from a VIPS image def PIL_mode_from_vips (vim): diff --git a/swig/python/vipsCC/VMask.py b/swig/python/vipsCC/VMask.py index b4ebbc45..9feba16e 100644 --- a/swig/python/vipsCC/VMask.py +++ b/swig/python/vipsCC/VMask.py @@ -1,12 +1,32 @@ # This file was automatically generated by SWIG (http://www.swig.org). -# Version 1.3.36 +# Version 1.3.40 # -# Don't modify this file, modify the SWIG interface instead. +# Do not make changes to this file unless you know what you are doing--modify +# the SWIG interface file instead. # This file is compatible with both classic and new-style classes. -import vmaskmodule -import new -new_instancemethod = new.instancemethod +from sys import version_info +if version_info >= (2,6,0): + def swig_import_helper(): + from os.path import dirname + import imp + fp = None + try: + fp, pathname, description = imp.find_module('vmaskmodule', [dirname(__file__)]) + except ImportError: + import vmaskmodule + return vmaskmodule + if fp is not None: + try: + _mod = imp.load_module('vmaskmodule', fp, pathname, description) + finally: + fp.close() + return _mod + vmaskmodule = swig_import_helper() + del swig_import_helper +else: + import vmaskmodule +del version_info try: _swig_property = property except NameError: @@ -14,7 +34,7 @@ except NameError: def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "thisown"): return self.this.own(value) if (name == "this"): - if type(value).__name__ == 'PySwigObject': + if type(value).__name__ == 'SwigPyObject': self.__dict__[name] = value return method = class_type.__swig_setmethods__.get(name,None) @@ -31,21 +51,19 @@ def _swig_getattr(self,class_type,name): if (name == "thisown"): return self.this.own() method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) - raise AttributeError,name + raise AttributeError(name) def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() except: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) -import types try: - _object = types.ObjectType + _object = object _newclass = 1 except AttributeError: class _object : pass _newclass = 0 -del types import VError @@ -61,16 +79,16 @@ class VMask(_object): this = vmaskmodule.new_VMask(*args) try: self.this.append(this) except: self.this = this - def __assign__(*args): return vmaskmodule.VMask___assign__(*args) + def __assign__(self, *args): return vmaskmodule.VMask___assign__(self, *args) __swig_destroy__ = vmaskmodule.delete_VMask __del__ = lambda self : None; - def xsize(*args): return vmaskmodule.VMask_xsize(*args) - def ysize(*args): return vmaskmodule.VMask_ysize(*args) - def size(*args): return vmaskmodule.VMask_size(*args) - def filename(*args): return vmaskmodule.VMask_filename(*args) - def type(*args): return vmaskmodule.VMask_type(*args) - def mask(*args): return vmaskmodule.VMask_mask(*args) - def ostream_print(*args): return vmaskmodule.VMask_ostream_print(*args) + def xsize(self): return vmaskmodule.VMask_xsize(self) + def ysize(self): return vmaskmodule.VMask_ysize(self) + def size(self): return vmaskmodule.VMask_size(self) + def filename(self): return vmaskmodule.VMask_filename(self) + def type(self): return vmaskmodule.VMask_type(self) + def mask(self): return vmaskmodule.VMask_mask(self) + def ostream_print(self, *args): return vmaskmodule.VMask_ostream_print(self, *args) VMask_swigregister = vmaskmodule.VMask_swigregister VMask_swigregister(VMask) @@ -86,31 +104,43 @@ class VIMask(VMask): this = vmaskmodule.new_VIMask(*args) try: self.this.append(this) except: self.this = this - def scale(*args): return vmaskmodule.VIMask_scale(*args) - def offset(*args): return vmaskmodule.VIMask_offset(*args) - def embed(*args): return vmaskmodule.VIMask_embed(*args) - def __index__(*args): return vmaskmodule.VIMask___index__(*args) - def __call__(*args): return vmaskmodule.VIMask___call__(*args) - def get(*args): return vmaskmodule.VIMask_get(*args) + def scale(self): return vmaskmodule.VIMask_scale(self) + def offset(self): return vmaskmodule.VIMask_offset(self) + def embed(self, *args): return vmaskmodule.VIMask_embed(self, *args) + def __index__(self, *args): return vmaskmodule.VIMask___index__(self, *args) + def __call__(self, *args): return vmaskmodule.VIMask___call__(self, *args) + def get(self, *args): return vmaskmodule.VIMask_get(self, *args) __swig_getmethods__["gauss"] = lambda x: vmaskmodule.VIMask_gauss if _newclass:gauss = staticmethod(vmaskmodule.VIMask_gauss) __swig_getmethods__["gauss_sep"] = lambda x: vmaskmodule.VIMask_gauss_sep if _newclass:gauss_sep = staticmethod(vmaskmodule.VIMask_gauss_sep) __swig_getmethods__["log"] = lambda x: vmaskmodule.VIMask_log if _newclass:log = staticmethod(vmaskmodule.VIMask_log) - def rotate45(*args): return vmaskmodule.VIMask_rotate45(*args) - def rotate90(*args): return vmaskmodule.VIMask_rotate90(*args) - def trn(*args): return vmaskmodule.VIMask_trn(*args) - def inv(*args): return vmaskmodule.VIMask_inv(*args) - def cat(*args): return vmaskmodule.VIMask_cat(*args) - def mul(*args): return vmaskmodule.VIMask_mul(*args) + def rotate45(self): return vmaskmodule.VIMask_rotate45(self) + def rotate90(self): return vmaskmodule.VIMask_rotate90(self) + def trn(self): return vmaskmodule.VIMask_trn(self) + def inv(self): return vmaskmodule.VIMask_inv(self) + def cat(self, *args): return vmaskmodule.VIMask_cat(self, *args) + def mul(self, *args): return vmaskmodule.VIMask_mul(self, *args) __swig_destroy__ = vmaskmodule.delete_VIMask __del__ = lambda self : None; VIMask_swigregister = vmaskmodule.VIMask_swigregister VIMask_swigregister(VIMask) + +def __lshift__(*args): + return vmaskmodule.__lshift__(*args) __lshift__ = vmaskmodule.__lshift__ + +def VIMask_gauss(*args): + return vmaskmodule.VIMask_gauss(*args) VIMask_gauss = vmaskmodule.VIMask_gauss + +def VIMask_gauss_sep(*args): + return vmaskmodule.VIMask_gauss_sep(*args) VIMask_gauss_sep = vmaskmodule.VIMask_gauss_sep + +def VIMask_log(*args): + return vmaskmodule.VIMask_log(*args) VIMask_log = vmaskmodule.VIMask_log class VDMask(VMask): @@ -125,28 +155,34 @@ class VDMask(VMask): this = vmaskmodule.new_VDMask(*args) try: self.this.append(this) except: self.this = this - def embed(*args): return vmaskmodule.VDMask_embed(*args) - def scale(*args): return vmaskmodule.VDMask_scale(*args) - def offset(*args): return vmaskmodule.VDMask_offset(*args) - def __index__(*args): return vmaskmodule.VDMask___index__(*args) - def __call__(*args): return vmaskmodule.VDMask___call__(*args) - def get(*args): return vmaskmodule.VDMask_get(*args) + def embed(self, *args): return vmaskmodule.VDMask_embed(self, *args) + def scale(self): return vmaskmodule.VDMask_scale(self) + def offset(self): return vmaskmodule.VDMask_offset(self) + def __index__(self, *args): return vmaskmodule.VDMask___index__(self, *args) + def __call__(self, *args): return vmaskmodule.VDMask___call__(self, *args) + def get(self, *args): return vmaskmodule.VDMask_get(self, *args) __swig_getmethods__["gauss"] = lambda x: vmaskmodule.VDMask_gauss if _newclass:gauss = staticmethod(vmaskmodule.VDMask_gauss) __swig_getmethods__["log"] = lambda x: vmaskmodule.VDMask_log if _newclass:log = staticmethod(vmaskmodule.VDMask_log) - def rotate45(*args): return vmaskmodule.VDMask_rotate45(*args) - def rotate90(*args): return vmaskmodule.VDMask_rotate90(*args) - def scalei(*args): return vmaskmodule.VDMask_scalei(*args) - def trn(*args): return vmaskmodule.VDMask_trn(*args) - def inv(*args): return vmaskmodule.VDMask_inv(*args) - def cat(*args): return vmaskmodule.VDMask_cat(*args) - def mul(*args): return vmaskmodule.VDMask_mul(*args) + def rotate45(self): return vmaskmodule.VDMask_rotate45(self) + def rotate90(self): return vmaskmodule.VDMask_rotate90(self) + def scalei(self): return vmaskmodule.VDMask_scalei(self) + def trn(self): return vmaskmodule.VDMask_trn(self) + def inv(self): return vmaskmodule.VDMask_inv(self) + def cat(self, *args): return vmaskmodule.VDMask_cat(self, *args) + def mul(self, *args): return vmaskmodule.VDMask_mul(self, *args) __swig_destroy__ = vmaskmodule.delete_VDMask __del__ = lambda self : None; VDMask_swigregister = vmaskmodule.VDMask_swigregister VDMask_swigregister(VDMask) + +def VDMask_gauss(*args): + return vmaskmodule.VDMask_gauss(*args) VDMask_gauss = vmaskmodule.VDMask_gauss + +def VDMask_log(*args): + return vmaskmodule.VDMask_log(*args) VDMask_log = vmaskmodule.VDMask_log diff --git a/swig/python/vmaskmodule.cpp b/swig/python/vmaskmodule.cpp index 69a3b067..d591db65 100644 --- a/swig/python/vmaskmodule.cpp +++ b/swig/python/vmaskmodule.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.36 + * Version 1.3.40 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -11,19 +11,23 @@ #define SWIGPYTHON #define SWIG_PYTHON_DIRECTOR_NO_VTABLE + #ifdef __cplusplus +/* SwigValueWrapper is described in swig.swg */ template class SwigValueWrapper { - T *tt; + struct SwigMovePointer { + T *ptr; + SwigMovePointer(T *p) : ptr(p) { } + ~SwigMovePointer() { delete ptr; } + SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper(const SwigValueWrapper& rhs); public: - SwigValueWrapper() : tt(0) { } - SwigValueWrapper(const SwigValueWrapper& rhs) : tt(new T(*rhs.tt)) { } - SwigValueWrapper(const T& t) : tt(new T(t)) { } - ~SwigValueWrapper() { delete tt; } - SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; } - operator T&() const { return *tt; } - T *operator&() { return tt; } -private: - SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper() : pointer(0) { } + SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } + operator T&() const { return *pointer.ptr; } + T *operator&() { return pointer.ptr; } }; template T SwigValueInit() { @@ -147,7 +151,7 @@ template T SwigValueInit() { /* ----------------------------------------------------------------------------- * swigrun.swg * - * This file contains generic CAPI SWIG runtime support for pointer + * This file contains generic C API SWIG runtime support for pointer * type checking. * ----------------------------------------------------------------------------- */ @@ -166,11 +170,11 @@ template T SwigValueInit() { /* You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for - creating a static or dynamic library from the swig runtime code. - In 99.9% of the cases, swig just needs to declare them as 'static'. + creating a static or dynamic library from the SWIG runtime code. + In 99.9% of the cases, SWIG just needs to declare them as 'static'. - But only do this if is strictly necessary, ie, if you have problems - with your compiler or so. + But only do this if strictly necessary, ie, if you have problems + with your compiler or suchlike. */ #ifndef SWIGRUNTIME @@ -197,14 +201,14 @@ template T SwigValueInit() { /* Flags/methods for returning states. - The swig conversion methods, as ConvertPtr, return and integer + The SWIG conversion methods, as ConvertPtr, return and integer that tells if the conversion was successful or not. And if not, an error code can be returned (see swigerrors.swg for the codes). Use the following macros/flags to set or process the returning states. - In old swig versions, you usually write code as: + In old versions of SWIG, code such as the following was usually written: if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { // success code @@ -212,7 +216,7 @@ template T SwigValueInit() { //fail code } - Now you can be more explicit as: + Now you can be more explicit: int res = SWIG_ConvertPtr(obj,vptr,ty.flags); if (SWIG_IsOK(res)) { @@ -221,7 +225,7 @@ template T SwigValueInit() { // fail code } - that seems to be the same, but now you can also do + which is the same really, but now you can also do Type *ptr; int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); @@ -239,7 +243,7 @@ template T SwigValueInit() { I.e., now SWIG_ConvertPtr can return new objects and you can identify the case and take care of the deallocation. Of course that - requires also to SWIG_ConvertPtr to return new result values, as + also requires SWIG_ConvertPtr to return new result values, such as int SWIG_ConvertPtr(obj, ptr,...) { if () { @@ -257,7 +261,7 @@ template T SwigValueInit() { Of course, returning the plain '0(success)/-1(fail)' still works, but you can be more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the - swig errors code. + SWIG errors code. Finally, if the SWIG_CASTRANK_MODE is enabled, the result code allows to return the 'cast rank', for example, if you have this @@ -271,9 +275,8 @@ template T SwigValueInit() { fooi(1) // cast rank '0' just use the SWIG_AddCast()/SWIG_CheckState() +*/ - - */ #define SWIG_OK (0) #define SWIG_ERROR (-1) #define SWIG_IsOK(r) (r >= 0) @@ -298,7 +301,6 @@ template T SwigValueInit() { #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) - /* Cast-Rank Mode */ #if defined(SWIG_CASTRANK_MODE) # ifndef SWIG_TypeRank @@ -321,8 +323,6 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) { #endif - - #include #ifdef __cplusplus @@ -419,40 +419,58 @@ SWIG_TypeCompare(const char *nb, const char *tb) { } -/* think of this as a c++ template<> or a scheme macro */ -#define SWIG_TypeCheck_Template(comparison, ty) \ - if (ty) { \ - swig_cast_info *iter = ty->cast; \ - while (iter) { \ - if (comparison) { \ - if (iter == ty->cast) return iter; \ - /* Move iter to the top of the linked list */ \ - iter->prev->next = iter->next; \ - if (iter->next) \ - iter->next->prev = iter->prev; \ - iter->next = ty->cast; \ - iter->prev = 0; \ - if (ty->cast) ty->cast->prev = iter; \ - ty->cast = iter; \ - return iter; \ - } \ - iter = iter->next; \ - } \ - } \ - return 0 - /* Check the typename */ SWIGRUNTIME swig_cast_info * SWIG_TypeCheck(const char *c, swig_type_info *ty) { - SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty); + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (strcmp(iter->type->name, c) == 0) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; } -/* Same as previous function, except strcmp is replaced with a pointer comparison */ +/* + Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison +*/ SWIGRUNTIME swig_cast_info * -SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { - SWIG_TypeCheck_Template(iter->type == from, into); +SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (iter->type == from) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; } /* @@ -731,6 +749,67 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { +/* Compatibility macros for Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 + +#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) +#define PyInt_Check(x) PyLong_Check(x) +#define PyInt_AsLong(x) PyLong_AsLong(x) +#define PyInt_FromLong(x) PyLong_FromLong(x) +#define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) + +#endif + +#ifndef Py_TYPE +# define Py_TYPE(op) ((op)->ob_type) +#endif + +/* SWIG APIs for compatibility of both Python 2 & 3 */ + +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_Python_str_FromFormat PyUnicode_FromFormat +#else +# define SWIG_Python_str_FromFormat PyString_FromFormat +#endif + + +/* Warning: This function will allocate a new string in Python 3, + * so please call SWIG_Python_str_DelForPy3(x) to free the space. + */ +SWIGINTERN char* +SWIG_Python_str_AsChar(PyObject *str) +{ +#if PY_VERSION_HEX >= 0x03000000 + char *cstr; + char *newstr; + Py_ssize_t len; + str = PyUnicode_AsUTF8String(str); + PyBytes_AsStringAndSize(str, &cstr, &len); + newstr = (char *) malloc(len+1); + memcpy(newstr, cstr, len+1); + Py_XDECREF(str); + return newstr; +#else + return PyString_AsString(str); +#endif +} + +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_Python_str_DelForPy3(x) free( (void*) (x) ) +#else +# define SWIG_Python_str_DelForPy3(x) +#endif + + +SWIGINTERN PyObject* +SWIG_Python_str_FromChar(const char *c) +{ +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_FromString(c); +#else + return PyString_FromString(c); +#endif +} /* Add PyOS_snprintf for old Pythons */ #if PY_VERSION_HEX < 0x02020000 @@ -777,6 +856,7 @@ PyString_FromFormat(const char *fmt, ...) { # define PyObject_GenericGetAttr 0 # endif #endif + /* Py_NotImplemented is defined in 2.1 and up. */ #if PY_VERSION_HEX < 0x02010000 # ifndef Py_NotImplemented @@ -784,7 +864,6 @@ PyString_FromFormat(const char *fmt, ...) { # endif #endif - /* A crude PyString_AsStringAndSize implementation for old Pythons */ #if PY_VERSION_HEX < 0x02010000 # ifndef PyString_AsStringAndSize @@ -799,7 +878,6 @@ PyString_FromFormat(const char *fmt, ...) { # endif #endif - /* PyBool_FromLong for old Pythons */ #if PY_VERSION_HEX < 0x02030000 static @@ -877,10 +955,13 @@ SWIG_Python_AddErrorMsg(const char* mesg) if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback); if (value) { + char *tmp; PyObject *old_str = PyObject_Str(value); PyErr_Clear(); Py_XINCREF(type); - PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg); + + PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); + SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); Py_DECREF(value); } else { @@ -888,8 +969,6 @@ SWIG_Python_AddErrorMsg(const char* mesg) } } - - #if defined(SWIG_PYTHON_NO_THREADS) # if defined(SWIG_PYTHON_THREADS) # undef SWIG_PYTHON_THREADS @@ -986,6 +1065,20 @@ typedef struct swig_const_info { swig_type_info **ptype; } swig_const_info; + +/* ----------------------------------------------------------------------------- + * Wrapper of PyInstanceMethod_New() used in Python 3 + * It is exported to the generated module, used for -fastproxy + * ----------------------------------------------------------------------------- */ +SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *self, PyObject *func) +{ +#if PY_VERSION_HEX >= 0x03000000 + return PyInstanceMethod_New(func); +#else + return NULL; +#endif +} + #ifdef __cplusplus #if 0 { /* cc-mode */ @@ -1038,7 +1131,7 @@ typedef struct swig_const_info { #define SWIG_GetModule(clientdata) SWIG_Python_GetModule() #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) -#define SWIG_NewClientData(obj) PySwigClientData_New(obj) +#define SWIG_NewClientData(obj) SwigPyClientData_New(obj) #define SWIG_SetErrorObj SWIG_Python_SetErrorObj #define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg @@ -1234,7 +1327,7 @@ SWIG_Py_Void(void) return none; } -/* PySwigClientData */ +/* SwigPyClientData */ typedef struct { PyObject *klass; @@ -1243,30 +1336,30 @@ typedef struct { PyObject *destroy; int delargs; int implicitconv; -} PySwigClientData; +} SwigPyClientData; SWIGRUNTIMEINLINE int SWIG_Python_CheckImplicit(swig_type_info *ty) { - PySwigClientData *data = (PySwigClientData *)ty->clientdata; + SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; return data ? data->implicitconv : 0; } SWIGRUNTIMEINLINE PyObject * SWIG_Python_ExceptionType(swig_type_info *desc) { - PySwigClientData *data = desc ? (PySwigClientData *) desc->clientdata : 0; + SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0; PyObject *klass = data ? data->klass : 0; return (klass ? klass : PyExc_RuntimeError); } -SWIGRUNTIME PySwigClientData * -PySwigClientData_New(PyObject* obj) +SWIGRUNTIME SwigPyClientData * +SwigPyClientData_New(PyObject* obj) { if (!obj) { return 0; } else { - PySwigClientData *data = (PySwigClientData *)malloc(sizeof(PySwigClientData)); + SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData)); /* the klass element */ data->klass = obj; Py_INCREF(data->klass); @@ -1314,14 +1407,14 @@ PySwigClientData_New(PyObject* obj) } SWIGRUNTIME void -PySwigClientData_Del(PySwigClientData* data) +SwigPyClientData_Del(SwigPyClientData* data) { Py_XDECREF(data->newraw); Py_XDECREF(data->newargs); Py_XDECREF(data->destroy); } -/* =============== PySwigObject =====================*/ +/* =============== SwigPyObject =====================*/ typedef struct { PyObject_HEAD @@ -1329,24 +1422,28 @@ typedef struct { swig_type_info *ty; int own; PyObject *next; -} PySwigObject; +} SwigPyObject; SWIGRUNTIME PyObject * -PySwigObject_long(PySwigObject *v) +SwigPyObject_long(SwigPyObject *v) { return PyLong_FromVoidPtr(v->ptr); } SWIGRUNTIME PyObject * -PySwigObject_format(const char* fmt, PySwigObject *v) +SwigPyObject_format(const char* fmt, SwigPyObject *v) { PyObject *res = NULL; PyObject *args = PyTuple_New(1); if (args) { - if (PyTuple_SetItem(args, 0, PySwigObject_long(v)) == 0) { - PyObject *ofmt = PyString_FromString(fmt); + if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) { + PyObject *ofmt = SWIG_Python_str_FromChar(fmt); if (ofmt) { +#if PY_VERSION_HEX >= 0x03000000 + res = PyUnicode_Format(ofmt,args); +#else res = PyString_Format(ofmt,args); +#endif Py_DECREF(ofmt); } Py_DECREF(args); @@ -1356,49 +1453,57 @@ PySwigObject_format(const char* fmt, PySwigObject *v) } SWIGRUNTIME PyObject * -PySwigObject_oct(PySwigObject *v) +SwigPyObject_oct(SwigPyObject *v) { - return PySwigObject_format("%o",v); + return SwigPyObject_format("%o",v); } SWIGRUNTIME PyObject * -PySwigObject_hex(PySwigObject *v) +SwigPyObject_hex(SwigPyObject *v) { - return PySwigObject_format("%x",v); + return SwigPyObject_format("%x",v); } SWIGRUNTIME PyObject * #ifdef METH_NOARGS -PySwigObject_repr(PySwigObject *v) +SwigPyObject_repr(SwigPyObject *v) #else -PySwigObject_repr(PySwigObject *v, PyObject *args) +SwigPyObject_repr(SwigPyObject *v, PyObject *args) #endif { const char *name = SWIG_TypePrettyName(v->ty); - PyObject *hex = PySwigObject_hex(v); - PyObject *repr = PyString_FromFormat("", name, PyString_AsString(hex)); - Py_DECREF(hex); + PyObject *repr = SWIG_Python_str_FromFormat("", name, v); if (v->next) { #ifdef METH_NOARGS - PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next); + PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); #else - PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next, args); + PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args); #endif +#if PY_VERSION_HEX >= 0x03000000 + PyObject *joined = PyUnicode_Concat(repr, nrep); + Py_DecRef(repr); + Py_DecRef(nrep); + repr = joined; +#else PyString_ConcatAndDel(&repr,nrep); +#endif } return repr; } SWIGRUNTIME int -PySwigObject_print(PySwigObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) +SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { + char *str; #ifdef METH_NOARGS - PyObject *repr = PySwigObject_repr(v); + PyObject *repr = SwigPyObject_repr(v); #else - PyObject *repr = PySwigObject_repr(v, NULL); + PyObject *repr = SwigPyObject_repr(v, NULL); #endif if (repr) { - fputs(PyString_AsString(repr), fp); + str = SWIG_Python_str_AsChar(repr); + fputs(str, fp); + SWIG_Python_str_DelForPy3(str); Py_DECREF(repr); return 0; } else { @@ -1407,53 +1512,71 @@ PySwigObject_print(PySwigObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) } SWIGRUNTIME PyObject * -PySwigObject_str(PySwigObject *v) +SwigPyObject_str(SwigPyObject *v) { char result[SWIG_BUFFER_SIZE]; return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ? - PyString_FromString(result) : 0; + SWIG_Python_str_FromChar(result) : 0; } SWIGRUNTIME int -PySwigObject_compare(PySwigObject *v, PySwigObject *w) +SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) { void *i = v->ptr; void *j = w->ptr; return (i < j) ? -1 : ((i > j) ? 1 : 0); } +/* Added for Python 3.x, would it also be useful for Python 2.x? */ +SWIGRUNTIME PyObject* +SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op) +{ + PyObject* res; + if( op != Py_EQ && op != Py_NE ) { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } + if( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ) + res = Py_True; + else + res = Py_False; + Py_INCREF(res); + return res; +} + + SWIGRUNTIME PyTypeObject* _PySwigObject_type(void); SWIGRUNTIME PyTypeObject* -PySwigObject_type(void) { +SwigPyObject_type(void) { static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type(); return type; } SWIGRUNTIMEINLINE int -PySwigObject_Check(PyObject *op) { - return ((op)->ob_type == PySwigObject_type()) - || (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0); +SwigPyObject_Check(PyObject *op) { + return (Py_TYPE(op) == SwigPyObject_type()) + || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); } SWIGRUNTIME PyObject * -PySwigObject_New(void *ptr, swig_type_info *ty, int own); +SwigPyObject_New(void *ptr, swig_type_info *ty, int own); SWIGRUNTIME void -PySwigObject_dealloc(PyObject *v) +SwigPyObject_dealloc(PyObject *v) { - PySwigObject *sobj = (PySwigObject *) v; + SwigPyObject *sobj = (SwigPyObject *) v; PyObject *next = sobj->next; if (sobj->own == SWIG_POINTER_OWN) { swig_type_info *ty = sobj->ty; - PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0; + SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; PyObject *destroy = data ? data->destroy : 0; if (destroy) { /* destroy is always a VARARGS method */ PyObject *res; if (data->delargs) { - /* we need to create a temporal object to carry the destroy operation */ - PyObject *tmp = PySwigObject_New(sobj->ptr, ty, 0); + /* we need to create a temporary object to carry the destroy operation */ + PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0); res = SWIG_Python_CallFunctor(destroy, tmp); Py_DECREF(tmp); } else { @@ -1475,15 +1598,15 @@ PySwigObject_dealloc(PyObject *v) } SWIGRUNTIME PyObject* -PySwigObject_append(PyObject* v, PyObject* next) +SwigPyObject_append(PyObject* v, PyObject* next) { - PySwigObject *sobj = (PySwigObject *) v; + SwigPyObject *sobj = (SwigPyObject *) v; #ifndef METH_O PyObject *tmp = 0; if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL; next = tmp; #endif - if (!PySwigObject_Check(next)) { + if (!SwigPyObject_Check(next)) { return NULL; } sobj->next = next; @@ -1493,12 +1616,12 @@ PySwigObject_append(PyObject* v, PyObject* next) SWIGRUNTIME PyObject* #ifdef METH_NOARGS -PySwigObject_next(PyObject* v) +SwigPyObject_next(PyObject* v) #else -PySwigObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { - PySwigObject *sobj = (PySwigObject *) v; + SwigPyObject *sobj = (SwigPyObject *) v; if (sobj->next) { Py_INCREF(sobj->next); return sobj->next; @@ -1509,30 +1632,30 @@ PySwigObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) SWIGINTERN PyObject* #ifdef METH_NOARGS -PySwigObject_disown(PyObject *v) +SwigPyObject_disown(PyObject *v) #else -PySwigObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { - PySwigObject *sobj = (PySwigObject *)v; + SwigPyObject *sobj = (SwigPyObject *)v; sobj->own = 0; return SWIG_Py_Void(); } SWIGINTERN PyObject* #ifdef METH_NOARGS -PySwigObject_acquire(PyObject *v) +SwigPyObject_acquire(PyObject *v) #else -PySwigObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { - PySwigObject *sobj = (PySwigObject *)v; + SwigPyObject *sobj = (SwigPyObject *)v; sobj->own = SWIG_POINTER_OWN; return SWIG_Py_Void(); } SWIGINTERN PyObject* -PySwigObject_own(PyObject *v, PyObject *args) +SwigPyObject_own(PyObject *v, PyObject *args) { PyObject *val = 0; #if (PY_VERSION_HEX < 0x02020000) @@ -1545,20 +1668,20 @@ PySwigObject_own(PyObject *v, PyObject *args) } else { - PySwigObject *sobj = (PySwigObject *)v; + SwigPyObject *sobj = (SwigPyObject *)v; PyObject *obj = PyBool_FromLong(sobj->own); if (val) { #ifdef METH_NOARGS if (PyObject_IsTrue(val)) { - PySwigObject_acquire(v); + SwigPyObject_acquire(v); } else { - PySwigObject_disown(v); + SwigPyObject_disown(v); } #else if (PyObject_IsTrue(val)) { - PySwigObject_acquire(v,args); + SwigPyObject_acquire(v,args); } else { - PySwigObject_disown(v,args); + SwigPyObject_disown(v,args); } #endif } @@ -1569,30 +1692,30 @@ PySwigObject_own(PyObject *v, PyObject *args) #ifdef METH_O static PyMethodDef swigobject_methods[] = { - {(char *)"disown", (PyCFunction)PySwigObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)PySwigObject_append, METH_O, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)PySwigObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)PySwigObject_repr, METH_NOARGS, (char *)"returns object representation"}, + {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"}, + {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, + {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"}, + {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, + {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"}, {0, 0, 0, 0} }; #else static PyMethodDef swigobject_methods[] = { - {(char *)"disown", (PyCFunction)PySwigObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)PySwigObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)PySwigObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)PySwigObject_repr, METH_VARARGS, (char *)"returns object representation"}, + {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"}, + {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, + {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, + {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, + {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"}, {0, 0, 0, 0} }; #endif #if PY_VERSION_HEX < 0x02020000 SWIGINTERN PyObject * -PySwigObject_getattr(PySwigObject *sobj,char *name) +SwigPyObject_getattr(SwigPyObject *sobj,char *name) { return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name); } @@ -1602,11 +1725,14 @@ SWIGRUNTIME PyTypeObject* _PySwigObject_type(void) { static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; - static PyNumberMethods PySwigObject_as_number = { + static PyNumberMethods SwigPyObject_as_number = { (binaryfunc)0, /*nb_add*/ (binaryfunc)0, /*nb_subtract*/ (binaryfunc)0, /*nb_multiply*/ + /* nb_divide removed in Python 3 */ +#if PY_VERSION_HEX < 0x03000000 (binaryfunc)0, /*nb_divide*/ +#endif (binaryfunc)0, /*nb_remainder*/ (binaryfunc)0, /*nb_divmod*/ (ternaryfunc)0,/*nb_power*/ @@ -1620,13 +1746,23 @@ _PySwigObject_type(void) { 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ - (coercion)0, /*nb_coerce*/ - (unaryfunc)PySwigObject_long, /*nb_int*/ - (unaryfunc)PySwigObject_long, /*nb_long*/ +#if PY_VERSION_HEX < 0x03000000 + 0, /*nb_coerce*/ +#endif + (unaryfunc)SwigPyObject_long, /*nb_int*/ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc)SwigPyObject_long, /*nb_long*/ +#else + 0, /*nb_reserved*/ +#endif (unaryfunc)0, /*nb_float*/ - (unaryfunc)PySwigObject_oct, /*nb_oct*/ - (unaryfunc)PySwigObject_hex, /*nb_hex*/ -#if PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc)SwigPyObject_oct, /*nb_oct*/ + (unaryfunc)SwigPyObject_hex, /*nb_hex*/ +#endif +#if PY_VERSION_HEX >= 0x03000000 /* 3.0 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ +#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ #elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ @@ -1635,32 +1771,41 @@ _PySwigObject_type(void) { #endif }; - static PyTypeObject pyswigobject_type; + static PyTypeObject swigpyobject_type; static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else PyObject_HEAD_INIT(NULL) 0, /* ob_size */ - (char *)"PySwigObject", /* tp_name */ - sizeof(PySwigObject), /* tp_basicsize */ +#endif + (char *)"SwigPyObject", /* tp_name */ + sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ - (destructor)PySwigObject_dealloc, /* tp_dealloc */ - (printfunc)PySwigObject_print, /* tp_print */ + (destructor)SwigPyObject_dealloc, /* tp_dealloc */ + (printfunc)SwigPyObject_print, /* tp_print */ #if PY_VERSION_HEX < 0x02020000 - (getattrfunc)PySwigObject_getattr, /* tp_getattr */ + (getattrfunc)SwigPyObject_getattr, /* tp_getattr */ #else (getattrfunc)0, /* tp_getattr */ #endif (setattrfunc)0, /* tp_setattr */ - (cmpfunc)PySwigObject_compare, /* tp_compare */ - (reprfunc)PySwigObject_repr, /* tp_repr */ - &PySwigObject_as_number, /* tp_as_number */ +#if PY_VERSION_HEX >= 0x03000000 + 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ +#else + (cmpfunc)SwigPyObject_compare, /* tp_compare */ +#endif + (reprfunc)SwigPyObject_repr, /* tp_repr */ + &SwigPyObject_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ (hashfunc)0, /* tp_hash */ (ternaryfunc)0, /* tp_call */ - (reprfunc)PySwigObject_str, /* tp_str */ + (reprfunc)SwigPyObject_str, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -1668,7 +1813,7 @@ _PySwigObject_type(void) { swigobject_doc, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ - 0, /* tp_richcompare */ + (richcmpfunc)SwigPyObject_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ #if PY_VERSION_HEX >= 0x02020000 0, /* tp_iter */ @@ -1685,11 +1830,11 @@ _PySwigObject_type(void) { 0, /* tp_alloc */ 0, /* tp_new */ 0, /* tp_free */ - 0, /* tp_is_gc */ + 0, /* tp_is_gc */ 0, /* tp_bases */ 0, /* tp_mro */ 0, /* tp_cache */ - 0, /* tp_subclasses */ + 0, /* tp_subclasses */ 0, /* tp_weaklist */ #endif #if PY_VERSION_HEX >= 0x02030000 @@ -1699,17 +1844,20 @@ _PySwigObject_type(void) { 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; - pyswigobject_type = tmp; - pyswigobject_type.ob_type = &PyType_Type; + swigpyobject_type = tmp; + /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 + swigpyobject_type.ob_type = &PyType_Type; +#endif type_init = 1; } - return &pyswigobject_type; + return &swigpyobject_type; } SWIGRUNTIME PyObject * -PySwigObject_New(void *ptr, swig_type_info *ty, int own) +SwigPyObject_New(void *ptr, swig_type_info *ty, int own) { - PySwigObject *sobj = PyObject_NEW(PySwigObject, PySwigObject_type()); + SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); if (sobj) { sobj->ptr = ptr; sobj->ty = ty; @@ -1728,10 +1876,10 @@ typedef struct { void *pack; swig_type_info *ty; size_t size; -} PySwigPacked; +} SwigPyPacked; SWIGRUNTIME int -PySwigPacked_print(PySwigPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) +SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { char result[SWIG_BUFFER_SIZE]; fputs("pack, v->size, 0, sizeof(result))) { - return PyString_FromFormat("", result, v->ty->name); + return SWIG_Python_str_FromFormat("", result, v->ty->name); } else { - return PyString_FromFormat("", v->ty->name); + return SWIG_Python_str_FromFormat("", v->ty->name); } } SWIGRUNTIME PyObject * -PySwigPacked_str(PySwigPacked *v) +SwigPyPacked_str(SwigPyPacked *v) { char result[SWIG_BUFFER_SIZE]; if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ - return PyString_FromFormat("%s%s", result, v->ty->name); + return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name); } else { - return PyString_FromString(v->ty->name); + return SWIG_Python_str_FromChar(v->ty->name); } } SWIGRUNTIME int -PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w) +SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) { size_t i = v->size; size_t j = w->size; @@ -1778,22 +1926,22 @@ PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w) SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void); SWIGRUNTIME PyTypeObject* -PySwigPacked_type(void) { +SwigPyPacked_type(void) { static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigPacked_type(); return type; } SWIGRUNTIMEINLINE int -PySwigPacked_Check(PyObject *op) { +SwigPyPacked_Check(PyObject *op) { return ((op)->ob_type == _PySwigPacked_type()) - || (strcmp((op)->ob_type->tp_name,"PySwigPacked") == 0); + || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); } SWIGRUNTIME void -PySwigPacked_dealloc(PyObject *v) +SwigPyPacked_dealloc(PyObject *v) { - if (PySwigPacked_Check(v)) { - PySwigPacked *sobj = (PySwigPacked *) v; + if (SwigPyPacked_Check(v)) { + SwigPyPacked *sobj = (SwigPyPacked *) v; free(sobj->pack); } PyObject_DEL(v); @@ -1802,28 +1950,37 @@ PySwigPacked_dealloc(PyObject *v) SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void) { static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; - static PyTypeObject pyswigpacked_type; + static PyTypeObject swigpypacked_type; static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX>=0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ - (char *)"PySwigPacked", /* tp_name */ - sizeof(PySwigPacked), /* tp_basicsize */ + 0, /* ob_size */ +#endif + (char *)"SwigPyPacked", /* tp_name */ + sizeof(SwigPyPacked), /* tp_basicsize */ 0, /* tp_itemsize */ - (destructor)PySwigPacked_dealloc, /* tp_dealloc */ - (printfunc)PySwigPacked_print, /* tp_print */ + (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ + (printfunc)SwigPyPacked_print, /* tp_print */ (getattrfunc)0, /* tp_getattr */ (setattrfunc)0, /* tp_setattr */ - (cmpfunc)PySwigPacked_compare, /* tp_compare */ - (reprfunc)PySwigPacked_repr, /* tp_repr */ - 0, /* tp_as_number */ +#if PY_VERSION_HEX>=0x03000000 + 0, /* tp_reserved in 3.0.1 */ +#else + (cmpfunc)SwigPyPacked_compare, /* tp_compare */ +#endif + (reprfunc)SwigPyPacked_repr, /* tp_repr */ + 0, /* tp_as_number */ 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - (reprfunc)PySwigPacked_str, /* tp_str */ + 0, /* tp_as_mapping */ + (hashfunc)0, /* tp_hash */ + (ternaryfunc)0, /* tp_call */ + (reprfunc)SwigPyPacked_str, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -1862,17 +2019,20 @@ _PySwigPacked_type(void) { 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; - pyswigpacked_type = tmp; - pyswigpacked_type.ob_type = &PyType_Type; + swigpypacked_type = tmp; + /* for Python 3 the ob_type already assigned in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 + swigpypacked_type.ob_type = &PyType_Type; +#endif type_init = 1; } - return &pyswigpacked_type; + return &swigpypacked_type; } SWIGRUNTIME PyObject * -PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty) +SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) { - PySwigPacked *sobj = PyObject_NEW(PySwigPacked, PySwigPacked_type()); + SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); if (sobj) { void *pack = malloc(size); if (pack) { @@ -1889,10 +2049,10 @@ PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty) } SWIGRUNTIME swig_type_info * -PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size) +SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) { - if (PySwigPacked_Check(obj)) { - PySwigPacked *sobj = (PySwigPacked *)obj; + if (SwigPyPacked_Check(obj)) { + SwigPyPacked *sobj = (SwigPyPacked *)obj; if (sobj->size != size) return 0; memcpy(ptr, sobj->pack, size); return sobj->ty; @@ -1908,7 +2068,7 @@ PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size) SWIGRUNTIMEINLINE PyObject * _SWIG_This(void) { - return PyString_FromString("this"); + return SWIG_Python_str_FromChar("this"); } SWIGRUNTIME PyObject * @@ -1920,11 +2080,16 @@ SWIG_This(void) /* #define SWIG_PYTHON_SLOW_GETSET_THIS */ -SWIGRUNTIME PySwigObject * +/* TODO: I don't know how to implement the fast getset in Python 3 right now */ +#if PY_VERSION_HEX>=0x03000000 +#define SWIG_PYTHON_SLOW_GETSET_THIS +#endif + +SWIGRUNTIME SwigPyObject * SWIG_Python_GetSwigThis(PyObject *pyobj) { - if (PySwigObject_Check(pyobj)) { - return (PySwigObject *) pyobj; + if (SwigPyObject_Check(pyobj)) { + return (SwigPyObject *) pyobj; } else { PyObject *obj = 0; #if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000)) @@ -1960,12 +2125,12 @@ SWIG_Python_GetSwigThis(PyObject *pyobj) return 0; } #endif - if (obj && !PySwigObject_Check(obj)) { + if (obj && !SwigPyObject_Check(obj)) { /* a PyObject is called 'this', try to get the 'real this' - PySwigObject from it */ + SwigPyObject from it */ return SWIG_Python_GetSwigThis(obj); } - return (PySwigObject *)obj; + return (SwigPyObject *)obj; } } @@ -1974,7 +2139,7 @@ SWIG_Python_GetSwigThis(PyObject *pyobj) SWIGRUNTIME int SWIG_Python_AcquirePtr(PyObject *obj, int own) { if (own == SWIG_POINTER_OWN) { - PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); + SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); if (sobj) { int oldown = sobj->own; sobj->own = own; @@ -1993,7 +2158,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int if (ptr) *ptr = 0; return SWIG_OK; } else { - PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); + SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); if (own) *own = 0; while (sobj) { @@ -2007,7 +2172,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int } else { swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); if (!tc) { - sobj = (PySwigObject *)sobj->next; + sobj = (SwigPyObject *)sobj->next; } else { if (ptr) { int newmemory = 0; @@ -2036,7 +2201,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int } else { int res = SWIG_ERROR; if (flags & SWIG_POINTER_IMPLICIT_CONV) { - PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0; + SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; if (data && !data->implicitconv) { PyObject *klass = data->klass; if (klass) { @@ -2049,7 +2214,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int impconv = 0; } if (impconv) { - PySwigObject *iobj = SWIG_Python_GetSwigThis(impconv); + SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv); if (iobj) { void *vptr; res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0); @@ -2087,10 +2252,10 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { /* here we get the method pointer for callbacks */ const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; - if (desc) { + if (desc) desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; - if (!desc) return SWIG_ERROR; - } + if (!desc) + return SWIG_ERROR; if (ty) { swig_cast_info *tc = SWIG_TypeCheck(desc,ty); if (tc) { @@ -2111,7 +2276,7 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { SWIGRUNTIME int SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { - swig_type_info *to = PySwigPacked_UnpackData(obj, ptr, sz); + swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz); if (!to) return SWIG_ERROR; if (ty) { if (to != ty) { @@ -2128,12 +2293,12 @@ SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *t * ----------------------------------------------------------------------------- */ /* - Create a new instance object, whitout calling __init__, and set the + Create a new instance object, without calling __init__, and set the 'this' attribute. */ SWIGRUNTIME PyObject* -SWIG_Python_NewShadowInstance(PySwigClientData *data, PyObject *swig_this) +SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) { #if (PY_VERSION_HEX >= 0x02020000) PyObject *inst = 0; @@ -2157,10 +2322,16 @@ SWIG_Python_NewShadowInstance(PySwigClientData *data, PyObject *swig_this) #endif } } else { +#if PY_VERSION_HEX >= 0x03000000 + inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None); + PyObject_SetAttr(inst, SWIG_This(), swig_this); + Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; +#else PyObject *dict = PyDict_New(); PyDict_SetItem(dict, SWIG_This(), swig_this); inst = PyInstance_NewRaw(data->newargs, dict); Py_DECREF(dict); +#endif } return inst; #else @@ -2223,9 +2394,9 @@ SWIG_Python_InitShadowInstance(PyObject *args) { if (!SWIG_Python_UnpackTuple(args,(char*)"swiginit", 2, 2, obj)) { return NULL; } else { - PySwigObject *sthis = SWIG_Python_GetSwigThis(obj[0]); + SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); if (sthis) { - PySwigObject_append((PyObject*) sthis, obj[1]); + SwigPyObject_append((PyObject*) sthis, obj[1]); } else { SWIG_Python_SetSwigThis(obj[0], obj[1]); } @@ -2241,8 +2412,8 @@ SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) { return SWIG_Py_Void(); } else { int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; - PyObject *robj = PySwigObject_New(ptr, type, own); - PySwigClientData *clientdata = type ? (PySwigClientData *)(type->clientdata) : 0; + PyObject *robj = SwigPyObject_New(ptr, type, own); + SwigPyClientData *clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0; if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); if (inst) { @@ -2258,7 +2429,7 @@ SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) { SWIGRUNTIMEINLINE PyObject * SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { - return ptr ? PySwigPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); + return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); } /* -----------------------------------------------------------------------------* @@ -2329,8 +2500,8 @@ SWIG_Python_DestroyModule(void *vptr) for (i =0; i < swig_module->size; ++i) { swig_type_info *ty = types[i]; if (ty->owndata) { - PySwigClientData *data = (PySwigClientData *) ty->clientdata; - if (data) PySwigClientData_Del(data); + SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; + if (data) SwigPyClientData_Del(data); } } Py_DECREF(SWIG_This()); @@ -2340,8 +2511,13 @@ SWIGRUNTIME void SWIG_Python_SetModule(swig_module_info *swig_module) { static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */ +#if PY_VERSION_HEX >= 0x03000000 + /* Add a dummy module object into sys.modules */ + PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION); +#else PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); +#endif PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); if (pointer && module) { PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); @@ -2361,7 +2537,7 @@ SWIGRUNTIME swig_type_info * SWIG_Python_TypeQuery(const char *type) { PyObject *cache = SWIG_Python_TypeCache(); - PyObject *key = PyString_FromString(type); + PyObject *key = SWIG_Python_str_FromChar(type); PyObject *obj = PyDict_GetItem(cache, key); swig_type_info *descriptor; if (obj) { @@ -2388,21 +2564,23 @@ SWIG_Python_TypeQuery(const char *type) SWIGRUNTIME int SWIG_Python_AddErrMesg(const char* mesg, int infront) -{ +{ if (PyErr_Occurred()) { PyObject *type = 0; PyObject *value = 0; PyObject *traceback = 0; PyErr_Fetch(&type, &value, &traceback); if (value) { + char *tmp; PyObject *old_str = PyObject_Str(value); Py_XINCREF(type); PyErr_Clear(); if (infront) { - PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str)); + PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str)); } else { - PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg); + PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); } + SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); } return 1; @@ -2425,9 +2603,9 @@ SWIG_Python_ArgFail(int argnum) } SWIGRUNTIMEINLINE const char * -PySwigObject_GetDesc(PyObject *self) +SwigPyObject_GetDesc(PyObject *self) { - PySwigObject *v = (PySwigObject *)self; + SwigPyObject *v = (SwigPyObject *)self; swig_type_info *ty = v ? v->ty : 0; return ty ? ty->str : (char*)""; } @@ -2437,10 +2615,10 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) { if (type) { #if defined(SWIG_COBJECT_TYPES) - if (obj && PySwigObject_Check(obj)) { - const char *otype = (const char *) PySwigObject_GetDesc(obj); + if (obj && SwigPyObject_Check(obj)) { + const char *otype = (const char *) SwigPyObject_GetDesc(obj); if (otype) { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'PySwigObject(%s)' is received", + PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received", type, otype); return; } @@ -2450,10 +2628,11 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) const char *otype = (obj ? obj->ob_type->tp_name : 0); if (otype) { PyObject *str = PyObject_Str(obj); - const char *cstr = str ? PyString_AsString(str) : 0; + const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0; if (cstr) { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", type, otype, cstr); + SWIG_Python_str_DelForPy3(cstr); } else { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); @@ -2475,10 +2654,12 @@ SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) void *result; if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { PyErr_Clear(); - if (flags & SWIG_POINTER_EXCEPTION) { +#if SWIG_POINTER_EXCEPTION + if (flags) { SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); SWIG_Python_ArgFail(argnum); } +#endif } return result; } @@ -2534,11 +2715,16 @@ static swig_module_info swig_module = {swig_types, 17, 0, 0, 0, 0}; /*----------------------------------------------- @(target):= vmaskmodule.so ------------------------------------------------*/ -#define SWIG_init initvmaskmodule +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_init PyInit_vmaskmodule +#else +# define SWIG_init initvmaskmodule + +#endif #define SWIG_name "vmaskmodule" -#define SWIGVERSION 0x010336 +#define SWIGVERSION 0x010340 #define SWIG_VERSION SWIGVERSION @@ -2550,28 +2736,28 @@ static swig_module_info swig_module = {swig_types, 17, 0, 0, 0, 0}; namespace swig { - class PyObject_ptr { + class SwigPtr_PyObject { protected: PyObject *_obj; public: - PyObject_ptr() :_obj(0) + SwigPtr_PyObject() :_obj(0) { } - PyObject_ptr(const PyObject_ptr& item) : _obj(item._obj) + SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj) { Py_XINCREF(_obj); } - PyObject_ptr(PyObject *obj, bool initial_ref = true) :_obj(obj) + SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj) { if (initial_ref) { Py_XINCREF(_obj); } } - PyObject_ptr & operator=(const PyObject_ptr& item) + SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) { Py_XINCREF(item._obj); Py_XDECREF(_obj); @@ -2579,7 +2765,7 @@ namespace swig { return *this; } - ~PyObject_ptr() + ~SwigPtr_PyObject() { Py_XDECREF(_obj); } @@ -2598,10 +2784,10 @@ namespace swig { namespace swig { - struct PyObject_var : PyObject_ptr { - PyObject_var(PyObject* obj = 0) : PyObject_ptr(obj, false) { } + struct SwigVar_PyObject : SwigPtr_PyObject { + SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { } - PyObject_var & operator = (PyObject* obj) + SwigVar_PyObject & operator = (PyObject* obj) { Py_XDECREF(_obj); _obj = obj; @@ -2619,43 +2805,43 @@ namespace swig { struct stop_iteration { }; - struct PySwigIterator { + struct SwigPyIterator { private: - PyObject_ptr _seq; + SwigPtr_PyObject _seq; protected: - PySwigIterator(PyObject *seq) : _seq(seq) + SwigPyIterator(PyObject *seq) : _seq(seq) { } public: - virtual ~PySwigIterator() {} + virtual ~SwigPyIterator() {} // Access iterator method, required by Python virtual PyObject *value() const = 0; // Forward iterator method, required by Python - virtual PySwigIterator *incr(size_t n = 1) = 0; + virtual SwigPyIterator *incr(size_t n = 1) = 0; // Backward iterator method, very common in C++, but not required in Python - virtual PySwigIterator *decr(size_t /*n*/ = 1) + virtual SwigPyIterator *decr(size_t /*n*/ = 1) { throw stop_iteration(); } // Random access iterator methods, but not required in Python - virtual ptrdiff_t distance(const PySwigIterator &/*x*/) const + virtual ptrdiff_t distance(const SwigPyIterator &/*x*/) const { throw std::invalid_argument("operation not supported"); } - virtual bool equal (const PySwigIterator &/*x*/) const + virtual bool equal (const SwigPyIterator &/*x*/) const { throw std::invalid_argument("operation not supported"); } // C++ common/needed methods - virtual PySwigIterator *copy() const = 0; + virtual SwigPyIterator *copy() const = 0; PyObject *next() { @@ -2666,6 +2852,12 @@ namespace swig { return obj; } + /* Make an alias for Python 3.x */ + PyObject *__next__() + { + return next(); + } + PyObject *previous() { SWIG_PYTHON_THREAD_BEGIN_BLOCK; // disable threads @@ -2675,42 +2867,42 @@ namespace swig { return obj; } - PySwigIterator *advance(ptrdiff_t n) + SwigPyIterator *advance(ptrdiff_t n) { return (n > 0) ? incr(n) : decr(-n); } - bool operator == (const PySwigIterator& x) const + bool operator == (const SwigPyIterator& x) const { return equal(x); } - bool operator != (const PySwigIterator& x) const + bool operator != (const SwigPyIterator& x) const { return ! operator==(x); } - PySwigIterator& operator += (ptrdiff_t n) + SwigPyIterator& operator += (ptrdiff_t n) { return *advance(n); } - PySwigIterator& operator -= (ptrdiff_t n) + SwigPyIterator& operator -= (ptrdiff_t n) { return *advance(-n); } - PySwigIterator* operator + (ptrdiff_t n) const + SwigPyIterator* operator + (ptrdiff_t n) const { return copy()->advance(n); } - PySwigIterator* operator - (ptrdiff_t n) const + SwigPyIterator* operator - (ptrdiff_t n) const { return copy()->advance(-n); } - ptrdiff_t operator - (const PySwigIterator& x) const + ptrdiff_t operator - (const SwigPyIterator& x) const { return x.distance(*this); } @@ -2719,7 +2911,7 @@ namespace swig { static int init = 0; static swig_type_info* desc = 0; if (!init) { - desc = SWIG_TypeQuery("swig::PySwigIterator *"); + desc = SWIG_TypeQuery("swig::SwigPyIterator *"); init = 1; } return desc; @@ -2843,7 +3035,7 @@ namespace swig { struct traits_asptr { static int asptr(PyObject *obj, Type **val) { Type *p; - int res = (SWIG_ConvertPtr(obj, (void**)&p, type_info(), 0) == SWIG_OK) ? SWIG_OLDOBJ : 0; + int res = SWIG_ConvertPtr(obj, (void**)&p, type_info(), 0); if (SWIG_IsOK(res)) { if (val) *val = p; } @@ -2998,27 +3190,38 @@ namespace std { { bool res; SWIG_PYTHON_THREAD_BEGIN_BLOCK; - res = PyObject_Compare(v, w) < 0; + res = PyObject_RichCompareBool(v, w, Py_LT) ? true : false; + /* This may fall into a case of inconsistent + eg. ObjA > ObjX > ObjB + but ObjA < ObjB + */ + if( PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_TypeError) ) + { + /* Objects can't be compared, this mostly occurred in Python 3.0 */ + /* Compare their ptr directly for a workaround */ + res = (v < w); + PyErr_Clear(); + } SWIG_PYTHON_THREAD_END_BLOCK; return res; } }; template <> - struct less : public binary_function + struct less : public binary_function { bool - operator()(const swig::PyObject_ptr& v, const swig::PyObject_ptr& w) const + operator()(const swig::SwigPtr_PyObject& v, const swig::SwigPtr_PyObject& w) const { return std::less()(v, w); } }; template <> - struct less : public binary_function + struct less : public binary_function { bool - operator()(const swig::PyObject_var& v, const swig::PyObject_var& w) const + operator()(const swig::SwigVar_PyObject& v, const swig::SwigVar_PyObject& w) const { return std::less()(v, w); } @@ -3204,15 +3407,15 @@ namespace std { namespace swig { template - class PySwigIterator_T : public PySwigIterator + class SwigPyIterator_T : public SwigPyIterator { public: typedef OutIterator out_iterator; typedef typename std::iterator_traits::value_type value_type; - typedef PySwigIterator_T self_type; + typedef SwigPyIterator_T self_type; - PySwigIterator_T(out_iterator curr, PyObject *seq) - : PySwigIterator(seq), current(curr) + SwigPyIterator_T(out_iterator curr, PyObject *seq) + : SwigPyIterator(seq), current(curr) { } @@ -3222,7 +3425,7 @@ namespace swig { } - bool equal (const PySwigIterator &iter) const + bool equal (const SwigPyIterator &iter) const { const self_type *iters = dynamic_cast(&iter); if (iters) { @@ -3232,7 +3435,7 @@ namespace swig { } } - ptrdiff_t distance(const PySwigIterator &iter) const + ptrdiff_t distance(const SwigPyIterator &iter) const { const self_type *iters = dynamic_cast(&iter); if (iters) { @@ -3260,17 +3463,17 @@ namespace swig { template::value_type, typename FromOper = from_oper > - class PySwigIteratorOpen_T : public PySwigIterator_T + class SwigPyIteratorOpen_T : public SwigPyIterator_T { public: FromOper from; typedef OutIterator out_iterator; typedef ValueType value_type; - typedef PySwigIterator_T base; - typedef PySwigIteratorOpen_T self_type; + typedef SwigPyIterator_T base; + typedef SwigPyIteratorOpen_T self_type; - PySwigIteratorOpen_T(out_iterator curr, PyObject *seq) - : PySwigIterator_T(curr, seq) + SwigPyIteratorOpen_T(out_iterator curr, PyObject *seq) + : SwigPyIterator_T(curr, seq) { } @@ -3278,12 +3481,12 @@ namespace swig { return from(static_cast(*(base::current))); } - PySwigIterator *copy() const + SwigPyIterator *copy() const { return new self_type(*this); } - PySwigIterator *incr(size_t n = 1) + SwigPyIterator *incr(size_t n = 1) { while (n--) { ++base::current; @@ -3291,7 +3494,7 @@ namespace swig { return this; } - PySwigIterator *decr(size_t n = 1) + SwigPyIterator *decr(size_t n = 1) { while (n--) { --base::current; @@ -3303,17 +3506,17 @@ namespace swig { template::value_type, typename FromOper = from_oper > - class PySwigIteratorClosed_T : public PySwigIterator_T + class SwigPyIteratorClosed_T : public SwigPyIterator_T { public: FromOper from; typedef OutIterator out_iterator; typedef ValueType value_type; - typedef PySwigIterator_T base; - typedef PySwigIteratorClosed_T self_type; + typedef SwigPyIterator_T base; + typedef SwigPyIteratorClosed_T self_type; - PySwigIteratorClosed_T(out_iterator curr, out_iterator first, out_iterator last, PyObject *seq) - : PySwigIterator_T(curr, seq), begin(first), end(last) + SwigPyIteratorClosed_T(out_iterator curr, out_iterator first, out_iterator last, PyObject *seq) + : SwigPyIterator_T(curr, seq), begin(first), end(last) { } @@ -3325,12 +3528,12 @@ namespace swig { } } - PySwigIterator *copy() const + SwigPyIterator *copy() const { return new self_type(*this); } - PySwigIterator *incr(size_t n = 1) + SwigPyIterator *incr(size_t n = 1) { while (n--) { if (base::current == end) { @@ -3342,7 +3545,7 @@ namespace swig { return this; } - PySwigIterator *decr(size_t n = 1) + SwigPyIterator *decr(size_t n = 1) { while (n--) { if (base::current == begin) { @@ -3360,17 +3563,17 @@ namespace swig { }; template - inline PySwigIterator* + inline SwigPyIterator* make_output_iterator(const OutIter& current, const OutIter& begin,const OutIter& end, PyObject *seq = 0) { - return new PySwigIteratorClosed_T(current, begin, end, seq); + return new SwigPyIteratorClosed_T(current, begin, end, seq); } template - inline PySwigIterator* + inline SwigPyIterator* make_output_iterator(const OutIter& current, PyObject *seq = 0) { - return new PySwigIteratorOpen_T(current, seq); + return new SwigPyIteratorOpen_T(current, seq); } } @@ -3378,16 +3581,16 @@ namespace swig { namespace swig { template - struct PySequence_Ref + struct SwigPySequence_Ref { - PySequence_Ref(PyObject* seq, int index) + SwigPySequence_Ref(PyObject* seq, int index) : _seq(seq), _index(index) { } operator T () const { - swig::PyObject_var item = PySequence_GetItem(_seq, _index); + swig::SwigVar_PyObject item = PySequence_GetItem(_seq, _index); try { return swig::as(item, true); } catch (std::exception& e) { @@ -3402,7 +3605,7 @@ namespace swig } } - PySequence_Ref& operator=(const T& v) + SwigPySequence_Ref& operator=(const T& v) { PySequence_SetItem(_seq, _index, swig::from(v)); return *this; @@ -3414,18 +3617,18 @@ namespace swig }; template - struct PySequence_ArrowProxy + struct SwigPySequence_ArrowProxy { - PySequence_ArrowProxy(const T& x): m_value(x) {} + SwigPySequence_ArrowProxy(const T& x): m_value(x) {} const T* operator->() const { return &m_value; } operator const T*() const { return &m_value; } T m_value; }; template - struct PySequence_InputIterator + struct SwigPySequence_InputIterator { - typedef PySequence_InputIterator self; + typedef SwigPySequence_InputIterator self; typedef std::random_access_iterator_tag iterator_category; typedef Reference reference; @@ -3433,11 +3636,11 @@ namespace swig typedef T* pointer; typedef int difference_type; - PySequence_InputIterator() + SwigPySequence_InputIterator() { } - PySequence_InputIterator(PyObject* seq, int index) + SwigPySequence_InputIterator(PyObject* seq, int index) : _seq(seq), _index(index) { } @@ -3447,9 +3650,9 @@ namespace swig return reference(_seq, _index); } - PySequence_ArrowProxy + SwigPySequence_ArrowProxy operator->() const { - return PySequence_ArrowProxy(operator*()); + return SwigPySequence_ArrowProxy(operator*()); } bool operator==(const self& ri) const @@ -3518,19 +3721,19 @@ namespace swig }; template - struct PySequence_Cont + struct SwigPySequence_Cont { - typedef PySequence_Ref reference; - typedef const PySequence_Ref const_reference; + typedef SwigPySequence_Ref reference; + typedef const SwigPySequence_Ref const_reference; typedef T value_type; typedef T* pointer; typedef int difference_type; typedef int size_type; typedef const pointer const_pointer; - typedef PySequence_InputIterator iterator; - typedef PySequence_InputIterator const_iterator; + typedef SwigPySequence_InputIterator iterator; + typedef SwigPySequence_InputIterator const_iterator; - PySequence_Cont(PyObject* seq) : _seq(0) + SwigPySequence_Cont(PyObject* seq) : _seq(0) { if (!PySequence_Check(seq)) { throw std::invalid_argument("a sequence is expected"); @@ -3539,7 +3742,7 @@ namespace swig Py_INCREF(_seq); } - ~PySequence_Cont() + ~SwigPySequence_Cont() { Py_XDECREF(_seq); } @@ -3588,7 +3791,7 @@ namespace swig { int s = size(); for (int i = 0; i < s; ++i) { - swig::PyObject_var item = PySequence_GetItem(_seq, i); + swig::SwigVar_PyObject item = PySequence_GetItem(_seq, i); if (!swig::check(item)) { if (set_err) { char msg[1024]; @@ -3640,7 +3843,11 @@ SWIG_FromCharPtrAndSize(const char* carray, size_t size) return pchar_descriptor ? SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void(); } else { +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_FromStringAndSize(carray, static_cast< int >(size)); +#else return PyString_FromStringAndSize(carray, static_cast< int >(size)); +#endif } } else { return SWIG_Py_Void(); @@ -3821,13 +4028,13 @@ namespace swig { namespace swig { - template + template inline void - assign(const PySeq& pyseq, Seq* seq) { - // seq->assign(pyseq.begin(), pyseq.end()); // not used as not always implemented - typedef typename PySeq::value_type value_type; - typename PySeq::const_iterator it = pyseq.begin(); - for (;it != pyseq.end(); ++it) { + assign(const SwigPySeq& swigpyseq, Seq* seq) { + // seq->assign(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented + typedef typename SwigPySeq::value_type value_type; + typename SwigPySeq::const_iterator it = swigpyseq.begin(); + for (;it != swigpyseq.end(); ++it) { seq->insert(seq->end(),(value_type)(*it)); } } @@ -3847,14 +4054,14 @@ namespace swig { } } else if (PySequence_Check(obj)) { try { - PySequence_Cont pyseq(obj); + SwigPySequence_Cont swigpyseq(obj); if (seq) { sequence *pseq = new sequence(); - assign(pyseq, pseq); + assign(swigpyseq, pseq); *seq = pseq; return SWIG_NEWOBJ; } else { - return pyseq.check() ? SWIG_OK : SWIG_ERROR; + return swigpyseq.check() ? SWIG_OK : SWIG_ERROR; } } catch (std::exception& e) { if (seq) { @@ -3931,10 +4138,28 @@ namespace swig { SWIGINTERN int SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) { - if (PyString_Check(obj)) { +#if PY_VERSION_HEX>=0x03000000 + if (PyUnicode_Check(obj)) +#else + if (PyString_Check(obj)) +#endif + { char *cstr; Py_ssize_t len; +#if PY_VERSION_HEX>=0x03000000 + if (!alloc && cptr) { + /* We can't allow converting without allocation, since the internal + representation of string in Python 3 is UCS-2/UCS-4 but we require + a UTF-8 representation. + TODO(bhy) More detailed explanation */ + return SWIG_RuntimeError; + } + obj = PyUnicode_AsUTF8String(obj); + PyBytes_AsStringAndSize(obj, &cstr, &len); + if(alloc) *alloc = SWIG_NEWOBJ; +#else PyString_AsStringAndSize(obj, &cstr, &len); - if (cptr) { +#endif + if (cptr) { if (alloc) { /* In python the user should not be able to modify the inner @@ -3959,10 +4184,16 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) *alloc = SWIG_OLDOBJ; } } else { - *cptr = PyString_AsString(obj); + #if PY_VERSION_HEX>=0x03000000 + assert(0); /* Should never reach here in Python 3 */ + #endif + *cptr = SWIG_Python_str_AsChar(obj); } } if (psize) *psize = len + 1; +#if PY_VERSION_HEX>=0x03000000 + Py_XDECREF(obj); +#endif return SWIG_OK; } else { swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); @@ -4113,10 +4344,7 @@ SWIGINTERN PyObject *_wrap_VMask___assign__(PyObject *SWIGUNUSEDPARM(self), PyOb SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VMask___assign__" "', argument " "2"" of type '" "vips::VMask const &""'"); } arg2 = reinterpret_cast< vips::VMask * >(argp2); - { - vips::VMask &_result_ref = (arg1)->operator =((vips::VMask const &)*arg2); - result = (vips::VMask *) &_result_ref; - } + result = (vips::VMask *) &(arg1)->operator =((vips::VMask const &)*arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_vips__VMask, 0 | 0 ); return resultobj; fail: @@ -4370,10 +4598,7 @@ SWIGINTERN PyObject *_wrap___lshift____SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "__lshift__" "', argument " "2"" of type '" "vips::VMask const &""'"); } arg2 = reinterpret_cast< vips::VMask * >(argp2); - { - std::ostream &_result_ref = vips::operator <<(*arg1,(vips::VMask const &)*arg2); - result = (std::ostream *) &_result_ref; - } + result = (std::ostream *) &vips::operator <<(*arg1,(vips::VMask const &)*arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__ostream, 0 | 0 ); return resultobj; fail: @@ -4725,10 +4950,7 @@ SWIGINTERN PyObject *_wrap_VIMask___index__(PyObject *SWIGUNUSEDPARM(self), PyOb } arg2 = static_cast< int >(val2); try { - { - int &_result_ref = (arg1)->operator [](arg2); - result = (int *) &_result_ref; - } + result = (int *) &(arg1)->operator [](arg2); } catch(vips::VError &_e) { SWIG_Python_Raise(SWIG_NewPointerObj((new vips::VError(static_cast< const vips::VError& >(_e))),SWIGTYPE_p_vips__VError,SWIG_POINTER_OWN), "vips::VError", SWIGTYPE_p_vips__VError); SWIG_fail; @@ -4774,10 +4996,7 @@ SWIGINTERN PyObject *_wrap_VIMask___call__(PyObject *SWIGUNUSEDPARM(self), PyObj } arg3 = static_cast< int >(val3); try { - { - int &_result_ref = (arg1)->operator ()(arg2,arg3); - result = (int *) &_result_ref; - } + result = (int *) &(arg1)->operator ()(arg2,arg3); } catch(vips::VError &_e) { SWIG_Python_Raise(SWIG_NewPointerObj((new vips::VError(static_cast< const vips::VError& >(_e))),SWIGTYPE_p_vips__VError,SWIG_POINTER_OWN), "vips::VError", SWIGTYPE_p_vips__VError); SWIG_fail; @@ -5494,10 +5713,7 @@ SWIGINTERN PyObject *_wrap_VDMask___index__(PyObject *SWIGUNUSEDPARM(self), PyOb } arg2 = static_cast< int >(val2); try { - { - double &_result_ref = (arg1)->operator [](arg2); - result = (double *) &_result_ref; - } + result = (double *) &(arg1)->operator [](arg2); } catch(vips::VError &_e) { SWIG_Python_Raise(SWIG_NewPointerObj((new vips::VError(static_cast< const vips::VError& >(_e))),SWIGTYPE_p_vips__VError,SWIG_POINTER_OWN), "vips::VError", SWIGTYPE_p_vips__VError); SWIG_fail; @@ -5543,10 +5759,7 @@ SWIGINTERN PyObject *_wrap_VDMask___call__(PyObject *SWIGUNUSEDPARM(self), PyObj } arg3 = static_cast< int >(val3); try { - { - double &_result_ref = (arg1)->operator ()(arg2,arg3); - result = (double *) &_result_ref; - } + result = (double *) &(arg1)->operator ()(arg2,arg3); } catch(vips::VError &_e) { SWIG_Python_Raise(SWIG_NewPointerObj((new vips::VError(static_cast< const vips::VError& >(_e))),SWIGTYPE_p_vips__VError,SWIG_POINTER_OWN), "vips::VError", SWIGTYPE_p_vips__VError); SWIG_fail; @@ -5929,6 +6142,7 @@ SWIGINTERN PyObject *VDMask_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObjec } static PyMethodDef SwigMethods[] = { + { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL}, { (char *)"new_VMask", _wrap_new_VMask, METH_VARARGS, NULL}, { (char *)"VMask___assign__", _wrap_VMask___assign__, METH_VARARGS, NULL}, { (char *)"delete_VMask", _wrap_delete_VMask, METH_VARARGS, NULL}, @@ -6340,26 +6554,58 @@ extern "C" { SWIGINTERN PyObject * swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) { +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_InternFromString(""); +#else return PyString_FromString(""); +#endif } SWIGINTERN PyObject * swig_varlink_str(swig_varlinkobject *v) { +#if PY_VERSION_HEX >= 0x03000000 + PyObject *str = PyUnicode_InternFromString("("); + PyObject *tail; + PyObject *joined; + swig_globalvar *var; + for (var = v->vars; var; var=var->next) { + tail = PyUnicode_FromString(var->name); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; + if (var->next) { + tail = PyUnicode_InternFromString(", "); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; + } + } + tail = PyUnicode_InternFromString(")"); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; +#else PyObject *str = PyString_FromString("("); - swig_globalvar *var; + swig_globalvar *var; for (var = v->vars; var; var=var->next) { PyString_ConcatAndDel(&str,PyString_FromString(var->name)); if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", ")); } PyString_ConcatAndDel(&str,PyString_FromString(")")); +#endif return str; } SWIGINTERN int swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { + char *tmp; PyObject *str = swig_varlink_str(v); fprintf(fp,"Swig global variables "); - fprintf(fp,"%s\n", PyString_AsString(str)); + fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str)); + SWIG_Python_str_DelForPy3(tmp); Py_DECREF(str); return 0; } @@ -6417,12 +6663,17 @@ extern "C" { if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else PyObject_HEAD_INIT(NULL) 0, /* Number of items in variable part (ob_size) */ +#endif (char *)"swigvarlink", /* Type name (tp_name) */ sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */ 0, /* Itemsize (tp_itemsize) */ - (destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */ + (destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */ (printfunc) swig_varlink_print, /* Print (tp_print) */ (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */ (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */ @@ -6433,7 +6684,7 @@ extern "C" { 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ - (reprfunc)swig_varlink_str, /* tp_str */ + (reprfunc) swig_varlink_str, /* tp_str */ 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -6454,7 +6705,10 @@ extern "C" { #endif }; varlink_type = tmp; + /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 varlink_type.ob_type = &PyType_Type; +#endif type_init = 1; } return &varlink_type; @@ -6579,18 +6833,47 @@ extern "C" { #ifdef __cplusplus extern "C" #endif -SWIGEXPORT void SWIG_init(void) { - PyObject *m, *d; + +SWIGEXPORT +#if PY_VERSION_HEX >= 0x03000000 +PyObject* +#else +void +#endif +SWIG_init(void) { + PyObject *m, *d; +#if PY_VERSION_HEX >= 0x03000000 + static struct PyModuleDef SWIG_module = { + PyModuleDef_HEAD_INIT, + (char *) SWIG_name, + NULL, + -1, + SwigMethods, + NULL, + NULL, + NULL, + NULL + }; +#endif /* Fix SwigMethods to carry the callback ptrs when needed */ SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); +#if PY_VERSION_HEX >= 0x03000000 + m = PyModule_Create(&SWIG_module); +#else m = Py_InitModule((char *) SWIG_name, SwigMethods); +#endif d = PyModule_GetDict(m); SWIG_InitializeModule(0); SWIG_InstallConstants(d,swig_const_table); +#if PY_VERSION_HEX >= 0x03000000 + return m; +#else + return; +#endif }