12
12
#define SWIG_PYTHON_DIRECTOR_NO_VTABLE
16
/* SwigValueWrapper is described in swig.swg */
15
17
template<typename T> class SwigValueWrapper {
18
struct SwigMovePointer {
20
SwigMovePointer(T *p) : ptr(p) { }
21
~SwigMovePointer() { delete ptr; }
22
SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
24
SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
25
SwigValueWrapper(const SwigValueWrapper<T>& rhs);
18
SwigValueWrapper() : tt(0) { }
19
SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
20
SwigValueWrapper(const T& t) : tt(new T(t)) { }
21
~SwigValueWrapper() { delete tt; }
22
SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
23
operator T&() const { return *tt; }
24
T *operator&() { return tt; }
26
SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
27
SwigValueWrapper() : pointer(0) { }
28
SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
29
operator T&() const { return *pointer.ptr; }
30
T *operator&() { return pointer.ptr; }
29
33
template <typename T> T SwigValueInit() {
168
172
You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
169
creating a static or dynamic library from the swig runtime code.
170
In 99.9% of the cases, swig just needs to declare them as 'static'.
173
creating a static or dynamic library from the SWIG runtime code.
174
In 99.9% of the cases, SWIG just needs to declare them as 'static'.
172
But only do this if is strictly necessary, ie, if you have problems
173
with your compiler or so.
176
But only do this if strictly necessary, ie, if you have problems
177
with your compiler or suchlike.
176
180
#ifndef SWIGRUNTIME
198
202
Flags/methods for returning states.
200
The swig conversion methods, as ConvertPtr, return and integer
204
The SWIG conversion methods, as ConvertPtr, return an integer
201
205
that tells if the conversion was successful or not. And if not,
202
206
an error code can be returned (see swigerrors.swg for the codes).
204
208
Use the following macros/flags to set or process the returning
207
In old swig versions, you usually write code as:
211
In old versions of SWIG, code such as the following was usually written:
209
213
if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
422
/* think of this as a c++ template<> or a scheme macro */
423
#define SWIG_TypeCheck_Template(comparison, ty) \
425
swig_cast_info *iter = ty->cast; \
428
if (iter == ty->cast) return iter; \
429
/* Move iter to the top of the linked list */ \
430
iter->prev->next = iter->next; \
432
iter->next->prev = iter->prev; \
433
iter->next = ty->cast; \
435
if (ty->cast) ty->cast->prev = iter; \
445
423
Check the typename
447
425
SWIGRUNTIME swig_cast_info *
448
426
SWIG_TypeCheck(const char *c, swig_type_info *ty) {
449
SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
428
swig_cast_info *iter = ty->cast;
430
if (strcmp(iter->type->name, c) == 0) {
431
if (iter == ty->cast)
433
/* Move iter to the top of the linked list */
434
iter->prev->next = iter->next;
436
iter->next->prev = iter->prev;
437
iter->next = ty->cast;
439
if (ty->cast) ty->cast->prev = iter;
452
/* Same as previous function, except strcmp is replaced with a pointer comparison */
450
Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
453
452
SWIGRUNTIME swig_cast_info *
454
SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
455
SWIG_TypeCheck_Template(iter->type == from, into);
453
SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
455
swig_cast_info *iter = ty->cast;
457
if (iter->type == from) {
458
if (iter == ty->cast)
460
/* Move iter to the top of the linked list */
461
iter->prev->next = iter->next;
463
iter->next->prev = iter->prev;
464
iter->next = ty->cast;
466
if (ty->cast) ty->cast->prev = iter;
752
/* Compatibility macros for Python 3 */
753
#if PY_VERSION_HEX >= 0x03000000
755
#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
756
#define PyInt_Check(x) PyLong_Check(x)
757
#define PyInt_AsLong(x) PyLong_AsLong(x)
758
#define PyInt_FromLong(x) PyLong_FromLong(x)
759
#define PyString_Format(fmt, args) PyUnicode_Format(fmt, args)
764
# define Py_TYPE(op) ((op)->ob_type)
767
/* SWIG APIs for compatibility of both Python 2 & 3 */
769
#if PY_VERSION_HEX >= 0x03000000
770
# define SWIG_Python_str_FromFormat PyUnicode_FromFormat
772
# define SWIG_Python_str_FromFormat PyString_FromFormat
776
/* Warning: This function will allocate a new string in Python 3,
777
* so please call SWIG_Python_str_DelForPy3(x) to free the space.
780
SWIG_Python_str_AsChar(PyObject *str)
782
#if PY_VERSION_HEX >= 0x03000000
786
str = PyUnicode_AsUTF8String(str);
787
PyBytes_AsStringAndSize(str, &cstr, &len);
788
newstr = (char *) malloc(len+1);
789
memcpy(newstr, cstr, len+1);
793
return PyString_AsString(str);
797
#if PY_VERSION_HEX >= 0x03000000
798
# define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
800
# define SWIG_Python_str_DelForPy3(x)
805
SWIG_Python_str_FromChar(const char *c)
807
#if PY_VERSION_HEX >= 0x03000000
808
return PyUnicode_FromString(c);
810
return PyString_FromString(c);
735
814
/* Add PyOS_snprintf for old Pythons */
736
815
#if PY_VERSION_HEX < 0x02020000
1039
1129
#define SWIG_GetModule(clientdata) SWIG_Python_GetModule()
1040
1130
#define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer)
1041
#define SWIG_NewClientData(obj) PySwigClientData_New(obj)
1131
#define SWIG_NewClientData(obj) SwigPyClientData_New(obj)
1043
1133
#define SWIG_SetErrorObj SWIG_Python_SetErrorObj
1044
1134
#define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg
1045
1135
#define SWIG_ErrorType(code) SWIG_Python_ErrorType(code)
1046
1136
#define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg)
1047
#define SWIG_fail goto fail
1137
#define SWIG_fail goto fail
1140
* Python 2.7 and newer and Python 3.1 and newer should use Capsules API instead of
1143
#if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \
1144
(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0))
1145
#define USE_CAPSULES
1146
#define TYPE_POINTER_NAME \
1147
((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
1050
1150
/* Runtime API implementation */
1243
1343
PyObject *destroy;
1245
1345
int implicitconv;
1248
1348
SWIGRUNTIMEINLINE int
1249
1349
SWIG_Python_CheckImplicit(swig_type_info *ty)
1251
PySwigClientData *data = (PySwigClientData *)ty->clientdata;
1351
SwigPyClientData *data = (SwigPyClientData *)ty->clientdata;
1252
1352
return data ? data->implicitconv : 0;
1255
1355
SWIGRUNTIMEINLINE PyObject *
1256
1356
SWIG_Python_ExceptionType(swig_type_info *desc) {
1257
PySwigClientData *data = desc ? (PySwigClientData *) desc->clientdata : 0;
1357
SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0;
1258
1358
PyObject *klass = data ? data->klass : 0;
1259
1359
return (klass ? klass : PyExc_RuntimeError);
1263
SWIGRUNTIME PySwigClientData *
1264
PySwigClientData_New(PyObject* obj)
1363
SWIGRUNTIME SwigPyClientData *
1364
SwigPyClientData_New(PyObject* obj)
1269
PySwigClientData *data = (PySwigClientData *)malloc(sizeof(PySwigClientData));
1369
SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData));
1270
1370
/* the klass element */
1271
1371
data->klass = obj;
1272
1372
Py_INCREF(data->klass);
1329
1429
swig_type_info *ty;
1331
1431
PyObject *next;
1334
1434
SWIGRUNTIME PyObject *
1335
PySwigObject_long(PySwigObject *v)
1435
SwigPyObject_long(SwigPyObject *v)
1337
1437
return PyLong_FromVoidPtr(v->ptr);
1340
1440
SWIGRUNTIME PyObject *
1341
PySwigObject_format(const char* fmt, PySwigObject *v)
1441
SwigPyObject_format(const char* fmt, SwigPyObject *v)
1343
1443
PyObject *res = NULL;
1344
1444
PyObject *args = PyTuple_New(1);
1346
if (PyTuple_SetItem(args, 0, PySwigObject_long(v)) == 0) {
1347
PyObject *ofmt = PyString_FromString(fmt);
1446
if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) {
1447
PyObject *ofmt = SWIG_Python_str_FromChar(fmt);
1449
#if PY_VERSION_HEX >= 0x03000000
1450
res = PyUnicode_Format(ofmt,args);
1349
1452
res = PyString_Format(ofmt,args);
1350
1454
Py_DECREF(ofmt);
1352
1456
Py_DECREF(args);
1358
1462
SWIGRUNTIME PyObject *
1359
PySwigObject_oct(PySwigObject *v)
1463
SwigPyObject_oct(SwigPyObject *v)
1361
return PySwigObject_format("%o",v);
1465
return SwigPyObject_format("%o",v);
1364
1468
SWIGRUNTIME PyObject *
1365
PySwigObject_hex(PySwigObject *v)
1469
SwigPyObject_hex(SwigPyObject *v)
1367
return PySwigObject_format("%x",v);
1471
return SwigPyObject_format("%x",v);
1370
1474
SWIGRUNTIME PyObject *
1371
1475
#ifdef METH_NOARGS
1372
PySwigObject_repr(PySwigObject *v)
1476
SwigPyObject_repr(SwigPyObject *v)
1374
PySwigObject_repr(PySwigObject *v, PyObject *args)
1478
SwigPyObject_repr(SwigPyObject *v, PyObject *args)
1377
1481
const char *name = SWIG_TypePrettyName(v->ty);
1378
PyObject *hex = PySwigObject_hex(v);
1379
PyObject *repr = PyString_FromFormat("<Swig Object of type '%s' at 0x%s>", name, PyString_AsString(hex));
1482
PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", name, v);
1382
1484
#ifdef METH_NOARGS
1383
PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next);
1485
PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
1385
PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next, args);
1487
PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args);
1489
#if PY_VERSION_HEX >= 0x03000000
1490
PyObject *joined = PyUnicode_Concat(repr, nrep);
1387
1495
PyString_ConcatAndDel(&repr,nrep);
1392
1501
SWIGRUNTIME int
1393
PySwigObject_print(PySwigObject *v, FILE *fp, int SWIGUNUSEDPARM(flags))
1502
SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags))
1395
1505
#ifdef METH_NOARGS
1396
PyObject *repr = PySwigObject_repr(v);
1506
PyObject *repr = SwigPyObject_repr(v);
1398
PyObject *repr = PySwigObject_repr(v, NULL);
1508
PyObject *repr = SwigPyObject_repr(v, NULL);
1401
fputs(PyString_AsString(repr), fp);
1511
str = SWIG_Python_str_AsChar(repr);
1513
SWIG_Python_str_DelForPy3(str);
1402
1514
Py_DECREF(repr);
1409
1521
SWIGRUNTIME PyObject *
1410
PySwigObject_str(PySwigObject *v)
1522
SwigPyObject_str(SwigPyObject *v)
1412
1524
char result[SWIG_BUFFER_SIZE];
1413
1525
return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ?
1414
PyString_FromString(result) : 0;
1526
SWIG_Python_str_FromChar(result) : 0;
1417
1529
SWIGRUNTIME int
1418
PySwigObject_compare(PySwigObject *v, PySwigObject *w)
1530
SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
1420
1532
void *i = v->ptr;
1421
1533
void *j = w->ptr;
1422
1534
return (i < j) ? -1 : ((i > j) ? 1 : 0);
1537
/* Added for Python 3.x, would it also be useful for Python 2.x? */
1538
SWIGRUNTIME PyObject*
1539
SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
1542
if( op != Py_EQ && op != Py_NE ) {
1543
Py_INCREF(Py_NotImplemented);
1544
return Py_NotImplemented;
1546
if( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) )
1425
1555
SWIGRUNTIME PyTypeObject* _PySwigObject_type(void);
1427
1557
SWIGRUNTIME PyTypeObject*
1428
PySwigObject_type(void) {
1558
SwigPyObject_type(void) {
1429
1559
static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type();
1433
1563
SWIGRUNTIMEINLINE int
1434
PySwigObject_Check(PyObject *op) {
1435
return ((op)->ob_type == PySwigObject_type())
1436
|| (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0);
1564
SwigPyObject_Check(PyObject *op) {
1565
return (Py_TYPE(op) == SwigPyObject_type())
1566
|| (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
1439
1569
SWIGRUNTIME PyObject *
1440
PySwigObject_New(void *ptr, swig_type_info *ty, int own);
1570
SwigPyObject_New(void *ptr, swig_type_info *ty, int own);
1442
1572
SWIGRUNTIME void
1443
PySwigObject_dealloc(PyObject *v)
1573
SwigPyObject_dealloc(PyObject *v)
1445
PySwigObject *sobj = (PySwigObject *) v;
1575
SwigPyObject *sobj = (SwigPyObject *) v;
1446
1576
PyObject *next = sobj->next;
1447
1577
if (sobj->own == SWIG_POINTER_OWN) {
1448
1578
swig_type_info *ty = sobj->ty;
1449
PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;
1579
SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
1450
1580
PyObject *destroy = data ? data->destroy : 0;
1452
1582
/* destroy is always a VARARGS method */
1454
1584
if (data->delargs) {
1455
/* we need to create a temporal object to carry the destroy operation */
1456
PyObject *tmp = PySwigObject_New(sobj->ptr, ty, 0);
1585
/* we need to create a temporary object to carry the destroy operation */
1586
PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
1457
1587
res = SWIG_Python_CallFunctor(destroy, tmp);
1458
1588
Py_DECREF(tmp);
1510
1640
SWIGINTERN PyObject*
1511
1641
#ifdef METH_NOARGS
1512
PySwigObject_disown(PyObject *v)
1642
SwigPyObject_disown(PyObject *v)
1514
PySwigObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1644
SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1517
PySwigObject *sobj = (PySwigObject *)v;
1647
SwigPyObject *sobj = (SwigPyObject *)v;
1519
1649
return SWIG_Py_Void();
1522
1652
SWIGINTERN PyObject*
1523
1653
#ifdef METH_NOARGS
1524
PySwigObject_acquire(PyObject *v)
1654
SwigPyObject_acquire(PyObject *v)
1526
PySwigObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1656
SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1529
PySwigObject *sobj = (PySwigObject *)v;
1659
SwigPyObject *sobj = (SwigPyObject *)v;
1530
1660
sobj->own = SWIG_POINTER_OWN;
1531
1661
return SWIG_Py_Void();
1534
1664
SWIGINTERN PyObject*
1535
PySwigObject_own(PyObject *v, PyObject *args)
1665
SwigPyObject_own(PyObject *v, PyObject *args)
1537
1667
PyObject *val = 0;
1538
1668
#if (PY_VERSION_HEX < 0x02020000)
1570
1700
static PyMethodDef
1571
1701
swigobject_methods[] = {
1572
{(char *)"disown", (PyCFunction)PySwigObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"},
1573
{(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"},
1574
{(char *)"own", (PyCFunction)PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
1575
{(char *)"append", (PyCFunction)PySwigObject_append, METH_O, (char *)"appends another 'this' object"},
1576
{(char *)"next", (PyCFunction)PySwigObject_next, METH_NOARGS, (char *)"returns the next 'this' object"},
1577
{(char *)"__repr__",(PyCFunction)PySwigObject_repr, METH_NOARGS, (char *)"returns object representation"},
1702
{(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"},
1703
{(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"},
1704
{(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
1705
{(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"},
1706
{(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"},
1707
{(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"},
1581
1711
static PyMethodDef
1582
1712
swigobject_methods[] = {
1583
{(char *)"disown", (PyCFunction)PySwigObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"},
1584
{(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"},
1585
{(char *)"own", (PyCFunction)PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
1586
{(char *)"append", (PyCFunction)PySwigObject_append, METH_VARARGS, (char *)"appends another 'this' object"},
1587
{(char *)"next", (PyCFunction)PySwigObject_next, METH_VARARGS, (char *)"returns the next 'this' object"},
1588
{(char *)"__repr__",(PyCFunction)PySwigObject_repr, METH_VARARGS, (char *)"returns object representation"},
1713
{(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"},
1714
{(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"},
1715
{(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
1716
{(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"},
1717
{(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"},
1718
{(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"},
1593
1723
#if PY_VERSION_HEX < 0x02020000
1594
1724
SWIGINTERN PyObject *
1595
PySwigObject_getattr(PySwigObject *sobj,char *name)
1725
SwigPyObject_getattr(SwigPyObject *sobj,char *name)
1597
1727
return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name);
1602
1732
_PySwigObject_type(void) {
1603
1733
static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
1605
static PyNumberMethods PySwigObject_as_number = {
1735
static PyNumberMethods SwigPyObject_as_number = {
1606
1736
(binaryfunc)0, /*nb_add*/
1607
1737
(binaryfunc)0, /*nb_subtract*/
1608
1738
(binaryfunc)0, /*nb_multiply*/
1739
/* nb_divide removed in Python 3 */
1740
#if PY_VERSION_HEX < 0x03000000
1609
1741
(binaryfunc)0, /*nb_divide*/
1610
1743
(binaryfunc)0, /*nb_remainder*/
1611
1744
(binaryfunc)0, /*nb_divmod*/
1612
1745
(ternaryfunc)0,/*nb_power*/
1623
(coercion)0, /*nb_coerce*/
1624
(unaryfunc)PySwigObject_long, /*nb_int*/
1625
(unaryfunc)PySwigObject_long, /*nb_long*/
1756
#if PY_VERSION_HEX < 0x03000000
1759
(unaryfunc)SwigPyObject_long, /*nb_int*/
1760
#if PY_VERSION_HEX < 0x03000000
1761
(unaryfunc)SwigPyObject_long, /*nb_long*/
1626
1765
(unaryfunc)0, /*nb_float*/
1627
(unaryfunc)PySwigObject_oct, /*nb_oct*/
1628
(unaryfunc)PySwigObject_hex, /*nb_hex*/
1629
#if PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */
1766
#if PY_VERSION_HEX < 0x03000000
1767
(unaryfunc)SwigPyObject_oct, /*nb_oct*/
1768
(unaryfunc)SwigPyObject_hex, /*nb_hex*/
1770
#if PY_VERSION_HEX >= 0x03000000 /* 3.0 */
1771
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
1772
#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */
1630
1773
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
1631
1774
#elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */
1632
1775
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */
1638
static PyTypeObject pyswigobject_type;
1781
static PyTypeObject swigpyobject_type;
1639
1782
static int type_init = 0;
1640
1783
if (!type_init) {
1641
1784
const PyTypeObject tmp
1786
/* PyObject header changed in Python 3 */
1787
#if PY_VERSION_HEX >= 0x03000000
1788
PyVarObject_HEAD_INIT(&PyType_Type, 0)
1643
1790
PyObject_HEAD_INIT(NULL)
1644
1791
0, /* ob_size */
1645
(char *)"PySwigObject", /* tp_name */
1646
sizeof(PySwigObject), /* tp_basicsize */
1793
(char *)"SwigPyObject", /* tp_name */
1794
sizeof(SwigPyObject), /* tp_basicsize */
1647
1795
0, /* tp_itemsize */
1648
(destructor)PySwigObject_dealloc, /* tp_dealloc */
1649
(printfunc)PySwigObject_print, /* tp_print */
1796
(destructor)SwigPyObject_dealloc, /* tp_dealloc */
1797
(printfunc)SwigPyObject_print, /* tp_print */
1650
1798
#if PY_VERSION_HEX < 0x02020000
1651
(getattrfunc)PySwigObject_getattr, /* tp_getattr */
1799
(getattrfunc)SwigPyObject_getattr, /* tp_getattr */
1653
1801
(getattrfunc)0, /* tp_getattr */
1655
1803
(setattrfunc)0, /* tp_setattr */
1656
(cmpfunc)PySwigObject_compare, /* tp_compare */
1657
(reprfunc)PySwigObject_repr, /* tp_repr */
1658
&PySwigObject_as_number, /* tp_as_number */
1804
#if PY_VERSION_HEX >= 0x03000000
1805
0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
1807
(cmpfunc)SwigPyObject_compare, /* tp_compare */
1809
(reprfunc)SwigPyObject_repr, /* tp_repr */
1810
&SwigPyObject_as_number, /* tp_as_number */
1659
1811
0, /* tp_as_sequence */
1660
1812
0, /* tp_as_mapping */
1661
1813
(hashfunc)0, /* tp_hash */
1662
1814
(ternaryfunc)0, /* tp_call */
1663
(reprfunc)PySwigObject_str, /* tp_str */
1815
(reprfunc)SwigPyObject_str, /* tp_str */
1664
1816
PyObject_GenericGetAttr, /* tp_getattro */
1665
1817
0, /* tp_setattro */
1666
1818
0, /* tp_as_buffer */
1699
1851
0,0,0,0 /* tp_alloc -> tp_next */
1702
pyswigobject_type = tmp;
1703
pyswigobject_type.ob_type = &PyType_Type;
1854
swigpyobject_type = tmp;
1855
/* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */
1856
#if PY_VERSION_HEX < 0x03000000
1857
swigpyobject_type.ob_type = &PyType_Type;
1706
return &pyswigobject_type;
1861
return &swigpyobject_type;
1709
1864
SWIGRUNTIME PyObject *
1710
PySwigObject_New(void *ptr, swig_type_info *ty, int own)
1865
SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
1712
PySwigObject *sobj = PyObject_NEW(PySwigObject, PySwigObject_type());
1867
SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type());
1714
1869
sobj->ptr = ptr;
1747
1902
SWIGRUNTIME PyObject *
1748
PySwigPacked_repr(PySwigPacked *v)
1903
SwigPyPacked_repr(SwigPyPacked *v)
1750
1905
char result[SWIG_BUFFER_SIZE];
1751
1906
if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
1752
return PyString_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
1907
return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
1754
return PyString_FromFormat("<Swig Packed %s>", v->ty->name);
1909
return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
1758
1913
SWIGRUNTIME PyObject *
1759
PySwigPacked_str(PySwigPacked *v)
1914
SwigPyPacked_str(SwigPyPacked *v)
1761
1916
char result[SWIG_BUFFER_SIZE];
1762
1917
if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
1763
return PyString_FromFormat("%s%s", result, v->ty->name);
1918
return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name);
1765
return PyString_FromString(v->ty->name);
1920
return SWIG_Python_str_FromChar(v->ty->name);
1769
1924
SWIGRUNTIME int
1770
PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w)
1925
SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
1772
1927
size_t i = v->size;
1773
1928
size_t j = w->size;
1778
1933
SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void);
1780
1935
SWIGRUNTIME PyTypeObject*
1781
PySwigPacked_type(void) {
1936
SwigPyPacked_type(void) {
1782
1937
static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigPacked_type();
1786
1941
SWIGRUNTIMEINLINE int
1787
PySwigPacked_Check(PyObject *op) {
1942
SwigPyPacked_Check(PyObject *op) {
1788
1943
return ((op)->ob_type == _PySwigPacked_type())
1789
|| (strcmp((op)->ob_type->tp_name,"PySwigPacked") == 0);
1944
|| (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
1792
1947
SWIGRUNTIME void
1793
PySwigPacked_dealloc(PyObject *v)
1948
SwigPyPacked_dealloc(PyObject *v)
1795
if (PySwigPacked_Check(v)) {
1796
PySwigPacked *sobj = (PySwigPacked *) v;
1950
if (SwigPyPacked_Check(v)) {
1951
SwigPyPacked *sobj = (SwigPyPacked *) v;
1797
1952
free(sobj->pack);
1799
1954
PyObject_DEL(v);
1802
1957
SWIGRUNTIME PyTypeObject*
1803
1958
_PySwigPacked_type(void) {
1804
1959
static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
1805
static PyTypeObject pyswigpacked_type;
1960
static PyTypeObject swigpypacked_type;
1806
1961
static int type_init = 0;
1807
1962
if (!type_init) {
1808
1963
const PyTypeObject tmp
1965
/* PyObject header changed in Python 3 */
1966
#if PY_VERSION_HEX>=0x03000000
1967
PyVarObject_HEAD_INIT(&PyType_Type, 0)
1810
1969
PyObject_HEAD_INIT(NULL)
1812
(char *)"PySwigPacked", /* tp_name */
1813
sizeof(PySwigPacked), /* tp_basicsize */
1972
(char *)"SwigPyPacked", /* tp_name */
1973
sizeof(SwigPyPacked), /* tp_basicsize */
1814
1974
0, /* tp_itemsize */
1815
(destructor)PySwigPacked_dealloc, /* tp_dealloc */
1816
(printfunc)PySwigPacked_print, /* tp_print */
1975
(destructor)SwigPyPacked_dealloc, /* tp_dealloc */
1976
(printfunc)SwigPyPacked_print, /* tp_print */
1817
1977
(getattrfunc)0, /* tp_getattr */
1818
1978
(setattrfunc)0, /* tp_setattr */
1819
(cmpfunc)PySwigPacked_compare, /* tp_compare */
1820
(reprfunc)PySwigPacked_repr, /* tp_repr */
1821
0, /* tp_as_number */
1979
#if PY_VERSION_HEX>=0x03000000
1980
0, /* tp_reserved in 3.0.1 */
1982
(cmpfunc)SwigPyPacked_compare, /* tp_compare */
1984
(reprfunc)SwigPyPacked_repr, /* tp_repr */
1985
0, /* tp_as_number */
1822
1986
0, /* tp_as_sequence */
1823
0, /* tp_as_mapping */
1824
(hashfunc)0, /* tp_hash */
1825
(ternaryfunc)0, /* tp_call */
1826
(reprfunc)PySwigPacked_str, /* tp_str */
1987
0, /* tp_as_mapping */
1988
(hashfunc)0, /* tp_hash */
1989
(ternaryfunc)0, /* tp_call */
1990
(reprfunc)SwigPyPacked_str, /* tp_str */
1827
1991
PyObject_GenericGetAttr, /* tp_getattro */
1828
1992
0, /* tp_setattro */
1829
1993
0, /* tp_as_buffer */
1862
2026
0,0,0,0 /* tp_alloc -> tp_next */
1865
pyswigpacked_type = tmp;
1866
pyswigpacked_type.ob_type = &PyType_Type;
2029
swigpypacked_type = tmp;
2030
/* for Python 3 the ob_type already assigned in PyVarObject_HEAD_INIT() */
2031
#if PY_VERSION_HEX < 0x03000000
2032
swigpypacked_type.ob_type = &PyType_Type;
1869
return &pyswigpacked_type;
2036
return &swigpypacked_type;
1872
2039
SWIGRUNTIME PyObject *
1873
PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty)
2040
SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
1875
PySwigPacked *sobj = PyObject_NEW(PySwigPacked, PySwigPacked_type());
2042
SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type());
1877
2044
void *pack = malloc(size);
1908
2075
SWIGRUNTIMEINLINE PyObject *
1909
2076
_SWIG_This(void)
1911
return PyString_FromString("this");
2078
return SWIG_Python_str_FromChar("this");
2081
static PyObject *swig_this = NULL;
1914
2083
SWIGRUNTIME PyObject *
1915
2084
SWIG_This(void)
1917
static PyObject *SWIG_STATIC_POINTER(swig_this) = _SWIG_This();
2086
if (swig_this == NULL)
2087
swig_this = _SWIG_This();
1918
2088
return swig_this;
1921
2091
/* #define SWIG_PYTHON_SLOW_GETSET_THIS */
1923
SWIGRUNTIME PySwigObject *
2093
/* TODO: I don't know how to implement the fast getset in Python 3 right now */
2094
#if PY_VERSION_HEX>=0x03000000
2095
#define SWIG_PYTHON_SLOW_GETSET_THIS
2098
SWIGRUNTIME SwigPyObject *
1924
2099
SWIG_Python_GetSwigThis(PyObject *pyobj)
1926
if (PySwigObject_Check(pyobj)) {
1927
return (PySwigObject *) pyobj;
2101
if (SwigPyObject_Check(pyobj)) {
2102
return (SwigPyObject *) pyobj;
1929
2104
PyObject *obj = 0;
1930
2105
#if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000))
2323
2508
SWIGRUNTIME void
2324
2509
SWIG_Python_DestroyModule(void *vptr)
2513
swig_module_info *swig_module =
2514
(swig_module_info *) PyCapsule_GetPointer((PyObject *)vptr, TYPE_POINTER_NAME);
2326
2516
swig_module_info *swig_module = (swig_module_info *) vptr;
2327
2518
swig_type_info **types = swig_module->types;
2329
2519
for (i =0; i < swig_module->size; ++i) {
2330
2520
swig_type_info *ty = types[i];
2331
2521
if (ty->owndata) {
2332
PySwigClientData *data = (PySwigClientData *) ty->clientdata;
2333
if (data) PySwigClientData_Del(data);
2522
SwigPyClientData *data = (SwigPyClientData *) ty->clientdata;
2523
if (data) SwigPyClientData_Del(data);
2336
2526
Py_DECREF(SWIG_This());
2339
2530
SWIGRUNTIME void
2340
2531
SWIG_Python_SetModule(swig_module_info *swig_module) {
2341
2532
static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */
2534
#if PY_VERSION_HEX >= 0x03000000
2535
/* Add a dummy module object into sys.modules */
2536
PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION);
2343
2538
PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
2344
2539
swig_empty_runtime_method_table);
2542
PyObject *pointer = PyCapsule_New((void *)swig_module, TYPE_POINTER_NAME,
2543
(PyCapsule_Destructor)SWIG_Python_DestroyModule);
2345
2545
PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
2346
2547
if (pointer && module) {
2549
PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer);
2347
2551
PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
2349
2554
Py_XDECREF(pointer);
2361
2566
SWIG_Python_TypeQuery(const char *type)
2363
2568
PyObject *cache = SWIG_Python_TypeCache();
2364
PyObject *key = PyString_FromString(type);
2569
PyObject *key = SWIG_Python_str_FromChar(type);
2365
2570
PyObject *obj = PyDict_GetItem(cache, key);
2366
2571
swig_type_info *descriptor;
2574
descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, type);
2368
2576
descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
2370
2579
swig_module_info *swig_module = SWIG_Python_GetModule();
2371
2580
descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
2372
2581
if (descriptor) {
2583
obj = PyCapsule_New(descriptor, type, NULL);
2373
2585
obj = PyCObject_FromVoidPtr(descriptor, NULL);
2374
2587
PyDict_SetItem(cache, key, obj);
2375
2588
Py_DECREF(obj);
2389
2602
SWIGRUNTIME int
2390
2603
SWIG_Python_AddErrMesg(const char* mesg, int infront)
2392
2605
if (PyErr_Occurred()) {
2393
2606
PyObject *type = 0;
2394
2607
PyObject *value = 0;
2395
2608
PyObject *traceback = 0;
2396
2609
PyErr_Fetch(&type, &value, &traceback);
2398
2612
PyObject *old_str = PyObject_Str(value);
2399
2613
Py_XINCREF(type);
2402
PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str));
2616
PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str));
2404
PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg);
2618
PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
2620
SWIG_Python_str_DelForPy3(tmp);
2406
2621
Py_DECREF(old_str);
5743
SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'coo_tocsr'.\n"
5967
SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'coo_tocsr'.\n"
5744
5968
" Possible C/C++ prototypes are:\n"
5745
5969
" coo_tocsr< int,signed char >(int const,int const,int const,int const [],int const [],signed char const [],int [],int [],signed char [])\n"
5746
5970
" coo_tocsr< int,unsigned char >(int const,int const,int const,int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n"
8393
SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'coo_tocsc'.\n"
8617
SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'coo_tocsc'.\n"
8394
8618
" Possible C/C++ prototypes are:\n"
8395
8619
" coo_tocsc< int,signed char >(int const,int const,int const,int const [],int const [],signed char const [],int [],int [],signed char [])\n"
8396
8620
" coo_tocsc< int,unsigned char >(int const,int const,int const,int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n"
10679
SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'coo_todense'.\n"
10903
SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'coo_todense'.\n"
10680
10904
" Possible C/C++ prototypes are:\n"
10681
10905
" coo_todense< int,signed char >(int const,int const,int const,int const [],int const [],signed char const [],signed char [])\n"
10682
10906
" coo_todense< int,unsigned char >(int const,int const,int const,int const [],int const [],unsigned char const [],unsigned char [])\n"
12951
SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'coo_matvec'.\n"
13175
SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'coo_matvec'.\n"
12952
13176
" Possible C/C++ prototypes are:\n"
12953
13177
" coo_matvec< int,signed char >(int const,int const [],int const [],signed char const [],signed char const [],signed char [])\n"
12954
13178
" coo_matvec< int,unsigned char >(int const,int const [],int const [],unsigned char const [],unsigned char const [],unsigned char [])\n"
13450
13675
SWIGINTERN PyObject *
13451
13676
swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
13677
#if PY_VERSION_HEX >= 0x03000000
13678
return PyUnicode_InternFromString("<Swig global variables>");
13452
13680
return PyString_FromString("<Swig global variables>");
13455
13684
SWIGINTERN PyObject *
13456
13685
swig_varlink_str(swig_varlinkobject *v) {
13686
#if PY_VERSION_HEX >= 0x03000000
13687
PyObject *str = PyUnicode_InternFromString("(");
13690
swig_globalvar *var;
13691
for (var = v->vars; var; var=var->next) {
13692
tail = PyUnicode_FromString(var->name);
13693
joined = PyUnicode_Concat(str, tail);
13698
tail = PyUnicode_InternFromString(", ");
13699
joined = PyUnicode_Concat(str, tail);
13705
tail = PyUnicode_InternFromString(")");
13706
joined = PyUnicode_Concat(str, tail);
13457
13711
PyObject *str = PyString_FromString("(");
13458
swig_globalvar *var;
13712
swig_globalvar *var;
13459
13713
for (var = v->vars; var; var=var->next) {
13460
13714
PyString_ConcatAndDel(&str,PyString_FromString(var->name));
13461
13715
if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
13463
13717
PyString_ConcatAndDel(&str,PyString_FromString(")"));
13467
13722
SWIGINTERN int
13468
13723
swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) {
13469
13725
PyObject *str = swig_varlink_str(v);
13470
13726
fprintf(fp,"Swig global variables ");
13471
fprintf(fp,"%s\n", PyString_AsString(str));
13727
fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str));
13728
SWIG_Python_str_DelForPy3(tmp);
13472
13729
Py_DECREF(str);
13526
13783
if (!type_init) {
13527
13784
const PyTypeObject tmp
13786
/* PyObject header changed in Python 3 */
13787
#if PY_VERSION_HEX >= 0x03000000
13788
PyVarObject_HEAD_INIT(&PyType_Type, 0)
13529
13790
PyObject_HEAD_INIT(NULL)
13530
13791
0, /* Number of items in variable part (ob_size) */
13531
13793
(char *)"swigvarlink", /* Type name (tp_name) */
13532
13794
sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */
13533
13795
0, /* Itemsize (tp_itemsize) */
13534
(destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */
13796
(destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */
13535
13797
(printfunc) swig_varlink_print, /* Print (tp_print) */
13536
13798
(getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */
13537
13799
(setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */
13658
size_t shift = (ci->ptype) - types;
13659
swig_type_info *ty = types_initial[shift];
13660
size_t ldoc = (c - methods[i].ml_doc);
13661
size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
13662
char *ndoc = (char*)malloc(ldoc + lptr + 10);
13665
void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
13923
void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
13925
size_t shift = (ci->ptype) - types;
13926
swig_type_info *ty = types_initial[shift];
13927
size_t ldoc = (c - methods[i].ml_doc);
13928
size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
13929
char *ndoc = (char*)malloc(ldoc + lptr + 10);
13667
13932
strncpy(buff, methods[i].ml_doc, ldoc);
13668
13933
buff += ldoc;
13669
13934
strncpy(buff, "swig_ptr: ", 10);