1
1
/* ----------------------------------------------------------------------------
2
2
* This file was automatically generated by SWIG (http://www.swig.org).
5
* This file is not intended to be easily readable and contains a number of
5
* This file is not intended to be easily readable and contains a number of
6
6
* coding conventions designed to improve portability and efficiency. Do not make
7
* changes to this file unless you know what you are doing--modify the SWIG
8
* interface file instead.
7
* changes to this file unless you know what you are doing--modify the SWIG
8
* interface file instead.
9
9
* ----------------------------------------------------------------------------- */
11
11
/* -----------------------------------------------------------------------------
40
40
# if defined(__GNUC__)
41
41
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
42
# define SWIGUNUSED __attribute__ ((__unused__))
42
# define SWIGUNUSED __attribute__ ((__unused__))
44
44
# define SWIGUNUSED
46
46
# elif defined(__ICC)
47
# define SWIGUNUSED __attribute__ ((__unused__))
47
# define SWIGUNUSED __attribute__ ((__unused__))
53
53
#ifndef SWIG_MSC_UNSUPPRESS_4505
54
54
# if defined(_MSC_VER)
55
55
# pragma warning(disable : 4505) /* unreferenced local function has been removed */
59
59
#ifndef SWIGUNUSEDPARM
60
60
# ifdef __cplusplus
61
61
# define SWIGUNUSEDPARM(p)
63
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
63
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
119
119
/* Errors in SWIG */
120
#define SWIG_UnknownError -1
121
#define SWIG_IOError -2
122
#define SWIG_RuntimeError -3
123
#define SWIG_IndexError -4
124
#define SWIG_TypeError -5
125
#define SWIG_DivisionByZero -6
126
#define SWIG_OverflowError -7
127
#define SWIG_SyntaxError -8
128
#define SWIG_ValueError -9
120
#define SWIG_UnknownError -1
121
#define SWIG_IOError -2
122
#define SWIG_RuntimeError -3
123
#define SWIG_IndexError -4
124
#define SWIG_TypeError -5
125
#define SWIG_DivisionByZero -6
126
#define SWIG_OverflowError -7
127
#define SWIG_SyntaxError -8
128
#define SWIG_ValueError -9
129
129
#define SWIG_SystemError -10
130
130
#define SWIG_AttributeError -11
131
#define SWIG_MemoryError -12
131
#define SWIG_MemoryError -12
132
132
#define SWIG_NullReferenceError -13
156
156
You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
157
157
creating a static or dynamic library from the SWIG runtime code.
158
158
In 99.9% of the cases, SWIG just needs to declare them as 'static'.
160
160
But only do this if strictly necessary, ie, if you have problems
161
161
with your compiler or suchlike.
182
182
#define SWIG_POINTER_OWN 0x1
186
186
Flags/methods for returning states.
188
The SWIG conversion methods, as ConvertPtr, return an integer
188
The SWIG conversion methods, as ConvertPtr, return an integer
189
189
that tells if the conversion was successful or not. And if not,
190
190
an error code can be returned (see swigerrors.swg for the codes).
192
192
Use the following macros/flags to set or process the returning
195
195
In old versions of SWIG, code such as the following was usually written:
197
197
if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
228
228
I.e., now SWIG_ConvertPtr can return new objects and you can
229
229
identify the case and take care of the deallocation. Of course that
230
230
also requires SWIG_ConvertPtr to return new result values, such as
232
int SWIG_ConvertPtr(obj, ptr,...) {
234
if (<need new object>) {
235
*ptr = <ptr to new allocated object>;
238
*ptr = <ptr to old object>;
232
int SWIG_ConvertPtr(obj, ptr,...) {
234
if (<need new object>) {
235
*ptr = <ptr to new allocated object>;
238
*ptr = <ptr to old object>;
246
246
Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
258
258
food(1) // cast rank '1' (1 -> 1.0)
259
259
fooi(1) // cast rank '0'
261
261
just use the SWIG_AddCast()/SWIG_CheckState()
265
265
#define SWIG_ERROR (-1)
266
266
#define SWIG_IsOK(r) (r >= 0)
267
#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
267
#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
269
269
/* The CastRankLimit says how many bits are used for the cast rank */
270
270
#define SWIG_CASTRANKLIMIT (1 << 8)
296
296
# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
297
297
# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
298
SWIGINTERNINLINE int SWIG_AddCast(int r) {
298
SWIGINTERNINLINE int SWIG_AddCast(int r) {
299
299
return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
301
SWIGINTERNINLINE int SWIG_CheckState(int r) {
302
return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
301
SWIGINTERNINLINE int SWIG_CheckState(int r) {
302
return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
304
304
#else /* no cast-rank mode */
305
# define SWIG_AddCast
305
# define SWIG_AddCast(r) (r)
306
306
# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
368
368
Check type equivalence in a name list like <name1>|<name2>|...
369
Return 0 if equal, -1 if nb < tb, 1 if nb > tb
372
SWIG_TypeCmp(const char *nb, const char *tb) {
374
const char* te = tb + strlen(tb);
376
while (equiv != 0 && *ne) {
377
for (nb = ne; *ne; ++ne) {
378
if (*ne == '|') break;
380
equiv = SWIG_TypeNameComp(nb, ne, tb, te);
387
Check type equivalence in a name list like <name1>|<name2>|...
369
388
Return 0 if not equal, 1 if equal
372
391
SWIG_TypeEquiv(const char *nb, const char *tb) {
374
const char* te = tb + strlen(tb);
376
while (!equiv && *ne) {
377
for (nb = ne; *ne; ++ne) {
378
if (*ne == '|') break;
380
equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
387
Check type equivalence in a name list like <name1>|<name2>|...
388
Return 0 if equal, -1 if nb < tb, 1 if nb > tb
391
SWIG_TypeCompare(const char *nb, const char *tb) {
393
const char* te = tb + strlen(tb);
395
while (!equiv && *ne) {
396
for (nb = ne; *ne; ++ne) {
397
if (*ne == '|') break;
399
equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
392
return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
407
396
Check the typename
517
506
swig_cast_info *cast = ti->cast;
518
507
/* if (ti->clientdata == clientdata) return; */
519
508
ti->clientdata = clientdata;
522
511
if (!cast->converter) {
523
512
swig_type_info *tc = cast->type;
524
513
if (!tc->clientdata) {
525
514
SWIG_TypeClientData(tc, clientdata);
528
517
cast = cast->next;
533
522
SWIG_TypeClientData(ti, clientdata);
538
527
Search for a swig_type_info structure only by mangled name
539
528
Search is a O(log #types)
541
We start searching at module start, and finish searching when start == end.
530
We start searching at module start, and finish searching when start == end.
542
531
Note: if start == end at the beginning of the function, we go all the way around
543
532
the circular list.
545
534
SWIGRUNTIME swig_type_info *
546
SWIG_MangledTypeQueryModule(swig_module_info *start,
547
swig_module_info *end,
535
SWIG_MangledTypeQueryModule(swig_module_info *start,
536
swig_module_info *end,
548
537
const char *name) {
549
538
swig_module_info *iter = start;
551
540
if (iter->size) {
552
register size_t l = 0;
553
register size_t r = iter->size - 1;
542
size_t r = iter->size - 1;
555
544
/* since l+r >= 0, we can (>> 1) instead (/ 2) */
556
register size_t i = (l + r) >> 1;
545
size_t i = (l + r) >> 1;
557
546
const char *iname = iter->types[i]->name;
559
register int compare = strcmp(name, iname);
548
int compare = strcmp(name, iname);
561
550
return iter->types[i];
562
551
} else if (compare < 0) {
582
571
Search for a swig_type_info structure for either a mangled name or a human readable name.
583
572
It first searches the mangled names of the types, which is a O(log #types)
584
573
If a type is not found it then searches the human readable names, which is O(#types).
586
We start searching at module start, and finish searching when start == end.
575
We start searching at module start, and finish searching when start == end.
587
576
Note: if start == end at the beginning of the function, we go all the way around
588
577
the circular list.
590
579
SWIGRUNTIME swig_type_info *
591
SWIG_TypeQueryModule(swig_module_info *start,
592
swig_module_info *end,
580
SWIG_TypeQueryModule(swig_module_info *start,
581
swig_module_info *end,
593
582
const char *name) {
594
583
/* STEP 1: Search the name field using binary search */
595
584
swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
600
589
of the str field (the human readable name) */
601
590
swig_module_info *iter = start;
603
register size_t i = 0;
604
593
for (; i < iter->size; ++i) {
605
594
if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
606
595
return iter->types[i];
608
597
iter = iter->next;
609
598
} while (iter != end);
612
601
/* neither found a match */
617
606
Pack binary data into a string
619
608
SWIGRUNTIME char *
620
609
SWIG_PackData(char *c, void *ptr, size_t sz) {
621
610
static const char hex[17] = "0123456789abcdef";
622
register const unsigned char *u = (unsigned char *) ptr;
623
register const unsigned char *eu = u + sz;
611
const unsigned char *u = (unsigned char *) ptr;
612
const unsigned char *eu = u + sz;
624
613
for (; u != eu; ++u) {
625
register unsigned char uu = *u;
614
unsigned char uu = *u;
626
615
*(c++) = hex[(uu & 0xf0) >> 4];
627
616
*(c++) = hex[uu & 0xf];
633
622
Unpack binary data from a string
635
624
SWIGRUNTIME const char *
636
625
SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
637
register unsigned char *u = (unsigned char *) ptr;
638
register const unsigned char *eu = u + sz;
626
unsigned char *u = (unsigned char *) ptr;
627
const unsigned char *eu = u + sz;
639
628
for (; u != eu; ++u) {
640
register char d = *(c++);
641
register unsigned char uu;
642
631
if ((d >= '0') && (d <= '9'))
643
632
uu = ((d - '0') << 4);
644
633
else if ((d >= 'a') && (d <= 'f'))
645
634
uu = ((d - ('a'-10)) << 4);
647
636
return (char *) 0;
649
638
if ((d >= '0') && (d <= '9'))
651
640
else if ((d >= 'a') && (d <= 'f'))
652
641
uu |= (d - ('a'-10));
654
643
return (char *) 0;
661
650
Pack 'void *' into a string buffer.
663
652
SWIGRUNTIME char *
1303
1292
PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
1306
register Py_ssize_t l = PyTuple_GET_SIZE(args);
1295
Py_ssize_t l = PyTuple_GET_SIZE(args);
1308
1297
PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1309
1298
name, (min == max ? "" : "at least "), (int)min, (int)l);
1313
1302
name, (min == max ? "" : "at most "), (int)max, (int)l);
1317
1306
for (i = 0; i < l; ++i) {
1318
1307
objs[i] = PyTuple_GET_ITEM(args, i);
1569
1558
SWIGRUNTIME int
1570
SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags))
1574
PyObject *repr = SwigPyObject_repr(v);
1576
PyObject *repr = SwigPyObject_repr(v, NULL);
1579
str = SWIG_Python_str_AsChar(repr);
1581
SWIG_Python_str_DelForPy3(str);
1589
SWIGRUNTIME PyObject *
1590
SwigPyObject_str(SwigPyObject *v)
1592
char result[SWIG_BUFFER_SIZE];
1593
return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ?
1594
SWIG_Python_str_FromChar(result) : 0;
1598
1559
SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
1600
1561
void *i = v->ptr;
1786
1747
static PyMethodDef
1787
1748
swigobject_methods[] = {
1788
1749
{(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"},
1789
{(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"},
1750
{(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"acquires ownership of the pointer"},
1790
1751
{(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
1791
1752
{(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"},
1792
1753
{(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"},
1879
1840
sizeof(SwigPyObject), /* tp_basicsize */
1880
1841
0, /* tp_itemsize */
1881
1842
(destructor)SwigPyObject_dealloc, /* tp_dealloc */
1882
(printfunc)SwigPyObject_print, /* tp_print */
1883
1844
#if PY_VERSION_HEX < 0x02020000
1884
1845
(getattrfunc)SwigPyObject_getattr, /* tp_getattr */
1897
1858
0, /* tp_as_mapping */
1898
1859
(hashfunc)0, /* tp_hash */
1899
1860
(ternaryfunc)0, /* tp_call */
1900
(reprfunc)SwigPyObject_str, /* tp_str */
1901
1862
PyObject_GenericGetAttr, /* tp_getattro */
1902
1863
0, /* tp_setattro */
1903
1864
0, /* tp_as_buffer */
2274
2235
SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
2276
2237
SwigPyObject *sobj;
2238
int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0;
2279
2241
return SWIG_ERROR;
2280
if (obj == Py_None) {
2242
if (obj == Py_None && !implicit_conv) {
2283
2245
return SWIG_OK;
2450
2419
#if PY_VERSION_HEX >= 0x03000000
2451
inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None);
2420
inst = ((PyTypeObject*) data->newargs)->tp_new((PyTypeObject*) data->newargs, Py_None, Py_None);
2453
2422
PyObject_SetAttr(inst, SWIG_This(), swig_this);
2454
2423
Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;