1
/* ----------------------------------------------------------------------------
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
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.
9
* ----------------------------------------------------------------------------- */
12
#define SWIG_PYTHON_DIRECTOR_NO_VTABLE
16
/* SwigValueWrapper is described in swig.swg */
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);
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; }
33
template <typename T> T SwigValueInit() {
38
/* -----------------------------------------------------------------------------
39
* This section contains generic SWIG labels for method/variable
40
* declarations/attributes, and other compiler dependent labels.
41
* ----------------------------------------------------------------------------- */
43
/* template workaround for compilers that cannot correctly implement the C++ standard */
44
#ifndef SWIGTEMPLATEDISAMBIGUATOR
45
# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
46
# define SWIGTEMPLATEDISAMBIGUATOR template
47
# elif defined(__HP_aCC)
48
/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
49
/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
50
# define SWIGTEMPLATEDISAMBIGUATOR template
52
# define SWIGTEMPLATEDISAMBIGUATOR
56
/* inline attribute */
58
# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
59
# define SWIGINLINE inline
65
/* attribute recognised by some compilers to avoid 'unused' warnings */
67
# if defined(__GNUC__)
68
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
69
# define SWIGUNUSED __attribute__ ((__unused__))
74
# define SWIGUNUSED __attribute__ ((__unused__))
80
#ifndef SWIG_MSC_UNSUPPRESS_4505
81
# if defined(_MSC_VER)
82
# pragma warning(disable : 4505) /* unreferenced local function has been removed */
86
#ifndef SWIGUNUSEDPARM
88
# define SWIGUNUSEDPARM(p)
90
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
94
/* internal SWIG method */
96
# define SWIGINTERN static SWIGUNUSED
99
/* internal inline SWIG method */
100
#ifndef SWIGINTERNINLINE
101
# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
104
/* exporting methods */
105
#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
106
# ifndef GCC_HASCLASSVISIBILITY
107
# define GCC_HASCLASSVISIBILITY
112
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
113
# if defined(STATIC_LINKED)
116
# define SWIGEXPORT __declspec(dllexport)
119
# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
120
# define SWIGEXPORT __attribute__ ((visibility("default")))
127
/* calling conventions for Windows */
129
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
130
# define SWIGSTDCALL __stdcall
136
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
137
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
138
# define _CRT_SECURE_NO_DEPRECATE
141
/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
142
#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
143
# define _SCL_SECURE_NO_DEPRECATE
148
/* Python.h has to appear first */
151
/* -----------------------------------------------------------------------------
154
* This file contains generic C API SWIG runtime support for pointer
156
* ----------------------------------------------------------------------------- */
158
/* This should only be incremented when either the layout of swig_type_info changes,
159
or for whatever reason, the runtime changes incompatibly */
160
#define SWIG_RUNTIME_VERSION "4"
162
/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
163
#ifdef SWIG_TYPE_TABLE
164
# define SWIG_QUOTE_STRING(x) #x
165
# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
166
# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
168
# define SWIG_TYPE_TABLE_NAME
172
You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
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'.
176
But only do this if strictly necessary, ie, if you have problems
177
with your compiler or suchlike.
181
# define SWIGRUNTIME SWIGINTERN
184
#ifndef SWIGRUNTIMEINLINE
185
# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
188
/* Generic buffer size */
189
#ifndef SWIG_BUFFER_SIZE
190
# define SWIG_BUFFER_SIZE 1024
193
/* Flags for pointer conversions */
194
#define SWIG_POINTER_DISOWN 0x1
195
#define SWIG_CAST_NEW_MEMORY 0x2
197
/* Flags for new pointer objects */
198
#define SWIG_POINTER_OWN 0x1
202
Flags/methods for returning states.
204
The SWIG conversion methods, as ConvertPtr, return and integer
205
that tells if the conversion was successful or not. And if not,
206
an error code can be returned (see swigerrors.swg for the codes).
208
Use the following macros/flags to set or process the returning
211
In old versions of SWIG, code such as the following was usually written:
213
if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
219
Now you can be more explicit:
221
int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
222
if (SWIG_IsOK(res)) {
228
which is the same really, but now you can also do
231
int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
232
if (SWIG_IsOK(res)) {
234
if (SWIG_IsNewObj(res) {
244
I.e., now SWIG_ConvertPtr can return new objects and you can
245
identify the case and take care of the deallocation. Of course that
246
also requires SWIG_ConvertPtr to return new result values, such as
248
int SWIG_ConvertPtr(obj, ptr,...) {
250
if (<need new object>) {
251
*ptr = <ptr to new allocated object>;
254
*ptr = <ptr to old object>;
262
Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
263
more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
266
Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
267
allows to return the 'cast rank', for example, if you have this
274
food(1) // cast rank '1' (1 -> 1.0)
275
fooi(1) // cast rank '0'
277
just use the SWIG_AddCast()/SWIG_CheckState()
281
#define SWIG_ERROR (-1)
282
#define SWIG_IsOK(r) (r >= 0)
283
#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
285
/* The CastRankLimit says how many bits are used for the cast rank */
286
#define SWIG_CASTRANKLIMIT (1 << 8)
287
/* The NewMask denotes the object was created (using new/malloc) */
288
#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
289
/* The TmpMask is for in/out typemaps that use temporal objects */
290
#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
291
/* Simple returning values */
292
#define SWIG_BADOBJ (SWIG_ERROR)
293
#define SWIG_OLDOBJ (SWIG_OK)
294
#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
295
#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
296
/* Check, add and del mask methods */
297
#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
298
#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
299
#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
300
#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
301
#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
302
#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
305
#if defined(SWIG_CASTRANK_MODE)
306
# ifndef SWIG_TypeRank
307
# define SWIG_TypeRank unsigned long
309
# ifndef SWIG_MAXCASTRANK /* Default cast allowed */
310
# define SWIG_MAXCASTRANK (2)
312
# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
313
# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
314
SWIGINTERNINLINE int SWIG_AddCast(int r) {
315
return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
317
SWIGINTERNINLINE int SWIG_CheckState(int r) {
318
return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
320
#else /* no cast-rank mode */
321
# define SWIG_AddCast
322
# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
332
typedef void *(*swig_converter_func)(void *, int *);
333
typedef struct swig_type_info *(*swig_dycast_func)(void **);
335
/* Structure to store information on one type */
336
typedef struct swig_type_info {
337
const char *name; /* mangled name of this type */
338
const char *str; /* human readable name of this type */
339
swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
340
struct swig_cast_info *cast; /* linked list of types that can cast into this type */
341
void *clientdata; /* language specific type data */
342
int owndata; /* flag if the structure owns the clientdata */
345
/* Structure to store a type and conversion function used for casting */
346
typedef struct swig_cast_info {
347
swig_type_info *type; /* pointer to type that is equivalent to this type */
348
swig_converter_func converter; /* function to cast the void pointers */
349
struct swig_cast_info *next; /* pointer to next cast in linked list */
350
struct swig_cast_info *prev; /* pointer to the previous cast */
353
/* Structure used to store module information
354
* Each module generates one structure like this, and the runtime collects
355
* all of these structures and stores them in a circularly linked list.*/
356
typedef struct swig_module_info {
357
swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
358
size_t size; /* Number of types in this module */
359
struct swig_module_info *next; /* Pointer to next element in circularly linked list */
360
swig_type_info **type_initial; /* Array of initially generated type structures */
361
swig_cast_info **cast_initial; /* Array of initially generated casting structures */
362
void *clientdata; /* Language specific module data */
366
Compare two type names skipping the space characters, therefore
367
"char*" == "char *" and "Class<int>" == "Class<int >", etc.
369
Return 0 when the two name types are equivalent, as in
370
strncmp, but skipping ' '.
373
SWIG_TypeNameComp(const char *f1, const char *l1,
374
const char *f2, const char *l2) {
375
for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
376
while ((*f1 == ' ') && (f1 != l1)) ++f1;
377
while ((*f2 == ' ') && (f2 != l2)) ++f2;
378
if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
380
return (int)((l1 - f1) - (l2 - f2));
384
Check type equivalence in a name list like <name1>|<name2>|...
385
Return 0 if not equal, 1 if equal
388
SWIG_TypeEquiv(const char *nb, const char *tb) {
390
const char* te = tb + strlen(tb);
392
while (!equiv && *ne) {
393
for (nb = ne; *ne; ++ne) {
394
if (*ne == '|') break;
396
equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
403
Check type equivalence in a name list like <name1>|<name2>|...
404
Return 0 if equal, -1 if nb < tb, 1 if nb > tb
407
SWIG_TypeCompare(const char *nb, const char *tb) {
409
const char* te = tb + strlen(tb);
411
while (!equiv && *ne) {
412
for (nb = ne; *ne; ++ne) {
413
if (*ne == '|') break;
415
equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
425
SWIGRUNTIME swig_cast_info *
426
SWIG_TypeCheck(const char *c, swig_type_info *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;
450
Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
452
SWIGRUNTIME swig_cast_info *
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;
477
Cast a pointer up an inheritance hierarchy
479
SWIGRUNTIMEINLINE void *
480
SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
481
return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
485
Dynamic pointer casting. Down an inheritance hierarchy
487
SWIGRUNTIME swig_type_info *
488
SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
489
swig_type_info *lastty = ty;
490
if (!ty || !ty->dcast) return ty;
491
while (ty && (ty->dcast)) {
492
ty = (*ty->dcast)(ptr);
499
Return the name associated with this type
501
SWIGRUNTIMEINLINE const char *
502
SWIG_TypeName(const swig_type_info *ty) {
507
Return the pretty name associated with this type,
508
that is an unmangled type name in a form presentable to the user.
510
SWIGRUNTIME const char *
511
SWIG_TypePrettyName(const swig_type_info *type) {
512
/* The "str" field contains the equivalent pretty names of the
513
type, separated by vertical-bar characters. We choose
514
to print the last name, as it is often (?) the most
516
if (!type) return NULL;
517
if (type->str != NULL) {
518
const char *last_name = type->str;
520
for (s = type->str; *s; s++)
521
if (*s == '|') last_name = s+1;
529
Set the clientdata field for a type
532
SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
533
swig_cast_info *cast = ti->cast;
534
/* if (ti->clientdata == clientdata) return; */
535
ti->clientdata = clientdata;
538
if (!cast->converter) {
539
swig_type_info *tc = cast->type;
540
if (!tc->clientdata) {
541
SWIG_TypeClientData(tc, clientdata);
548
SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
549
SWIG_TypeClientData(ti, clientdata);
554
Search for a swig_type_info structure only by mangled name
555
Search is a O(log #types)
557
We start searching at module start, and finish searching when start == end.
558
Note: if start == end at the beginning of the function, we go all the way around
561
SWIGRUNTIME swig_type_info *
562
SWIG_MangledTypeQueryModule(swig_module_info *start,
563
swig_module_info *end,
565
swig_module_info *iter = start;
568
register size_t l = 0;
569
register size_t r = iter->size - 1;
571
/* since l+r >= 0, we can (>> 1) instead (/ 2) */
572
register size_t i = (l + r) >> 1;
573
const char *iname = iter->types[i]->name;
575
register int compare = strcmp(name, iname);
577
return iter->types[i];
578
} else if (compare < 0) {
584
} else if (compare > 0) {
588
break; /* should never happen */
593
} while (iter != end);
598
Search for a swig_type_info structure for either a mangled name or a human readable name.
599
It first searches the mangled names of the types, which is a O(log #types)
600
If a type is not found it then searches the human readable names, which is O(#types).
602
We start searching at module start, and finish searching when start == end.
603
Note: if start == end at the beginning of the function, we go all the way around
606
SWIGRUNTIME swig_type_info *
607
SWIG_TypeQueryModule(swig_module_info *start,
608
swig_module_info *end,
610
/* STEP 1: Search the name field using binary search */
611
swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
615
/* STEP 2: If the type hasn't been found, do a complete search
616
of the str field (the human readable name) */
617
swig_module_info *iter = start;
619
register size_t i = 0;
620
for (; i < iter->size; ++i) {
621
if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
622
return iter->types[i];
625
} while (iter != end);
628
/* neither found a match */
633
Pack binary data into a string
636
SWIG_PackData(char *c, void *ptr, size_t sz) {
637
static const char hex[17] = "0123456789abcdef";
638
register const unsigned char *u = (unsigned char *) ptr;
639
register const unsigned char *eu = u + sz;
640
for (; u != eu; ++u) {
641
register unsigned char uu = *u;
642
*(c++) = hex[(uu & 0xf0) >> 4];
643
*(c++) = hex[uu & 0xf];
649
Unpack binary data from a string
651
SWIGRUNTIME const char *
652
SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
653
register unsigned char *u = (unsigned char *) ptr;
654
register const unsigned char *eu = u + sz;
655
for (; u != eu; ++u) {
656
register char d = *(c++);
657
register unsigned char uu;
658
if ((d >= '0') && (d <= '9'))
659
uu = ((d - '0') << 4);
660
else if ((d >= 'a') && (d <= 'f'))
661
uu = ((d - ('a'-10)) << 4);
665
if ((d >= '0') && (d <= '9'))
667
else if ((d >= 'a') && (d <= 'f'))
668
uu |= (d - ('a'-10));
677
Pack 'void *' into a string buffer.
680
SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
682
if ((2*sizeof(void *) + 2) > bsz) return 0;
684
r = SWIG_PackData(r,&ptr,sizeof(void *));
685
if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
690
SWIGRUNTIME const char *
691
SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
693
if (strcmp(c,"NULL") == 0) {
700
return SWIG_UnpackData(++c,ptr,sizeof(void *));
704
SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
706
size_t lname = (name ? strlen(name) : 0);
707
if ((2*sz + 2 + lname) > bsz) return 0;
709
r = SWIG_PackData(r,ptr,sz);
711
strncpy(r,name,lname+1);
718
SWIGRUNTIME const char *
719
SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
721
if (strcmp(c,"NULL") == 0) {
728
return SWIG_UnpackData(++c,ptr,sz);
736
#define SWIG_UnknownError -1
737
#define SWIG_IOError -2
738
#define SWIG_RuntimeError -3
739
#define SWIG_IndexError -4
740
#define SWIG_TypeError -5
741
#define SWIG_DivisionByZero -6
742
#define SWIG_OverflowError -7
743
#define SWIG_SyntaxError -8
744
#define SWIG_ValueError -9
745
#define SWIG_SystemError -10
746
#define SWIG_AttributeError -11
747
#define SWIG_MemoryError -12
748
#define SWIG_NullReferenceError -13
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);
814
/* Add PyOS_snprintf for old Pythons */
815
#if PY_VERSION_HEX < 0x02020000
816
# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
817
# define PyOS_snprintf _snprintf
819
# define PyOS_snprintf snprintf
823
/* A crude PyString_FromFormat implementation for old Pythons */
824
#if PY_VERSION_HEX < 0x02020000
826
#ifndef SWIG_PYBUFFER_SIZE
827
# define SWIG_PYBUFFER_SIZE 1024
831
PyString_FromFormat(const char *fmt, ...) {
833
char buf[SWIG_PYBUFFER_SIZE * 2];
836
res = vsnprintf(buf, sizeof(buf), fmt, ap);
838
return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf);
842
/* Add PyObject_Del for old Pythons */
843
#if PY_VERSION_HEX < 0x01060000
844
# define PyObject_Del(op) PyMem_DEL((op))
847
# define PyObject_DEL PyObject_Del
850
/* A crude PyExc_StopIteration exception for old Pythons */
851
#if PY_VERSION_HEX < 0x02020000
852
# ifndef PyExc_StopIteration
853
# define PyExc_StopIteration PyExc_RuntimeError
855
# ifndef PyObject_GenericGetAttr
856
# define PyObject_GenericGetAttr 0
860
/* Py_NotImplemented is defined in 2.1 and up. */
861
#if PY_VERSION_HEX < 0x02010000
862
# ifndef Py_NotImplemented
863
# define Py_NotImplemented PyExc_RuntimeError
867
/* A crude PyString_AsStringAndSize implementation for old Pythons */
868
#if PY_VERSION_HEX < 0x02010000
869
# ifndef PyString_AsStringAndSize
870
# define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;}
874
/* PySequence_Size for old Pythons */
875
#if PY_VERSION_HEX < 0x02000000
876
# ifndef PySequence_Size
877
# define PySequence_Size PySequence_Length
881
/* PyBool_FromLong for old Pythons */
882
#if PY_VERSION_HEX < 0x02030000
884
PyObject *PyBool_FromLong(long ok)
886
PyObject *result = ok ? Py_True : Py_False;
892
/* Py_ssize_t for old Pythons */
893
/* This code is as recommended by: */
894
/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
895
#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
896
typedef int Py_ssize_t;
897
# define PY_SSIZE_T_MAX INT_MAX
898
# define PY_SSIZE_T_MIN INT_MIN
901
/* -----------------------------------------------------------------------------
903
* ----------------------------------------------------------------------------- */
905
SWIGRUNTIME PyObject*
906
SWIG_Python_ErrorType(int code) {
909
case SWIG_MemoryError:
910
type = PyExc_MemoryError;
913
type = PyExc_IOError;
915
case SWIG_RuntimeError:
916
type = PyExc_RuntimeError;
918
case SWIG_IndexError:
919
type = PyExc_IndexError;
922
type = PyExc_TypeError;
924
case SWIG_DivisionByZero:
925
type = PyExc_ZeroDivisionError;
927
case SWIG_OverflowError:
928
type = PyExc_OverflowError;
930
case SWIG_SyntaxError:
931
type = PyExc_SyntaxError;
933
case SWIG_ValueError:
934
type = PyExc_ValueError;
936
case SWIG_SystemError:
937
type = PyExc_SystemError;
939
case SWIG_AttributeError:
940
type = PyExc_AttributeError;
943
type = PyExc_RuntimeError;
950
SWIG_Python_AddErrorMsg(const char* mesg)
954
PyObject *traceback = 0;
956
if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback);
959
PyObject *old_str = PyObject_Str(value);
963
PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
964
SWIG_Python_str_DelForPy3(tmp);
968
PyErr_SetString(PyExc_RuntimeError, mesg);
972
#if defined(SWIG_PYTHON_NO_THREADS)
973
# if defined(SWIG_PYTHON_THREADS)
974
# undef SWIG_PYTHON_THREADS
977
#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
978
# if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
979
# if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */
980
# define SWIG_PYTHON_USE_GIL
983
# if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
984
# ifndef SWIG_PYTHON_INITIALIZE_THREADS
985
# define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads()
987
# ifdef __cplusplus /* C++ code */
988
class SWIG_Python_Thread_Block {
990
PyGILState_STATE state;
992
void end() { if (status) { PyGILState_Release(state); status = false;} }
993
SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
994
~SWIG_Python_Thread_Block() { end(); }
996
class SWIG_Python_Thread_Allow {
1000
void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
1001
SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
1002
~SWIG_Python_Thread_Allow() { end(); }
1004
# define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block
1005
# define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end()
1006
# define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow
1007
# define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end()
1009
# define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
1010
# define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block)
1011
# define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread()
1012
# define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow)
1014
# else /* Old thread way, not implemented, user must provide it */
1015
# if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
1016
# define SWIG_PYTHON_INITIALIZE_THREADS
1018
# if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
1019
# define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1021
# if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
1022
# define SWIG_PYTHON_THREAD_END_BLOCK
1024
# if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
1025
# define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1027
# if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
1028
# define SWIG_PYTHON_THREAD_END_ALLOW
1031
#else /* No thread support */
1032
# define SWIG_PYTHON_INITIALIZE_THREADS
1033
# define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1034
# define SWIG_PYTHON_THREAD_END_BLOCK
1035
# define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1036
# define SWIG_PYTHON_THREAD_END_ALLOW
1039
/* -----------------------------------------------------------------------------
1040
* Python API portion that goes into the runtime
1041
* ----------------------------------------------------------------------------- */
1050
/* -----------------------------------------------------------------------------
1051
* Constant declarations
1052
* ----------------------------------------------------------------------------- */
1054
/* Constant Types */
1055
#define SWIG_PY_POINTER 4
1056
#define SWIG_PY_BINARY 5
1058
/* Constant information structure */
1059
typedef struct swig_const_info {
1065
swig_type_info **ptype;
1069
/* -----------------------------------------------------------------------------
1070
* Wrapper of PyInstanceMethod_New() used in Python 3
1071
* It is exported to the generated module, used for -fastproxy
1072
* ----------------------------------------------------------------------------- */
1073
SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *self, PyObject *func)
1075
#if PY_VERSION_HEX >= 0x03000000
1076
return PyInstanceMethod_New(func);
1090
/* -----------------------------------------------------------------------------
1091
* See the LICENSE file for information on copyright, usage and redistribution
1092
* of SWIG, and the README file for authors - http://www.swig.org/release.html.
1096
* This file contains the runtime support for Python modules
1097
* and includes code for managing global variables and pointer
1100
* ----------------------------------------------------------------------------- */
1102
/* Common SWIG API */
1104
/* for raw pointers */
1105
#define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1106
#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags)
1107
#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1108
#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(ptr, type, flags)
1109
#define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty)
1110
#define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src)
1111
#define swig_owntype int
1113
/* for raw packed data */
1114
#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1115
#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
1117
/* for class or struct pointers */
1118
#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
1119
#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
1121
/* for C or C++ function pointers */
1122
#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
1123
#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(ptr, type, 0)
1125
/* for C++ member pointers, ie, member methods */
1126
#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1127
#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
1132
#define SWIG_GetModule(clientdata) SWIG_Python_GetModule()
1133
#define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer)
1134
#define SWIG_NewClientData(obj) SwigPyClientData_New(obj)
1136
#define SWIG_SetErrorObj SWIG_Python_SetErrorObj
1137
#define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg
1138
#define SWIG_ErrorType(code) SWIG_Python_ErrorType(code)
1139
#define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg)
1140
#define SWIG_fail goto fail
1143
/* Runtime API implementation */
1145
/* Error manipulation */
1148
SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
1149
SWIG_PYTHON_THREAD_BEGIN_BLOCK;
1150
PyErr_SetObject(errtype, obj);
1152
SWIG_PYTHON_THREAD_END_BLOCK;
1156
SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
1157
SWIG_PYTHON_THREAD_BEGIN_BLOCK;
1158
PyErr_SetString(errtype, (char *) msg);
1159
SWIG_PYTHON_THREAD_END_BLOCK;
1162
#define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
1164
/* Set a constant value */
1167
SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {
1168
PyDict_SetItemString(d, (char*) name, obj);
1172
/* Append a value to the result obj */
1174
SWIGINTERN PyObject*
1175
SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
1176
#if !defined(SWIG_PYTHON_OUTPUT_TUPLE)
1179
} else if (result == Py_None) {
1183
if (!PyList_Check(result)) {
1184
PyObject *o2 = result;
1185
result = PyList_New(1);
1186
PyList_SetItem(result, 0, o2);
1188
PyList_Append(result,obj);
1197
} else if (result == Py_None) {
1201
if (!PyTuple_Check(result)) {
1203
result = PyTuple_New(1);
1204
PyTuple_SET_ITEM(result, 0, o2);
1206
o3 = PyTuple_New(1);
1207
PyTuple_SET_ITEM(o3, 0, obj);
1209
result = PySequence_Concat(o2, o3);
1217
/* Unpack the argument tuple */
1220
SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
1226
PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none",
1227
name, (min == max ? "" : "at least "), (int)min);
1231
if (!PyTuple_Check(args)) {
1232
PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
1235
register Py_ssize_t l = PyTuple_GET_SIZE(args);
1237
PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1238
name, (min == max ? "" : "at least "), (int)min, (int)l);
1240
} else if (l > max) {
1241
PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1242
name, (min == max ? "" : "at most "), (int)max, (int)l);
1246
for (i = 0; i < l; ++i) {
1247
objs[i] = PyTuple_GET_ITEM(args, i);
1249
for (; l < max; ++l) {
1257
/* A functor is a function object with one single object argument */
1258
#if PY_VERSION_HEX >= 0x02020000
1259
#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL);
1261
#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunction(functor, "O", obj);
1265
Helper for static pointer initialization for both C and C++ code, for example
1266
static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
1269
#define SWIG_STATIC_POINTER(var) var
1271
#define SWIG_STATIC_POINTER(var) var = 0; if (!var) var
1274
/* -----------------------------------------------------------------------------
1275
* Pointer declarations
1276
* ----------------------------------------------------------------------------- */
1278
/* Flags for new pointer objects */
1279
#define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1)
1280
#define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
1282
#define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1)
1291
/* How to access Py_None */
1292
#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
1293
# ifndef SWIG_PYTHON_NO_BUILD_NONE
1294
# ifndef SWIG_PYTHON_BUILD_NONE
1295
# define SWIG_PYTHON_BUILD_NONE
1300
#ifdef SWIG_PYTHON_BUILD_NONE
1303
# define Py_None SWIG_Py_None()
1305
SWIGRUNTIMEINLINE PyObject *
1308
PyObject *none = Py_BuildValue((char*)"");
1312
SWIGRUNTIME PyObject *
1315
static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None();
1320
/* The python void return value */
1322
SWIGRUNTIMEINLINE PyObject *
1325
PyObject *none = Py_None;
1330
/* SwigPyClientData */
1341
SWIGRUNTIMEINLINE int
1342
SWIG_Python_CheckImplicit(swig_type_info *ty)
1344
SwigPyClientData *data = (SwigPyClientData *)ty->clientdata;
1345
return data ? data->implicitconv : 0;
1348
SWIGRUNTIMEINLINE PyObject *
1349
SWIG_Python_ExceptionType(swig_type_info *desc) {
1350
SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0;
1351
PyObject *klass = data ? data->klass : 0;
1352
return (klass ? klass : PyExc_RuntimeError);
1356
SWIGRUNTIME SwigPyClientData *
1357
SwigPyClientData_New(PyObject* obj)
1362
SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData));
1363
/* the klass element */
1365
Py_INCREF(data->klass);
1366
/* the newraw method and newargs arguments used to create a new raw instance */
1367
if (PyClass_Check(obj)) {
1369
data->newargs = obj;
1372
#if (PY_VERSION_HEX < 0x02020000)
1375
data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__");
1378
Py_INCREF(data->newraw);
1379
data->newargs = PyTuple_New(1);
1380
PyTuple_SetItem(data->newargs, 0, obj);
1382
data->newargs = obj;
1384
Py_INCREF(data->newargs);
1386
/* the destroy method, aka as the C++ delete method */
1387
data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__");
1388
if (PyErr_Occurred()) {
1392
if (data->destroy) {
1394
Py_INCREF(data->destroy);
1395
flags = PyCFunction_GET_FLAGS(data->destroy);
1397
data->delargs = !(flags & (METH_O));
1404
data->implicitconv = 0;
1410
SwigPyClientData_Del(SwigPyClientData* data)
1412
Py_XDECREF(data->newraw);
1413
Py_XDECREF(data->newargs);
1414
Py_XDECREF(data->destroy);
1417
/* =============== SwigPyObject =====================*/
1427
SWIGRUNTIME PyObject *
1428
SwigPyObject_long(SwigPyObject *v)
1430
return PyLong_FromVoidPtr(v->ptr);
1433
SWIGRUNTIME PyObject *
1434
SwigPyObject_format(const char* fmt, SwigPyObject *v)
1436
PyObject *res = NULL;
1437
PyObject *args = PyTuple_New(1);
1439
if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) {
1440
PyObject *ofmt = SWIG_Python_str_FromChar(fmt);
1442
#if PY_VERSION_HEX >= 0x03000000
1443
res = PyUnicode_Format(ofmt,args);
1445
res = PyString_Format(ofmt,args);
1455
SWIGRUNTIME PyObject *
1456
SwigPyObject_oct(SwigPyObject *v)
1458
return SwigPyObject_format("%o",v);
1461
SWIGRUNTIME PyObject *
1462
SwigPyObject_hex(SwigPyObject *v)
1464
return SwigPyObject_format("%x",v);
1467
SWIGRUNTIME PyObject *
1469
SwigPyObject_repr(SwigPyObject *v)
1471
SwigPyObject_repr(SwigPyObject *v, PyObject *args)
1474
const char *name = SWIG_TypePrettyName(v->ty);
1475
PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", name, v);
1478
PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
1480
PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args);
1482
#if PY_VERSION_HEX >= 0x03000000
1483
PyObject *joined = PyUnicode_Concat(repr, nrep);
1488
PyString_ConcatAndDel(&repr,nrep);
1495
SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags))
1499
PyObject *repr = SwigPyObject_repr(v);
1501
PyObject *repr = SwigPyObject_repr(v, NULL);
1504
str = SWIG_Python_str_AsChar(repr);
1506
SWIG_Python_str_DelForPy3(str);
1514
SWIGRUNTIME PyObject *
1515
SwigPyObject_str(SwigPyObject *v)
1517
char result[SWIG_BUFFER_SIZE];
1518
return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ?
1519
SWIG_Python_str_FromChar(result) : 0;
1523
SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
1527
return (i < j) ? -1 : ((i > j) ? 1 : 0);
1530
/* Added for Python 3.x, would it also be useful for Python 2.x? */
1531
SWIGRUNTIME PyObject*
1532
SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
1535
if( op != Py_EQ && op != Py_NE ) {
1536
Py_INCREF(Py_NotImplemented);
1537
return Py_NotImplemented;
1539
if( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) )
1548
SWIGRUNTIME PyTypeObject* _PySwigObject_type(void);
1550
SWIGRUNTIME PyTypeObject*
1551
SwigPyObject_type(void) {
1552
static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type();
1556
SWIGRUNTIMEINLINE int
1557
SwigPyObject_Check(PyObject *op) {
1558
return (Py_TYPE(op) == SwigPyObject_type())
1559
|| (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
1562
SWIGRUNTIME PyObject *
1563
SwigPyObject_New(void *ptr, swig_type_info *ty, int own);
1566
SwigPyObject_dealloc(PyObject *v)
1568
SwigPyObject *sobj = (SwigPyObject *) v;
1569
PyObject *next = sobj->next;
1570
if (sobj->own == SWIG_POINTER_OWN) {
1571
swig_type_info *ty = sobj->ty;
1572
SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
1573
PyObject *destroy = data ? data->destroy : 0;
1575
/* destroy is always a VARARGS method */
1577
if (data->delargs) {
1578
/* we need to create a temporary object to carry the destroy operation */
1579
PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
1580
res = SWIG_Python_CallFunctor(destroy, tmp);
1583
PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
1584
PyObject *mself = PyCFunction_GET_SELF(destroy);
1585
res = ((*meth)(mself, v));
1589
#if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
1591
const char *name = SWIG_TypePrettyName(ty);
1592
printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
1600
SWIGRUNTIME PyObject*
1601
SwigPyObject_append(PyObject* v, PyObject* next)
1603
SwigPyObject *sobj = (SwigPyObject *) v;
1606
if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL;
1609
if (!SwigPyObject_Check(next)) {
1614
return SWIG_Py_Void();
1617
SWIGRUNTIME PyObject*
1619
SwigPyObject_next(PyObject* v)
1621
SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1624
SwigPyObject *sobj = (SwigPyObject *) v;
1626
Py_INCREF(sobj->next);
1629
return SWIG_Py_Void();
1633
SWIGINTERN PyObject*
1635
SwigPyObject_disown(PyObject *v)
1637
SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1640
SwigPyObject *sobj = (SwigPyObject *)v;
1642
return SWIG_Py_Void();
1645
SWIGINTERN PyObject*
1647
SwigPyObject_acquire(PyObject *v)
1649
SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1652
SwigPyObject *sobj = (SwigPyObject *)v;
1653
sobj->own = SWIG_POINTER_OWN;
1654
return SWIG_Py_Void();
1657
SWIGINTERN PyObject*
1658
SwigPyObject_own(PyObject *v, PyObject *args)
1661
#if (PY_VERSION_HEX < 0x02020000)
1662
if (!PyArg_ParseTuple(args,(char *)"|O:own",&val))
1664
if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val))
1671
SwigPyObject *sobj = (SwigPyObject *)v;
1672
PyObject *obj = PyBool_FromLong(sobj->own);
1675
if (PyObject_IsTrue(val)) {
1676
SwigPyObject_acquire(v);
1678
SwigPyObject_disown(v);
1681
if (PyObject_IsTrue(val)) {
1682
SwigPyObject_acquire(v,args);
1684
SwigPyObject_disown(v,args);
1694
swigobject_methods[] = {
1695
{(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"},
1696
{(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"},
1697
{(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
1698
{(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"},
1699
{(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"},
1700
{(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"},
1705
swigobject_methods[] = {
1706
{(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"},
1707
{(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"},
1708
{(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
1709
{(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"},
1710
{(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"},
1711
{(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"},
1716
#if PY_VERSION_HEX < 0x02020000
1717
SWIGINTERN PyObject *
1718
SwigPyObject_getattr(SwigPyObject *sobj,char *name)
1720
return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name);
1724
SWIGRUNTIME PyTypeObject*
1725
_PySwigObject_type(void) {
1726
static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
1728
static PyNumberMethods SwigPyObject_as_number = {
1729
(binaryfunc)0, /*nb_add*/
1730
(binaryfunc)0, /*nb_subtract*/
1731
(binaryfunc)0, /*nb_multiply*/
1732
/* nb_divide removed in Python 3 */
1733
#if PY_VERSION_HEX < 0x03000000
1734
(binaryfunc)0, /*nb_divide*/
1736
(binaryfunc)0, /*nb_remainder*/
1737
(binaryfunc)0, /*nb_divmod*/
1738
(ternaryfunc)0,/*nb_power*/
1739
(unaryfunc)0, /*nb_negative*/
1740
(unaryfunc)0, /*nb_positive*/
1741
(unaryfunc)0, /*nb_absolute*/
1742
(inquiry)0, /*nb_nonzero*/
1749
#if PY_VERSION_HEX < 0x03000000
1752
(unaryfunc)SwigPyObject_long, /*nb_int*/
1753
#if PY_VERSION_HEX < 0x03000000
1754
(unaryfunc)SwigPyObject_long, /*nb_long*/
1758
(unaryfunc)0, /*nb_float*/
1759
#if PY_VERSION_HEX < 0x03000000
1760
(unaryfunc)SwigPyObject_oct, /*nb_oct*/
1761
(unaryfunc)SwigPyObject_hex, /*nb_hex*/
1763
#if PY_VERSION_HEX >= 0x03000000 /* 3.0 */
1764
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
1765
#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */
1766
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
1767
#elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */
1768
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */
1769
#elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */
1770
0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */
1774
static PyTypeObject swigpyobject_type;
1775
static int type_init = 0;
1777
const PyTypeObject tmp
1779
/* PyObject header changed in Python 3 */
1780
#if PY_VERSION_HEX >= 0x03000000
1781
PyVarObject_HEAD_INIT(&PyType_Type, 0)
1783
PyObject_HEAD_INIT(NULL)
1786
(char *)"SwigPyObject", /* tp_name */
1787
sizeof(SwigPyObject), /* tp_basicsize */
1788
0, /* tp_itemsize */
1789
(destructor)SwigPyObject_dealloc, /* tp_dealloc */
1790
(printfunc)SwigPyObject_print, /* tp_print */
1791
#if PY_VERSION_HEX < 0x02020000
1792
(getattrfunc)SwigPyObject_getattr, /* tp_getattr */
1794
(getattrfunc)0, /* tp_getattr */
1796
(setattrfunc)0, /* tp_setattr */
1797
#if PY_VERSION_HEX >= 0x03000000
1798
0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
1800
(cmpfunc)SwigPyObject_compare, /* tp_compare */
1802
(reprfunc)SwigPyObject_repr, /* tp_repr */
1803
&SwigPyObject_as_number, /* tp_as_number */
1804
0, /* tp_as_sequence */
1805
0, /* tp_as_mapping */
1806
(hashfunc)0, /* tp_hash */
1807
(ternaryfunc)0, /* tp_call */
1808
(reprfunc)SwigPyObject_str, /* tp_str */
1809
PyObject_GenericGetAttr, /* tp_getattro */
1810
0, /* tp_setattro */
1811
0, /* tp_as_buffer */
1812
Py_TPFLAGS_DEFAULT, /* tp_flags */
1813
swigobject_doc, /* tp_doc */
1814
0, /* tp_traverse */
1816
(richcmpfunc)SwigPyObject_richcompare, /* tp_richcompare */
1817
0, /* tp_weaklistoffset */
1818
#if PY_VERSION_HEX >= 0x02020000
1820
0, /* tp_iternext */
1821
swigobject_methods, /* tp_methods */
1826
0, /* tp_descr_get */
1827
0, /* tp_descr_set */
1828
0, /* tp_dictoffset */
1837
0, /* tp_subclasses */
1838
0, /* tp_weaklist */
1840
#if PY_VERSION_HEX >= 0x02030000
1844
0,0,0,0 /* tp_alloc -> tp_next */
1847
swigpyobject_type = tmp;
1848
/* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */
1849
#if PY_VERSION_HEX < 0x03000000
1850
swigpyobject_type.ob_type = &PyType_Type;
1854
return &swigpyobject_type;
1857
SWIGRUNTIME PyObject *
1858
SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
1860
SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type());
1867
return (PyObject *)sobj;
1870
/* -----------------------------------------------------------------------------
1871
* Implements a simple Swig Packed type, and use it instead of string
1872
* ----------------------------------------------------------------------------- */
1882
SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
1884
char result[SWIG_BUFFER_SIZE];
1885
fputs("<Swig Packed ", fp);
1886
if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
1890
fputs(v->ty->name,fp);
1895
SWIGRUNTIME PyObject *
1896
SwigPyPacked_repr(SwigPyPacked *v)
1898
char result[SWIG_BUFFER_SIZE];
1899
if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
1900
return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
1902
return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
1906
SWIGRUNTIME PyObject *
1907
SwigPyPacked_str(SwigPyPacked *v)
1909
char result[SWIG_BUFFER_SIZE];
1910
if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
1911
return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name);
1913
return SWIG_Python_str_FromChar(v->ty->name);
1918
SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
1922
int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
1923
return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size);
1926
SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void);
1928
SWIGRUNTIME PyTypeObject*
1929
SwigPyPacked_type(void) {
1930
static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigPacked_type();
1934
SWIGRUNTIMEINLINE int
1935
SwigPyPacked_Check(PyObject *op) {
1936
return ((op)->ob_type == _PySwigPacked_type())
1937
|| (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
1941
SwigPyPacked_dealloc(PyObject *v)
1943
if (SwigPyPacked_Check(v)) {
1944
SwigPyPacked *sobj = (SwigPyPacked *) v;
1950
SWIGRUNTIME PyTypeObject*
1951
_PySwigPacked_type(void) {
1952
static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
1953
static PyTypeObject swigpypacked_type;
1954
static int type_init = 0;
1956
const PyTypeObject tmp
1958
/* PyObject header changed in Python 3 */
1959
#if PY_VERSION_HEX>=0x03000000
1960
PyVarObject_HEAD_INIT(&PyType_Type, 0)
1962
PyObject_HEAD_INIT(NULL)
1965
(char *)"SwigPyPacked", /* tp_name */
1966
sizeof(SwigPyPacked), /* tp_basicsize */
1967
0, /* tp_itemsize */
1968
(destructor)SwigPyPacked_dealloc, /* tp_dealloc */
1969
(printfunc)SwigPyPacked_print, /* tp_print */
1970
(getattrfunc)0, /* tp_getattr */
1971
(setattrfunc)0, /* tp_setattr */
1972
#if PY_VERSION_HEX>=0x03000000
1973
0, /* tp_reserved in 3.0.1 */
1975
(cmpfunc)SwigPyPacked_compare, /* tp_compare */
1977
(reprfunc)SwigPyPacked_repr, /* tp_repr */
1978
0, /* tp_as_number */
1979
0, /* tp_as_sequence */
1980
0, /* tp_as_mapping */
1981
(hashfunc)0, /* tp_hash */
1982
(ternaryfunc)0, /* tp_call */
1983
(reprfunc)SwigPyPacked_str, /* tp_str */
1984
PyObject_GenericGetAttr, /* tp_getattro */
1985
0, /* tp_setattro */
1986
0, /* tp_as_buffer */
1987
Py_TPFLAGS_DEFAULT, /* tp_flags */
1988
swigpacked_doc, /* tp_doc */
1989
0, /* tp_traverse */
1991
0, /* tp_richcompare */
1992
0, /* tp_weaklistoffset */
1993
#if PY_VERSION_HEX >= 0x02020000
1995
0, /* tp_iternext */
2001
0, /* tp_descr_get */
2002
0, /* tp_descr_set */
2003
0, /* tp_dictoffset */
2012
0, /* tp_subclasses */
2013
0, /* tp_weaklist */
2015
#if PY_VERSION_HEX >= 0x02030000
2019
0,0,0,0 /* tp_alloc -> tp_next */
2022
swigpypacked_type = tmp;
2023
/* for Python 3 the ob_type already assigned in PyVarObject_HEAD_INIT() */
2024
#if PY_VERSION_HEX < 0x03000000
2025
swigpypacked_type.ob_type = &PyType_Type;
2029
return &swigpypacked_type;
2032
SWIGRUNTIME PyObject *
2033
SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
2035
SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type());
2037
void *pack = malloc(size);
2039
memcpy(pack, ptr, size);
2044
PyObject_DEL((PyObject *) sobj);
2048
return (PyObject *) sobj;
2051
SWIGRUNTIME swig_type_info *
2052
SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
2054
if (SwigPyPacked_Check(obj)) {
2055
SwigPyPacked *sobj = (SwigPyPacked *)obj;
2056
if (sobj->size != size) return 0;
2057
memcpy(ptr, sobj->pack, size);
2064
/* -----------------------------------------------------------------------------
2065
* pointers/data manipulation
2066
* ----------------------------------------------------------------------------- */
2068
SWIGRUNTIMEINLINE PyObject *
2071
return SWIG_Python_str_FromChar("this");
2074
SWIGRUNTIME PyObject *
2077
static PyObject *SWIG_STATIC_POINTER(swig_this) = _SWIG_This();
2081
/* #define SWIG_PYTHON_SLOW_GETSET_THIS */
2083
/* TODO: I don't know how to implement the fast getset in Python 3 right now */
2084
#if PY_VERSION_HEX>=0x03000000
2085
#define SWIG_PYTHON_SLOW_GETSET_THIS
2088
SWIGRUNTIME SwigPyObject *
2089
SWIG_Python_GetSwigThis(PyObject *pyobj)
2091
if (SwigPyObject_Check(pyobj)) {
2092
return (SwigPyObject *) pyobj;
2095
#if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000))
2096
if (PyInstance_Check(pyobj)) {
2097
obj = _PyInstance_Lookup(pyobj, SWIG_This());
2099
PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
2100
if (dictptr != NULL) {
2101
PyObject *dict = *dictptr;
2102
obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
2104
#ifdef PyWeakref_CheckProxy
2105
if (PyWeakref_CheckProxy(pyobj)) {
2106
PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
2107
return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
2110
obj = PyObject_GetAttr(pyobj,SWIG_This());
2114
if (PyErr_Occurred()) PyErr_Clear();
2120
obj = PyObject_GetAttr(pyobj,SWIG_This());
2124
if (PyErr_Occurred()) PyErr_Clear();
2128
if (obj && !SwigPyObject_Check(obj)) {
2129
/* a PyObject is called 'this', try to get the 'real this'
2130
SwigPyObject from it */
2131
return SWIG_Python_GetSwigThis(obj);
2133
return (SwigPyObject *)obj;
2137
/* Acquire a pointer value */
2140
SWIG_Python_AcquirePtr(PyObject *obj, int own) {
2141
if (own == SWIG_POINTER_OWN) {
2142
SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
2144
int oldown = sobj->own;
2152
/* Convert a pointer value */
2155
SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
2156
if (!obj) return SWIG_ERROR;
2157
if (obj == Py_None) {
2161
SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
2165
void *vptr = sobj->ptr;
2167
swig_type_info *to = sobj->ty;
2169
/* no type cast needed */
2170
if (ptr) *ptr = vptr;
2173
swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2175
sobj = (SwigPyObject *)sobj->next;
2179
*ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2180
if (newmemory == SWIG_CAST_NEW_MEMORY) {
2183
*own = *own | SWIG_CAST_NEW_MEMORY;
2190
if (ptr) *ptr = vptr;
2196
*own = *own | sobj->own;
2197
if (flags & SWIG_POINTER_DISOWN) {
2202
int res = SWIG_ERROR;
2203
if (flags & SWIG_POINTER_IMPLICIT_CONV) {
2204
SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
2205
if (data && !data->implicitconv) {
2206
PyObject *klass = data->klass;
2209
data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
2210
impconv = SWIG_Python_CallFunctor(klass, obj);
2211
data->implicitconv = 0;
2212
if (PyErr_Occurred()) {
2217
SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
2220
res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
2221
if (SWIG_IsOK(res)) {
2224
/* transfer the ownership to 'ptr' */
2226
res = SWIG_AddCast(res);
2227
res = SWIG_AddNewMask(res);
2229
res = SWIG_AddCast(res);
2243
/* Convert a function ptr value */
2246
SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
2247
if (!PyCFunction_Check(obj)) {
2248
return SWIG_ConvertPtr(obj, ptr, ty, 0);
2252
/* here we get the method pointer for callbacks */
2253
const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
2254
const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
2256
desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
2260
swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
2263
*ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2264
assert(!newmemory); /* newmemory handling not yet implemented */
2275
/* Convert a packed value value */
2278
SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
2279
swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz);
2280
if (!to) return SWIG_ERROR;
2283
/* check type cast? */
2284
swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2285
if (!tc) return SWIG_ERROR;
2291
/* -----------------------------------------------------------------------------
2292
* Create a new pointer object
2293
* ----------------------------------------------------------------------------- */
2296
Create a new instance object, without calling __init__, and set the
2300
SWIGRUNTIME PyObject*
2301
SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
2303
#if (PY_VERSION_HEX >= 0x02020000)
2305
PyObject *newraw = data->newraw;
2307
inst = PyObject_Call(newraw, data->newargs, NULL);
2309
#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2310
PyObject **dictptr = _PyObject_GetDictPtr(inst);
2311
if (dictptr != NULL) {
2312
PyObject *dict = *dictptr;
2314
dict = PyDict_New();
2316
PyDict_SetItem(dict, SWIG_This(), swig_this);
2320
PyObject *key = SWIG_This();
2321
PyObject_SetAttr(inst, key, swig_this);
2325
#if PY_VERSION_HEX >= 0x03000000
2326
inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None);
2327
PyObject_SetAttr(inst, SWIG_This(), swig_this);
2328
Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
2330
PyObject *dict = PyDict_New();
2331
PyDict_SetItem(dict, SWIG_This(), swig_this);
2332
inst = PyInstance_NewRaw(data->newargs, dict);
2338
#if (PY_VERSION_HEX >= 0x02010000)
2340
PyObject *dict = PyDict_New();
2341
PyDict_SetItem(dict, SWIG_This(), swig_this);
2342
inst = PyInstance_NewRaw(data->newargs, dict);
2344
return (PyObject *) inst;
2346
PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type);
2350
inst->in_class = (PyClassObject *)data->newargs;
2351
Py_INCREF(inst->in_class);
2352
inst->in_dict = PyDict_New();
2353
if (inst->in_dict == NULL) {
2357
#ifdef Py_TPFLAGS_HAVE_WEAKREFS
2358
inst->in_weakreflist = NULL;
2360
#ifdef Py_TPFLAGS_GC
2361
PyObject_GC_Init(inst);
2363
PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this);
2364
return (PyObject *) inst;
2370
SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
2373
#if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2374
PyObject **dictptr = _PyObject_GetDictPtr(inst);
2375
if (dictptr != NULL) {
2378
dict = PyDict_New();
2381
PyDict_SetItem(dict, SWIG_This(), swig_this);
2385
dict = PyObject_GetAttrString(inst, (char*)"__dict__");
2386
PyDict_SetItem(dict, SWIG_This(), swig_this);
2391
SWIGINTERN PyObject *
2392
SWIG_Python_InitShadowInstance(PyObject *args) {
2394
if (!SWIG_Python_UnpackTuple(args,(char*)"swiginit", 2, 2, obj)) {
2397
SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
2399
SwigPyObject_append((PyObject*) sthis, obj[1]);
2401
SWIG_Python_SetSwigThis(obj[0], obj[1]);
2403
return SWIG_Py_Void();
2407
/* Create a new pointer object */
2409
SWIGRUNTIME PyObject *
2410
SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) {
2412
return SWIG_Py_Void();
2414
int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
2415
PyObject *robj = SwigPyObject_New(ptr, type, own);
2416
SwigPyClientData *clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
2417
if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
2418
PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
2428
/* Create a new packed object */
2430
SWIGRUNTIMEINLINE PyObject *
2431
SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
2432
return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
2435
/* -----------------------------------------------------------------------------*
2437
* -----------------------------------------------------------------------------*/
2439
#ifdef SWIG_LINK_RUNTIME
2440
void *SWIG_ReturnGlobalTypeList(void *);
2443
SWIGRUNTIME swig_module_info *
2444
SWIG_Python_GetModule(void) {
2445
static void *type_pointer = (void *)0;
2446
/* first check if module already created */
2447
if (!type_pointer) {
2448
#ifdef SWIG_LINK_RUNTIME
2449
type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
2451
type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
2452
(char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
2453
if (PyErr_Occurred()) {
2455
type_pointer = (void *)0;
2459
return (swig_module_info *) type_pointer;
2462
#if PY_MAJOR_VERSION < 2
2463
/* PyModule_AddObject function was introduced in Python 2.0. The following function
2464
is copied out of Python/modsupport.c in python version 2.3.4 */
2466
PyModule_AddObject(PyObject *m, char *name, PyObject *o)
2469
if (!PyModule_Check(m)) {
2470
PyErr_SetString(PyExc_TypeError,
2471
"PyModule_AddObject() needs module as first arg");
2475
PyErr_SetString(PyExc_TypeError,
2476
"PyModule_AddObject() needs non-NULL value");
2480
dict = PyModule_GetDict(m);
2482
/* Internal error -- modules must have a dict! */
2483
PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__",
2484
PyModule_GetName(m));
2487
if (PyDict_SetItemString(dict, name, o))
2495
SWIG_Python_DestroyModule(void *vptr)
2497
swig_module_info *swig_module = (swig_module_info *) vptr;
2498
swig_type_info **types = swig_module->types;
2500
for (i =0; i < swig_module->size; ++i) {
2501
swig_type_info *ty = types[i];
2503
SwigPyClientData *data = (SwigPyClientData *) ty->clientdata;
2504
if (data) SwigPyClientData_Del(data);
2507
Py_DECREF(SWIG_This());
2511
SWIG_Python_SetModule(swig_module_info *swig_module) {
2512
static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */
2514
#if PY_VERSION_HEX >= 0x03000000
2515
/* Add a dummy module object into sys.modules */
2516
PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION);
2518
PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
2519
swig_empty_runtime_method_table);
2521
PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
2522
if (pointer && module) {
2523
PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
2525
Py_XDECREF(pointer);
2529
/* The python cached type query */
2530
SWIGRUNTIME PyObject *
2531
SWIG_Python_TypeCache(void) {
2532
static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
2536
SWIGRUNTIME swig_type_info *
2537
SWIG_Python_TypeQuery(const char *type)
2539
PyObject *cache = SWIG_Python_TypeCache();
2540
PyObject *key = SWIG_Python_str_FromChar(type);
2541
PyObject *obj = PyDict_GetItem(cache, key);
2542
swig_type_info *descriptor;
2544
descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
2546
swig_module_info *swig_module = SWIG_Python_GetModule();
2547
descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
2549
obj = PyCObject_FromVoidPtr(descriptor, NULL);
2550
PyDict_SetItem(cache, key, obj);
2559
For backward compatibility only
2561
#define SWIG_POINTER_EXCEPTION 0
2562
#define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg)
2563
#define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags)
2566
SWIG_Python_AddErrMesg(const char* mesg, int infront)
2568
if (PyErr_Occurred()) {
2570
PyObject *value = 0;
2571
PyObject *traceback = 0;
2572
PyErr_Fetch(&type, &value, &traceback);
2575
PyObject *old_str = PyObject_Str(value);
2579
PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str));
2581
PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
2583
SWIG_Python_str_DelForPy3(tmp);
2593
SWIG_Python_ArgFail(int argnum)
2595
if (PyErr_Occurred()) {
2596
/* add information about failing argument */
2598
PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
2599
return SWIG_Python_AddErrMesg(mesg, 1);
2605
SWIGRUNTIMEINLINE const char *
2606
SwigPyObject_GetDesc(PyObject *self)
2608
SwigPyObject *v = (SwigPyObject *)self;
2609
swig_type_info *ty = v ? v->ty : 0;
2610
return ty ? ty->str : (char*)"";
2614
SWIG_Python_TypeError(const char *type, PyObject *obj)
2617
#if defined(SWIG_COBJECT_TYPES)
2618
if (obj && SwigPyObject_Check(obj)) {
2619
const char *otype = (const char *) SwigPyObject_GetDesc(obj);
2621
PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received",
2628
const char *otype = (obj ? obj->ob_type->tp_name : 0);
2630
PyObject *str = PyObject_Str(obj);
2631
const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0;
2633
PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
2635
SWIG_Python_str_DelForPy3(cstr);
2637
PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
2644
PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
2646
PyErr_Format(PyExc_TypeError, "unexpected type is received");
2651
/* Convert a pointer value, signal an exception on a type mismatch */
2653
SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) {
2655
if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
2657
#if SWIG_POINTER_EXCEPTION
2659
SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
2660
SWIG_Python_ArgFail(argnum);
2677
#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
2679
#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
2683
/* -------- TYPES TABLE (BEGIN) -------- */
2685
#define SWIGTYPE_p_EST_Item swig_types[0]
2686
#define SWIGTYPE_p_EST_Relation swig_types[1]
2687
#define SWIGTYPE_p_EST_Utterance swig_types[2]
2688
#define SWIGTYPE_p_char swig_types[3]
2689
#define SWIGTYPE_p_p_EST_Item swig_types[4]
2690
static swig_type_info *swig_types[6];
2691
static swig_module_info swig_module = {swig_types, 5, 0, 0, 0, 0};
2692
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
2693
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
2695
/* -------- TYPES TABLE (END) -------- */
2697
#if (PY_VERSION_HEX <= 0x02000000)
2698
# if !defined(SWIG_PYTHON_CLASSIC)
2699
# error "This python version requires swig to be run with the '-classic' option"
2703
/*-----------------------------------------------
2704
@(target):= _EST_Relation.so
2705
------------------------------------------------*/
2706
#if PY_VERSION_HEX >= 0x03000000
2707
# define SWIG_init PyInit__EST_Relation
2710
# define SWIG_init init_EST_Relation
2713
#define SWIG_name "_EST_Relation"
2715
#define SWIGVERSION 0x010340
2716
#define SWIG_VERSION SWIGVERSION
2719
#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
2720
#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
2723
#include <stdexcept>
2727
class SwigPtr_PyObject {
2732
SwigPtr_PyObject() :_obj(0)
2736
SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj)
2741
SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj)
2748
SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item)
2750
Py_XINCREF(item._obj);
2761
operator PyObject *() const
2766
PyObject *operator->() const
2775
struct SwigVar_PyObject : SwigPtr_PyObject {
2776
SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { }
2778
SwigVar_PyObject & operator = (PyObject* obj)
2788
#include "ling_class/EST_Relation.h"
2789
#include "ling_class/EST_Item.h"
2792
#include "EST_rw_status.h"
2795
#define SWIG_From_long PyInt_FromLong
2798
SWIGINTERNINLINE PyObject *
2799
SWIG_From_int (int value)
2801
return SWIG_From_long (value);
2805
#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
2806
typedef int Py_ssize_t;
2807
#define PY_SSIZE_T_MAX INT_MAX
2808
#define PY_SSIZE_T_MIN INT_MIN
2812
SWIGINTERN swig_type_info*
2813
SWIG_pchar_descriptor(void)
2815
static int init = 0;
2816
static swig_type_info* info = 0;
2818
info = SWIG_TypeQuery("_p_char");
2826
SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
2828
#if PY_VERSION_HEX>=0x03000000
2829
if (PyUnicode_Check(obj))
2831
if (PyString_Check(obj))
2834
char *cstr; Py_ssize_t len;
2835
#if PY_VERSION_HEX>=0x03000000
2836
if (!alloc && cptr) {
2837
/* We can't allow converting without allocation, since the internal
2838
representation of string in Python 3 is UCS-2/UCS-4 but we require
2839
a UTF-8 representation.
2840
TODO(bhy) More detailed explanation */
2841
return SWIG_RuntimeError;
2843
obj = PyUnicode_AsUTF8String(obj);
2844
PyBytes_AsStringAndSize(obj, &cstr, &len);
2845
if(alloc) *alloc = SWIG_NEWOBJ;
2847
PyString_AsStringAndSize(obj, &cstr, &len);
2852
In python the user should not be able to modify the inner
2853
string representation. To warranty that, if you define
2854
SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string
2855
buffer is always returned.
2857
The default behavior is just to return the pointer value,
2860
#if defined(SWIG_PYTHON_SAFE_CSTRINGS)
2861
if (*alloc != SWIG_OLDOBJ)
2863
if (*alloc == SWIG_NEWOBJ)
2866
*cptr = reinterpret_cast< char* >(memcpy((new char[len + 1]), cstr, sizeof(char)*(len + 1)));
2867
*alloc = SWIG_NEWOBJ;
2871
*alloc = SWIG_OLDOBJ;
2874
#if PY_VERSION_HEX>=0x03000000
2875
assert(0); /* Should never reach here in Python 3 */
2877
*cptr = SWIG_Python_str_AsChar(obj);
2880
if (psize) *psize = len + 1;
2881
#if PY_VERSION_HEX>=0x03000000
2886
swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
2887
if (pchar_descriptor) {
2889
if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
2890
if (cptr) *cptr = (char *) vptr;
2891
if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0;
2892
if (alloc) *alloc = SWIG_OLDOBJ;
2897
return SWIG_TypeError;
2905
SWIG_AsVal_double (PyObject *obj, double *val)
2907
int res = SWIG_TypeError;
2908
if (PyFloat_Check(obj)) {
2909
if (val) *val = PyFloat_AsDouble(obj);
2911
} else if (PyInt_Check(obj)) {
2912
if (val) *val = PyInt_AsLong(obj);
2914
} else if (PyLong_Check(obj)) {
2915
double v = PyLong_AsDouble(obj);
2916
if (!PyErr_Occurred()) {
2923
#ifdef SWIG_PYTHON_CAST_MODE
2926
double d = PyFloat_AsDouble(obj);
2927
if (!PyErr_Occurred()) {
2929
return SWIG_AddCast(SWIG_OK);
2934
long v = PyLong_AsLong(obj);
2935
if (!PyErr_Occurred()) {
2937
return SWIG_AddCast(SWIG_AddCast(SWIG_OK));
2954
SWIGINTERNINLINE int
2955
SWIG_CanCastAsInteger(double *d, double min, double max) {
2957
if ((min <= x && x <= max)) {
2958
double fx = floor(x);
2959
double cx = ceil(x);
2960
double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */
2961
if ((errno == EDOM) || (errno == ERANGE)) {
2964
double summ, reps, diff;
2967
} else if (rd > x) {
2974
if (reps < 8*DBL_EPSILON) {
2985
SWIG_AsVal_long (PyObject *obj, long* val)
2987
if (PyInt_Check(obj)) {
2988
if (val) *val = PyInt_AsLong(obj);
2990
} else if (PyLong_Check(obj)) {
2991
long v = PyLong_AsLong(obj);
2992
if (!PyErr_Occurred()) {
2999
#ifdef SWIG_PYTHON_CAST_MODE
3002
long v = PyInt_AsLong(obj);
3003
if (!PyErr_Occurred()) {
3005
return SWIG_AddCast(SWIG_OK);
3011
int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
3012
if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
3013
if (val) *val = (long)(d);
3019
return SWIG_TypeError;
3024
SWIG_AsVal_bool (PyObject *obj, bool *val)
3026
int r = PyObject_IsTrue(obj);
3029
if (val) *val = r ? true : false;
3033
SWIGINTERN void EST_Relation_items(EST_Relation *self,EST_Item **ITEMLISTOUT){
3034
*ITEMLISTOUT = self->first();
3039
SWIGINTERN PyObject *_wrap_new_EST_Relation__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3040
PyObject *resultobj = 0;
3041
EST_Relation *result = 0 ;
3043
if (!PyArg_ParseTuple(args,(char *)":new_EST_Relation")) SWIG_fail;
3044
result = (EST_Relation *)new EST_Relation();
3045
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EST_Relation, SWIG_POINTER_NEW | 0 );
3052
SWIGINTERN PyObject *_wrap_new_EST_Relation__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3053
PyObject *resultobj = 0;
3054
char *arg1 = (char *) 0 ;
3058
PyObject * obj0 = 0 ;
3059
EST_Relation *result = 0 ;
3061
if (!PyArg_ParseTuple(args,(char *)"O:new_EST_Relation",&obj0)) SWIG_fail;
3062
res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
3063
if (!SWIG_IsOK(res1)) {
3064
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_EST_Relation" "', argument " "1"" of type '" "char const *""'");
3066
arg1 = reinterpret_cast< char * >(buf1);
3067
result = (EST_Relation *)new EST_Relation((char const *)arg1);
3068
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EST_Relation, SWIG_POINTER_NEW | 0 );
3069
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
3072
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
3077
SWIGINTERN PyObject *_wrap_new_EST_Relation__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3078
PyObject *resultobj = 0;
3079
EST_Relation *arg1 = 0 ;
3082
PyObject * obj0 = 0 ;
3083
EST_Relation *result = 0 ;
3085
if (!PyArg_ParseTuple(args,(char *)"O:new_EST_Relation",&obj0)) SWIG_fail;
3086
res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_EST_Relation, 0 | 0);
3087
if (!SWIG_IsOK(res1)) {
3088
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_EST_Relation" "', argument " "1"" of type '" "EST_Relation const &""'");
3091
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_EST_Relation" "', argument " "1"" of type '" "EST_Relation const &""'");
3093
arg1 = reinterpret_cast< EST_Relation * >(argp1);
3094
result = (EST_Relation *)new EST_Relation((EST_Relation const &)*arg1);
3095
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EST_Relation, SWIG_POINTER_NEW | 0 );
3102
SWIGINTERN PyObject *_wrap_new_EST_Relation(PyObject *self, PyObject *args) {
3107
if (!PyTuple_Check(args)) SWIG_fail;
3108
argc = (int)PyObject_Length(args);
3109
for (ii = 0; (ii < argc) && (ii < 1); ii++) {
3110
argv[ii] = PyTuple_GET_ITEM(args,ii);
3113
return _wrap_new_EST_Relation__SWIG_0(self, args);
3117
int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_EST_Relation, 0);
3118
_v = SWIG_CheckState(res);
3120
return _wrap_new_EST_Relation__SWIG_2(self, args);
3125
int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
3126
_v = SWIG_CheckState(res);
3128
return _wrap_new_EST_Relation__SWIG_1(self, args);
3133
SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_EST_Relation'.\n"
3134
" Possible C/C++ prototypes are:\n"
3136
" EST_Relation(char const *)\n"
3137
" EST_Relation(EST_Relation const &)\n");
3142
SWIGINTERN PyObject *_wrap_delete_EST_Relation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3143
PyObject *resultobj = 0;
3144
EST_Relation *arg1 = (EST_Relation *) 0 ;
3147
PyObject * obj0 = 0 ;
3149
if (!PyArg_ParseTuple(args,(char *)"O:delete_EST_Relation",&obj0)) SWIG_fail;
3150
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EST_Relation, SWIG_POINTER_DISOWN | 0 );
3151
if (!SWIG_IsOK(res1)) {
3152
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_EST_Relation" "', argument " "1"" of type '" "EST_Relation *""'");
3154
arg1 = reinterpret_cast< EST_Relation * >(argp1);
3156
resultobj = SWIG_Py_Void();
3163
SWIGINTERN PyObject *_wrap_EST_Relation_load__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3164
PyObject *resultobj = 0;
3165
EST_Relation *arg1 = (EST_Relation *) 0 ;
3166
EST_String *arg2 = 0 ;
3167
EST_String *arg3 = 0 ;
3172
PyObject * obj0 = 0 ;
3173
PyObject * obj1 = 0 ;
3174
PyObject * obj2 = 0 ;
3175
EST_read_status result;
3177
if (!PyArg_ParseTuple(args,(char *)"OOO:EST_Relation_load",&obj0,&obj1,&obj2)) SWIG_fail;
3178
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EST_Relation, 0 | 0 );
3179
if (!SWIG_IsOK(res1)) {
3180
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EST_Relation_load" "', argument " "1"" of type '" "EST_Relation *""'");
3182
arg1 = reinterpret_cast< EST_Relation * >(argp1);
3184
char *str; Py_ssize_t len;
3185
PyString_AsStringAndSize(obj1, &str, &len);
3186
temp2 = EST_String( str, len, 0, len );
3190
char *str; Py_ssize_t len;
3191
PyString_AsStringAndSize(obj2, &str, &len);
3192
temp3 = EST_String( str, len, 0, len );
3195
result = (EST_read_status)(arg1)->load((EST_String const &)*arg2,(EST_String const &)*arg3);
3196
resultobj = SWIG_From_int(static_cast< int >(result));
3203
SWIGINTERN PyObject *_wrap_EST_Relation_load__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3204
PyObject *resultobj = 0;
3205
EST_Relation *arg1 = (EST_Relation *) 0 ;
3206
EST_String *arg2 = 0 ;
3210
PyObject * obj0 = 0 ;
3211
PyObject * obj1 = 0 ;
3212
EST_read_status result;
3214
if (!PyArg_ParseTuple(args,(char *)"OO:EST_Relation_load",&obj0,&obj1)) SWIG_fail;
3215
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EST_Relation, 0 | 0 );
3216
if (!SWIG_IsOK(res1)) {
3217
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EST_Relation_load" "', argument " "1"" of type '" "EST_Relation *""'");
3219
arg1 = reinterpret_cast< EST_Relation * >(argp1);
3221
char *str; Py_ssize_t len;
3222
PyString_AsStringAndSize(obj1, &str, &len);
3223
temp2 = EST_String( str, len, 0, len );
3226
result = (EST_read_status)(arg1)->load((EST_String const &)*arg2);
3227
resultobj = SWIG_From_int(static_cast< int >(result));
3234
SWIGINTERN PyObject *_wrap_EST_Relation_load(PyObject *self, PyObject *args) {
3239
if (!PyTuple_Check(args)) SWIG_fail;
3240
argc = (int)PyObject_Length(args);
3241
for (ii = 0; (ii < argc) && (ii < 3); ii++) {
3242
argv[ii] = PyTuple_GET_ITEM(args,ii);
3247
int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_EST_Relation, 0);
3248
_v = SWIG_CheckState(res);
3250
int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
3251
_v = SWIG_CheckState(res);
3253
return _wrap_EST_Relation_load__SWIG_1(self, args);
3260
int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_EST_Relation, 0);
3261
_v = SWIG_CheckState(res);
3263
int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
3264
_v = SWIG_CheckState(res);
3266
int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
3267
_v = SWIG_CheckState(res);
3269
return _wrap_EST_Relation_load__SWIG_0(self, args);
3276
SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'EST_Relation_load'.\n"
3277
" Possible C/C++ prototypes are:\n"
3278
" load(EST_Relation *,EST_String const &,EST_String const &)\n"
3279
" load(EST_Relation *,EST_String const &)\n");
3284
SWIGINTERN PyObject *_wrap_EST_Relation_save__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3285
PyObject *resultobj = 0;
3286
EST_Relation *arg1 = (EST_Relation *) 0 ;
3287
EST_String *arg2 = 0 ;
3288
EST_String *arg3 = 0 ;
3296
PyObject * obj0 = 0 ;
3297
PyObject * obj1 = 0 ;
3298
PyObject * obj2 = 0 ;
3299
PyObject * obj3 = 0 ;
3300
EST_write_status result;
3302
if (!PyArg_ParseTuple(args,(char *)"OOOO:EST_Relation_save",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
3303
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EST_Relation, 0 | 0 );
3304
if (!SWIG_IsOK(res1)) {
3305
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EST_Relation_save" "', argument " "1"" of type '" "EST_Relation const *""'");
3307
arg1 = reinterpret_cast< EST_Relation * >(argp1);
3309
char *str; Py_ssize_t len;
3310
PyString_AsStringAndSize(obj1, &str, &len);
3311
temp2 = EST_String( str, len, 0, len );
3315
char *str; Py_ssize_t len;
3316
PyString_AsStringAndSize(obj2, &str, &len);
3317
temp3 = EST_String( str, len, 0, len );
3320
ecode4 = SWIG_AsVal_bool(obj3, &val4);
3321
if (!SWIG_IsOK(ecode4)) {
3322
SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "EST_Relation_save" "', argument " "4"" of type '" "bool""'");
3324
arg4 = static_cast< bool >(val4);
3325
result = (EST_write_status)((EST_Relation const *)arg1)->save((EST_String const &)*arg2,(EST_String const &)*arg3,arg4);
3326
resultobj = SWIG_From_int(static_cast< int >(result));
3333
SWIGINTERN PyObject *_wrap_EST_Relation_save__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3334
PyObject *resultobj = 0;
3335
EST_Relation *arg1 = (EST_Relation *) 0 ;
3336
EST_String *arg2 = 0 ;
3337
EST_String *arg3 = 0 ;
3342
PyObject * obj0 = 0 ;
3343
PyObject * obj1 = 0 ;
3344
PyObject * obj2 = 0 ;
3345
EST_write_status result;
3347
if (!PyArg_ParseTuple(args,(char *)"OOO:EST_Relation_save",&obj0,&obj1,&obj2)) SWIG_fail;
3348
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EST_Relation, 0 | 0 );
3349
if (!SWIG_IsOK(res1)) {
3350
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EST_Relation_save" "', argument " "1"" of type '" "EST_Relation const *""'");
3352
arg1 = reinterpret_cast< EST_Relation * >(argp1);
3354
char *str; Py_ssize_t len;
3355
PyString_AsStringAndSize(obj1, &str, &len);
3356
temp2 = EST_String( str, len, 0, len );
3360
char *str; Py_ssize_t len;
3361
PyString_AsStringAndSize(obj2, &str, &len);
3362
temp3 = EST_String( str, len, 0, len );
3365
result = (EST_write_status)((EST_Relation const *)arg1)->save((EST_String const &)*arg2,(EST_String const &)*arg3);
3366
resultobj = SWIG_From_int(static_cast< int >(result));
3373
SWIGINTERN PyObject *_wrap_EST_Relation_save(PyObject *self, PyObject *args) {
3378
if (!PyTuple_Check(args)) SWIG_fail;
3379
argc = (int)PyObject_Length(args);
3380
for (ii = 0; (ii < argc) && (ii < 4); ii++) {
3381
argv[ii] = PyTuple_GET_ITEM(args,ii);
3386
int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_EST_Relation, 0);
3387
_v = SWIG_CheckState(res);
3389
int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
3390
_v = SWIG_CheckState(res);
3392
int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
3393
_v = SWIG_CheckState(res);
3395
return _wrap_EST_Relation_save__SWIG_1(self, args);
3403
int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_EST_Relation, 0);
3404
_v = SWIG_CheckState(res);
3406
int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
3407
_v = SWIG_CheckState(res);
3409
int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
3410
_v = SWIG_CheckState(res);
3413
int res = SWIG_AsVal_bool(argv[3], NULL);
3414
_v = SWIG_CheckState(res);
3417
return _wrap_EST_Relation_save__SWIG_0(self, args);
3425
SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'EST_Relation_save'.\n"
3426
" Possible C/C++ prototypes are:\n"
3427
" save(EST_Relation const *,EST_String const &,EST_String const &,bool)\n"
3428
" save(EST_Relation const *,EST_String const &,EST_String const &)\n");
3433
SWIGINTERN PyObject *_wrap_EST_Relation_evaluate_item_features(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3434
PyObject *resultobj = 0;
3435
EST_Relation *arg1 = (EST_Relation *) 0 ;
3438
PyObject * obj0 = 0 ;
3440
if (!PyArg_ParseTuple(args,(char *)"O:EST_Relation_evaluate_item_features",&obj0)) SWIG_fail;
3441
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EST_Relation, 0 | 0 );
3442
if (!SWIG_IsOK(res1)) {
3443
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EST_Relation_evaluate_item_features" "', argument " "1"" of type '" "EST_Relation *""'");
3445
arg1 = reinterpret_cast< EST_Relation * >(argp1);
3446
(arg1)->evaluate_item_features();
3447
resultobj = SWIG_Py_Void();
3454
SWIGINTERN PyObject *_wrap_EST_Relation_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3455
PyObject *resultobj = 0;
3456
EST_Relation *arg1 = (EST_Relation *) 0 ;
3459
PyObject * obj0 = 0 ;
3461
if (!PyArg_ParseTuple(args,(char *)"O:EST_Relation_clear",&obj0)) SWIG_fail;
3462
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EST_Relation, 0 | 0 );
3463
if (!SWIG_IsOK(res1)) {
3464
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EST_Relation_clear" "', argument " "1"" of type '" "EST_Relation *""'");
3466
arg1 = reinterpret_cast< EST_Relation * >(argp1);
3468
resultobj = SWIG_Py_Void();
3475
SWIGINTERN PyObject *_wrap_EST_Relation_utt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3476
PyObject *resultobj = 0;
3477
EST_Relation *arg1 = (EST_Relation *) 0 ;
3480
PyObject * obj0 = 0 ;
3481
EST_Utterance *result = 0 ;
3483
if (!PyArg_ParseTuple(args,(char *)"O:EST_Relation_utt",&obj0)) SWIG_fail;
3484
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EST_Relation, 0 | 0 );
3485
if (!SWIG_IsOK(res1)) {
3486
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EST_Relation_utt" "', argument " "1"" of type '" "EST_Relation *""'");
3488
arg1 = reinterpret_cast< EST_Relation * >(argp1);
3489
result = (EST_Utterance *)(arg1)->utt();
3490
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EST_Utterance, 0 | 0 );
3497
SWIGINTERN PyObject *_wrap_EST_Relation_set_utt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3498
PyObject *resultobj = 0;
3499
EST_Relation *arg1 = (EST_Relation *) 0 ;
3500
EST_Utterance *arg2 = (EST_Utterance *) 0 ;
3505
PyObject * obj0 = 0 ;
3506
PyObject * obj1 = 0 ;
3508
if (!PyArg_ParseTuple(args,(char *)"OO:EST_Relation_set_utt",&obj0,&obj1)) SWIG_fail;
3509
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EST_Relation, 0 | 0 );
3510
if (!SWIG_IsOK(res1)) {
3511
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EST_Relation_set_utt" "', argument " "1"" of type '" "EST_Relation *""'");
3513
arg1 = reinterpret_cast< EST_Relation * >(argp1);
3514
res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_EST_Utterance, 0 | 0 );
3515
if (!SWIG_IsOK(res2)) {
3516
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "EST_Relation_set_utt" "', argument " "2"" of type '" "EST_Utterance *""'");
3518
arg2 = reinterpret_cast< EST_Utterance * >(argp2);
3519
(arg1)->set_utt(arg2);
3520
resultobj = SWIG_Py_Void();
3527
SWIGINTERN PyObject *_wrap_EST_Relation_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3528
PyObject *resultobj = 0;
3529
EST_Relation *arg1 = (EST_Relation *) 0 ;
3532
PyObject * obj0 = 0 ;
3533
EST_String *result = 0 ;
3535
if (!PyArg_ParseTuple(args,(char *)"O:EST_Relation_name",&obj0)) SWIG_fail;
3536
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EST_Relation, 0 | 0 );
3537
if (!SWIG_IsOK(res1)) {
3538
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EST_Relation_name" "', argument " "1"" of type '" "EST_Relation const *""'");
3540
arg1 = reinterpret_cast< EST_Relation * >(argp1);
3541
result = (EST_String *) &((EST_Relation const *)arg1)->name();
3543
int len = result->length();
3544
resultobj = len ? PyString_FromStringAndSize(result->str(),len) : Py_BuildValue((char*)"");
3552
SWIGINTERN PyObject *_wrap_EST_Relation_head(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3553
PyObject *resultobj = 0;
3554
EST_Relation *arg1 = (EST_Relation *) 0 ;
3557
PyObject * obj0 = 0 ;
3558
EST_Item *result = 0 ;
3560
if (!PyArg_ParseTuple(args,(char *)"O:EST_Relation_head",&obj0)) SWIG_fail;
3561
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EST_Relation, 0 | 0 );
3562
if (!SWIG_IsOK(res1)) {
3563
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EST_Relation_head" "', argument " "1"" of type '" "EST_Relation const *""'");
3565
arg1 = reinterpret_cast< EST_Relation * >(argp1);
3566
result = (EST_Item *)((EST_Relation const *)arg1)->head();
3567
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EST_Item, 0 | 0 );
3574
SWIGINTERN PyObject *_wrap_EST_Relation_root(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3575
PyObject *resultobj = 0;
3576
EST_Relation *arg1 = (EST_Relation *) 0 ;
3579
PyObject * obj0 = 0 ;
3580
EST_Item *result = 0 ;
3582
if (!PyArg_ParseTuple(args,(char *)"O:EST_Relation_root",&obj0)) SWIG_fail;
3583
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EST_Relation, 0 | 0 );
3584
if (!SWIG_IsOK(res1)) {
3585
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EST_Relation_root" "', argument " "1"" of type '" "EST_Relation const *""'");
3587
arg1 = reinterpret_cast< EST_Relation * >(argp1);
3588
result = (EST_Item *)((EST_Relation const *)arg1)->root();
3589
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EST_Item, 0 | 0 );
3596
SWIGINTERN PyObject *_wrap_EST_Relation_tail(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3597
PyObject *resultobj = 0;
3598
EST_Relation *arg1 = (EST_Relation *) 0 ;
3601
PyObject * obj0 = 0 ;
3602
EST_Item *result = 0 ;
3604
if (!PyArg_ParseTuple(args,(char *)"O:EST_Relation_tail",&obj0)) SWIG_fail;
3605
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EST_Relation, 0 | 0 );
3606
if (!SWIG_IsOK(res1)) {
3607
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EST_Relation_tail" "', argument " "1"" of type '" "EST_Relation const *""'");
3609
arg1 = reinterpret_cast< EST_Relation * >(argp1);
3610
result = (EST_Item *)((EST_Relation const *)arg1)->tail();
3611
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EST_Item, 0 | 0 );
3618
SWIGINTERN PyObject *_wrap_EST_Relation_first(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3619
PyObject *resultobj = 0;
3620
EST_Relation *arg1 = (EST_Relation *) 0 ;
3623
PyObject * obj0 = 0 ;
3624
EST_Item *result = 0 ;
3626
if (!PyArg_ParseTuple(args,(char *)"O:EST_Relation_first",&obj0)) SWIG_fail;
3627
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EST_Relation, 0 | 0 );
3628
if (!SWIG_IsOK(res1)) {
3629
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EST_Relation_first" "', argument " "1"" of type '" "EST_Relation const *""'");
3631
arg1 = reinterpret_cast< EST_Relation * >(argp1);
3632
result = (EST_Item *)((EST_Relation const *)arg1)->first();
3633
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EST_Item, 0 | 0 );
3640
SWIGINTERN PyObject *_wrap_EST_Relation_first_leaf(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3641
PyObject *resultobj = 0;
3642
EST_Relation *arg1 = (EST_Relation *) 0 ;
3645
PyObject * obj0 = 0 ;
3646
EST_Item *result = 0 ;
3648
if (!PyArg_ParseTuple(args,(char *)"O:EST_Relation_first_leaf",&obj0)) SWIG_fail;
3649
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EST_Relation, 0 | 0 );
3650
if (!SWIG_IsOK(res1)) {
3651
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EST_Relation_first_leaf" "', argument " "1"" of type '" "EST_Relation const *""'");
3653
arg1 = reinterpret_cast< EST_Relation * >(argp1);
3654
result = (EST_Item *)((EST_Relation const *)arg1)->first_leaf();
3655
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EST_Item, 0 | 0 );
3662
SWIGINTERN PyObject *_wrap_EST_Relation_last(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3663
PyObject *resultobj = 0;
3664
EST_Relation *arg1 = (EST_Relation *) 0 ;
3667
PyObject * obj0 = 0 ;
3668
EST_Item *result = 0 ;
3670
if (!PyArg_ParseTuple(args,(char *)"O:EST_Relation_last",&obj0)) SWIG_fail;
3671
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EST_Relation, 0 | 0 );
3672
if (!SWIG_IsOK(res1)) {
3673
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EST_Relation_last" "', argument " "1"" of type '" "EST_Relation const *""'");
3675
arg1 = reinterpret_cast< EST_Relation * >(argp1);
3676
result = (EST_Item *)((EST_Relation const *)arg1)->last();
3677
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EST_Item, 0 | 0 );
3684
SWIGINTERN PyObject *_wrap_EST_Relation_last_leaf(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3685
PyObject *resultobj = 0;
3686
EST_Relation *arg1 = (EST_Relation *) 0 ;
3689
PyObject * obj0 = 0 ;
3690
EST_Item *result = 0 ;
3692
if (!PyArg_ParseTuple(args,(char *)"O:EST_Relation_last_leaf",&obj0)) SWIG_fail;
3693
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EST_Relation, 0 | 0 );
3694
if (!SWIG_IsOK(res1)) {
3695
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EST_Relation_last_leaf" "', argument " "1"" of type '" "EST_Relation const *""'");
3697
arg1 = reinterpret_cast< EST_Relation * >(argp1);
3698
result = (EST_Item *)((EST_Relation const *)arg1)->last_leaf();
3699
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EST_Item, 0 | 0 );
3706
SWIGINTERN PyObject *_wrap_EST_Relation_append(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3707
PyObject *resultobj = 0;
3708
EST_Relation *arg1 = (EST_Relation *) 0 ;
3709
EST_Item *arg2 = (EST_Item *) 0 ;
3714
PyObject * obj0 = 0 ;
3715
PyObject * obj1 = 0 ;
3716
EST_Item *result = 0 ;
3718
if (!PyArg_ParseTuple(args,(char *)"OO:EST_Relation_append",&obj0,&obj1)) SWIG_fail;
3719
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EST_Relation, 0 | 0 );
3720
if (!SWIG_IsOK(res1)) {
3721
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EST_Relation_append" "', argument " "1"" of type '" "EST_Relation *""'");
3723
arg1 = reinterpret_cast< EST_Relation * >(argp1);
3724
res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_EST_Item, 0 | 0 );
3725
if (!SWIG_IsOK(res2)) {
3726
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "EST_Relation_append" "', argument " "2"" of type '" "EST_Item *""'");
3728
arg2 = reinterpret_cast< EST_Item * >(argp2);
3729
result = (EST_Item *)(arg1)->append(arg2);
3730
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EST_Item, 0 | 0 );
3737
SWIGINTERN PyObject *_wrap_EST_Relation_prepend(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3738
PyObject *resultobj = 0;
3739
EST_Relation *arg1 = (EST_Relation *) 0 ;
3740
EST_Item *arg2 = (EST_Item *) 0 ;
3745
PyObject * obj0 = 0 ;
3746
PyObject * obj1 = 0 ;
3747
EST_Item *result = 0 ;
3749
if (!PyArg_ParseTuple(args,(char *)"OO:EST_Relation_prepend",&obj0,&obj1)) SWIG_fail;
3750
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EST_Relation, 0 | 0 );
3751
if (!SWIG_IsOK(res1)) {
3752
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EST_Relation_prepend" "', argument " "1"" of type '" "EST_Relation *""'");
3754
arg1 = reinterpret_cast< EST_Relation * >(argp1);
3755
res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_EST_Item, 0 | 0 );
3756
if (!SWIG_IsOK(res2)) {
3757
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "EST_Relation_prepend" "', argument " "2"" of type '" "EST_Item *""'");
3759
arg2 = reinterpret_cast< EST_Item * >(argp2);
3760
result = (EST_Item *)(arg1)->prepend(arg2);
3761
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EST_Item, 0 | 0 );
3768
SWIGINTERN PyObject *_wrap_EST_Relation_length(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3769
PyObject *resultobj = 0;
3770
EST_Relation *arg1 = (EST_Relation *) 0 ;
3773
PyObject * obj0 = 0 ;
3776
if (!PyArg_ParseTuple(args,(char *)"O:EST_Relation_length",&obj0)) SWIG_fail;
3777
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EST_Relation, 0 | 0 );
3778
if (!SWIG_IsOK(res1)) {
3779
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EST_Relation_length" "', argument " "1"" of type '" "EST_Relation const *""'");
3781
arg1 = reinterpret_cast< EST_Relation * >(argp1);
3782
result = (int)((EST_Relation const *)arg1)->length();
3783
resultobj = SWIG_From_int(static_cast< int >(result));
3790
SWIGINTERN PyObject *_wrap_EST_Relation_empty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3791
PyObject *resultobj = 0;
3792
EST_Relation *arg1 = (EST_Relation *) 0 ;
3795
PyObject * obj0 = 0 ;
3798
if (!PyArg_ParseTuple(args,(char *)"O:EST_Relation_empty",&obj0)) SWIG_fail;
3799
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EST_Relation, 0 | 0 );
3800
if (!SWIG_IsOK(res1)) {
3801
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EST_Relation_empty" "', argument " "1"" of type '" "EST_Relation const *""'");
3803
arg1 = reinterpret_cast< EST_Relation * >(argp1);
3804
result = (int)((EST_Relation const *)arg1)->empty();
3805
resultobj = SWIG_From_int(static_cast< int >(result));
3812
SWIGINTERN PyObject *_wrap_EST_Relation_remove_item(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3813
PyObject *resultobj = 0;
3814
EST_Relation *arg1 = (EST_Relation *) 0 ;
3815
EST_Item *arg2 = (EST_Item *) 0 ;
3820
PyObject * obj0 = 0 ;
3821
PyObject * obj1 = 0 ;
3823
if (!PyArg_ParseTuple(args,(char *)"OO:EST_Relation_remove_item",&obj0,&obj1)) SWIG_fail;
3824
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EST_Relation, 0 | 0 );
3825
if (!SWIG_IsOK(res1)) {
3826
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EST_Relation_remove_item" "', argument " "1"" of type '" "EST_Relation *""'");
3828
arg1 = reinterpret_cast< EST_Relation * >(argp1);
3829
res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_EST_Item, 0 | 0 );
3830
if (!SWIG_IsOK(res2)) {
3831
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "EST_Relation_remove_item" "', argument " "2"" of type '" "EST_Item *""'");
3833
arg2 = reinterpret_cast< EST_Item * >(argp2);
3834
(arg1)->remove_item(arg2);
3835
resultobj = SWIG_Py_Void();
3842
SWIGINTERN PyObject *_wrap_EST_Relation_remove_item_feature(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3843
PyObject *resultobj = 0;
3844
EST_Relation *arg1 = (EST_Relation *) 0 ;
3845
EST_String *arg2 = 0 ;
3849
PyObject * obj0 = 0 ;
3850
PyObject * obj1 = 0 ;
3852
if (!PyArg_ParseTuple(args,(char *)"OO:EST_Relation_remove_item_feature",&obj0,&obj1)) SWIG_fail;
3853
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EST_Relation, 0 | 0 );
3854
if (!SWIG_IsOK(res1)) {
3855
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EST_Relation_remove_item_feature" "', argument " "1"" of type '" "EST_Relation *""'");
3857
arg1 = reinterpret_cast< EST_Relation * >(argp1);
3859
char *str; Py_ssize_t len;
3860
PyString_AsStringAndSize(obj1, &str, &len);
3861
temp2 = EST_String( str, len, 0, len );
3864
(arg1)->remove_item_feature((EST_String const &)*arg2);
3865
resultobj = SWIG_Py_Void();
3872
SWIGINTERN PyObject *_wrap_EST_Relation_items(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3873
PyObject *resultobj = 0;
3874
EST_Relation *arg1 = (EST_Relation *) 0 ;
3875
EST_Item **arg2 = (EST_Item **) 0 ;
3879
PyObject * obj0 = 0 ;
3882
if (!PyArg_ParseTuple(args,(char *)"O:EST_Relation_items",&obj0)) SWIG_fail;
3883
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EST_Relation, 0 | 0 );
3884
if (!SWIG_IsOK(res1)) {
3885
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EST_Relation_items" "', argument " "1"" of type '" "EST_Relation *""'");
3887
arg1 = reinterpret_cast< EST_Relation * >(argp1);
3888
EST_Relation_items(arg1,arg2);
3889
resultobj = SWIG_Py_Void();
3891
PyObject *o1, *o2, *o3;
3893
o1 = PyList_New((*arg2)->length());
3897
for( it = (*arg2), i=0; it!=0; it=next(it), ++i )
3898
PyList_SetItem( o1, i, SWIG_NewPointerObj((void *) it, SWIGTYPE_p_EST_Item, 0) );
3900
if ((!resultobj) || (resultobj == Py_None)) {
3904
if (!PyTuple_Check(resultobj)) {
3906
resultobj = PyTuple_New(1);
3907
PyTuple_SetItem(resultobj, 0, o2);
3910
o3 = PyTuple_New(1);
3911
PyTuple_SetItem( o3, 0, o1 );
3913
resultobj = PySequence_Concat( o2, o3 );
3924
SWIGINTERN PyObject *EST_Relation_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3926
if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
3927
SWIG_TypeNewClientData(SWIGTYPE_p_EST_Relation, SWIG_NewClientData(obj));
3928
return SWIG_Py_Void();
3931
SWIGINTERN PyObject *_wrap_copy_relation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3932
PyObject *resultobj = 0;
3933
EST_Relation *arg1 = 0 ;
3934
EST_Relation *arg2 = 0 ;
3939
PyObject * obj0 = 0 ;
3940
PyObject * obj1 = 0 ;
3942
if (!PyArg_ParseTuple(args,(char *)"OO:copy_relation",&obj0,&obj1)) SWIG_fail;
3943
res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_EST_Relation, 0 | 0);
3944
if (!SWIG_IsOK(res1)) {
3945
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "copy_relation" "', argument " "1"" of type '" "EST_Relation const &""'");
3948
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "copy_relation" "', argument " "1"" of type '" "EST_Relation const &""'");
3950
arg1 = reinterpret_cast< EST_Relation * >(argp1);
3951
res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_EST_Relation, 0 );
3952
if (!SWIG_IsOK(res2)) {
3953
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "copy_relation" "', argument " "2"" of type '" "EST_Relation &""'");
3956
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "copy_relation" "', argument " "2"" of type '" "EST_Relation &""'");
3958
arg2 = reinterpret_cast< EST_Relation * >(argp2);
3959
copy_relation((EST_Relation const &)*arg1,*arg2);
3960
resultobj = SWIG_Py_Void();
3967
static PyMethodDef SwigMethods[] = {
3968
{ (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL},
3969
{ (char *)"new_EST_Relation", _wrap_new_EST_Relation, METH_VARARGS, NULL},
3970
{ (char *)"delete_EST_Relation", _wrap_delete_EST_Relation, METH_VARARGS, NULL},
3971
{ (char *)"EST_Relation_load", _wrap_EST_Relation_load, METH_VARARGS, NULL},
3972
{ (char *)"EST_Relation_save", _wrap_EST_Relation_save, METH_VARARGS, NULL},
3973
{ (char *)"EST_Relation_evaluate_item_features", _wrap_EST_Relation_evaluate_item_features, METH_VARARGS, NULL},
3974
{ (char *)"EST_Relation_clear", _wrap_EST_Relation_clear, METH_VARARGS, NULL},
3975
{ (char *)"EST_Relation_utt", _wrap_EST_Relation_utt, METH_VARARGS, NULL},
3976
{ (char *)"EST_Relation_set_utt", _wrap_EST_Relation_set_utt, METH_VARARGS, NULL},
3977
{ (char *)"EST_Relation_name", _wrap_EST_Relation_name, METH_VARARGS, NULL},
3978
{ (char *)"EST_Relation_head", _wrap_EST_Relation_head, METH_VARARGS, NULL},
3979
{ (char *)"EST_Relation_root", _wrap_EST_Relation_root, METH_VARARGS, NULL},
3980
{ (char *)"EST_Relation_tail", _wrap_EST_Relation_tail, METH_VARARGS, NULL},
3981
{ (char *)"EST_Relation_first", _wrap_EST_Relation_first, METH_VARARGS, NULL},
3982
{ (char *)"EST_Relation_first_leaf", _wrap_EST_Relation_first_leaf, METH_VARARGS, NULL},
3983
{ (char *)"EST_Relation_last", _wrap_EST_Relation_last, METH_VARARGS, NULL},
3984
{ (char *)"EST_Relation_last_leaf", _wrap_EST_Relation_last_leaf, METH_VARARGS, NULL},
3985
{ (char *)"EST_Relation_append", _wrap_EST_Relation_append, METH_VARARGS, NULL},
3986
{ (char *)"EST_Relation_prepend", _wrap_EST_Relation_prepend, METH_VARARGS, NULL},
3987
{ (char *)"EST_Relation_length", _wrap_EST_Relation_length, METH_VARARGS, NULL},
3988
{ (char *)"EST_Relation_empty", _wrap_EST_Relation_empty, METH_VARARGS, NULL},
3989
{ (char *)"EST_Relation_remove_item", _wrap_EST_Relation_remove_item, METH_VARARGS, NULL},
3990
{ (char *)"EST_Relation_remove_item_feature", _wrap_EST_Relation_remove_item_feature, METH_VARARGS, NULL},
3991
{ (char *)"EST_Relation_items", _wrap_EST_Relation_items, METH_VARARGS, NULL},
3992
{ (char *)"EST_Relation_swigregister", EST_Relation_swigregister, METH_VARARGS, NULL},
3993
{ (char *)"copy_relation", _wrap_copy_relation, METH_VARARGS, NULL},
3994
{ NULL, NULL, 0, NULL }
3998
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
4000
static swig_type_info _swigt__p_EST_Item = {"_p_EST_Item", "EST_Item *", 0, 0, (void*)0, 0};
4001
static swig_type_info _swigt__p_EST_Relation = {"_p_EST_Relation", "EST_Relation *", 0, 0, (void*)0, 0};
4002
static swig_type_info _swigt__p_EST_Utterance = {"_p_EST_Utterance", "EST_Utterance *", 0, 0, (void*)0, 0};
4003
static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
4004
static swig_type_info _swigt__p_p_EST_Item = {"_p_p_EST_Item", "EST_Item **", 0, 0, (void*)0, 0};
4006
static swig_type_info *swig_type_initial[] = {
4007
&_swigt__p_EST_Item,
4008
&_swigt__p_EST_Relation,
4009
&_swigt__p_EST_Utterance,
4011
&_swigt__p_p_EST_Item,
4014
static swig_cast_info _swigc__p_EST_Item[] = { {&_swigt__p_EST_Item, 0, 0, 0},{0, 0, 0, 0}};
4015
static swig_cast_info _swigc__p_EST_Relation[] = { {&_swigt__p_EST_Relation, 0, 0, 0},{0, 0, 0, 0}};
4016
static swig_cast_info _swigc__p_EST_Utterance[] = { {&_swigt__p_EST_Utterance, 0, 0, 0},{0, 0, 0, 0}};
4017
static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
4018
static swig_cast_info _swigc__p_p_EST_Item[] = { {&_swigt__p_p_EST_Item, 0, 0, 0},{0, 0, 0, 0}};
4020
static swig_cast_info *swig_cast_initial[] = {
4022
_swigc__p_EST_Relation,
4023
_swigc__p_EST_Utterance,
4025
_swigc__p_p_EST_Item,
4029
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
4031
static swig_const_info swig_const_table[] = {
4032
{0, 0, 0, 0.0, 0, 0}};
4037
/* -----------------------------------------------------------------------------
4038
* Type initialization:
4039
* This problem is tough by the requirement that no dynamic
4040
* memory is used. Also, since swig_type_info structures store pointers to
4041
* swig_cast_info structures and swig_cast_info structures store pointers back
4042
* to swig_type_info structures, we need some lookup code at initialization.
4043
* The idea is that swig generates all the structures that are needed.
4044
* The runtime then collects these partially filled structures.
4045
* The SWIG_InitializeModule function takes these initial arrays out of
4046
* swig_module, and does all the lookup, filling in the swig_module.types
4047
* array with the correct data and linking the correct swig_cast_info
4048
* structures together.
4050
* The generated swig_type_info structures are assigned staticly to an initial
4051
* array. We just loop through that array, and handle each type individually.
4052
* First we lookup if this type has been already loaded, and if so, use the
4053
* loaded structure instead of the generated one. Then we have to fill in the
4054
* cast linked list. The cast data is initially stored in something like a
4055
* two-dimensional array. Each row corresponds to a type (there are the same
4056
* number of rows as there are in the swig_type_initial array). Each entry in
4057
* a column is one of the swig_cast_info structures for that type.
4058
* The cast_initial array is actually an array of arrays, because each row has
4059
* a variable number of columns. So to actually build the cast linked list,
4060
* we find the array of casts associated with the type, and loop through it
4061
* adding the casts to the list. The one last trick we need to do is making
4062
* sure the type pointer in the swig_cast_info struct is correct.
4064
* First off, we lookup the cast->type name to see if it is already loaded.
4065
* There are three cases to handle:
4066
* 1) If the cast->type has already been loaded AND the type we are adding
4067
* casting info to has not been loaded (it is in this module), THEN we
4068
* replace the cast->type pointer with the type pointer that has already
4070
* 2) If BOTH types (the one we are adding casting info to, and the
4071
* cast->type) are loaded, THEN the cast info has already been loaded by
4072
* the previous module so we just ignore it.
4073
* 3) Finally, if cast->type has not already been loaded, then we add that
4074
* swig_cast_info to the linked list (because the cast->type) pointer will
4076
* ----------------------------------------------------------------------------- */
4086
#define SWIGRUNTIME_DEBUG
4091
SWIG_InitializeModule(void *clientdata) {
4093
swig_module_info *module_head, *iter;
4096
clientdata = clientdata;
4098
/* check to see if the circular list has been setup, if not, set it up */
4099
if (swig_module.next==0) {
4100
/* Initialize the swig_module */
4101
swig_module.type_initial = swig_type_initial;
4102
swig_module.cast_initial = swig_cast_initial;
4103
swig_module.next = &swig_module;
4109
/* Try and load any already created modules */
4110
module_head = SWIG_GetModule(clientdata);
4112
/* This is the first module loaded for this interpreter */
4113
/* so set the swig module into the interpreter */
4114
SWIG_SetModule(clientdata, &swig_module);
4115
module_head = &swig_module;
4117
/* the interpreter has loaded a SWIG module, but has it loaded this one? */
4121
if (iter==&swig_module) {
4126
} while (iter!= module_head);
4128
/* if the is found in the list, then all is done and we may leave */
4130
/* otherwise we must add out module into the list */
4131
swig_module.next = module_head->next;
4132
module_head->next = &swig_module;
4135
/* When multiple interpeters are used, a module could have already been initialized in
4136
a different interpreter, but not yet have a pointer in this interpreter.
4137
In this case, we do not want to continue adding types... everything should be
4139
if (init == 0) return;
4141
/* Now work on filling in swig_module.types */
4142
#ifdef SWIGRUNTIME_DEBUG
4143
printf("SWIG_InitializeModule: size %d\n", swig_module.size);
4145
for (i = 0; i < swig_module.size; ++i) {
4146
swig_type_info *type = 0;
4147
swig_type_info *ret;
4148
swig_cast_info *cast;
4150
#ifdef SWIGRUNTIME_DEBUG
4151
printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
4154
/* if there is another module already loaded */
4155
if (swig_module.next != &swig_module) {
4156
type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
4159
/* Overwrite clientdata field */
4160
#ifdef SWIGRUNTIME_DEBUG
4161
printf("SWIG_InitializeModule: found type %s\n", type->name);
4163
if (swig_module.type_initial[i]->clientdata) {
4164
type->clientdata = swig_module.type_initial[i]->clientdata;
4165
#ifdef SWIGRUNTIME_DEBUG
4166
printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
4170
type = swig_module.type_initial[i];
4173
/* Insert casting types */
4174
cast = swig_module.cast_initial[i];
4175
while (cast->type) {
4176
/* Don't need to add information already in the list */
4178
#ifdef SWIGRUNTIME_DEBUG
4179
printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
4181
if (swig_module.next != &swig_module) {
4182
ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
4183
#ifdef SWIGRUNTIME_DEBUG
4184
if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
4188
if (type == swig_module.type_initial[i]) {
4189
#ifdef SWIGRUNTIME_DEBUG
4190
printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
4195
/* Check for casting already in the list */
4196
swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
4197
#ifdef SWIGRUNTIME_DEBUG
4198
if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
4200
if (!ocast) ret = 0;
4205
#ifdef SWIGRUNTIME_DEBUG
4206
printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
4209
type->cast->prev = cast;
4210
cast->next = type->cast;
4216
/* Set entry in modules->types array equal to the type */
4217
swig_module.types[i] = type;
4219
swig_module.types[i] = 0;
4221
#ifdef SWIGRUNTIME_DEBUG
4222
printf("**** SWIG_InitializeModule: Cast List ******\n");
4223
for (i = 0; i < swig_module.size; ++i) {
4225
swig_cast_info *cast = swig_module.cast_initial[i];
4226
printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
4227
while (cast->type) {
4228
printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
4232
printf("---- Total casts: %d\n",j);
4234
printf("**** SWIG_InitializeModule: Cast List ******\n");
4238
/* This function will propagate the clientdata field of type to
4239
* any new swig_type_info structures that have been added into the list
4240
* of equivalent types. It is like calling
4241
* SWIG_TypeClientData(type, clientdata) a second time.
4244
SWIG_PropagateClientData(void) {
4246
swig_cast_info *equiv;
4247
static int init_run = 0;
4249
if (init_run) return;
4252
for (i = 0; i < swig_module.size; i++) {
4253
if (swig_module.types[i]->clientdata) {
4254
equiv = swig_module.types[i]->cast;
4256
if (!equiv->converter) {
4257
if (equiv->type && !equiv->type->clientdata)
4258
SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
4260
equiv = equiv->next;
4280
/* Python-specific SWIG API */
4281
#define SWIG_newvarlink() SWIG_Python_newvarlink()
4282
#define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr)
4283
#define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants)
4285
/* -----------------------------------------------------------------------------
4286
* global variable support code.
4287
* ----------------------------------------------------------------------------- */
4289
typedef struct swig_globalvar {
4290
char *name; /* Name of global variable */
4291
PyObject *(*get_attr)(void); /* Return the current value */
4292
int (*set_attr)(PyObject *); /* Set the value */
4293
struct swig_globalvar *next;
4296
typedef struct swig_varlinkobject {
4298
swig_globalvar *vars;
4299
} swig_varlinkobject;
4301
SWIGINTERN PyObject *
4302
swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
4303
#if PY_VERSION_HEX >= 0x03000000
4304
return PyUnicode_InternFromString("<Swig global variables>");
4306
return PyString_FromString("<Swig global variables>");
4310
SWIGINTERN PyObject *
4311
swig_varlink_str(swig_varlinkobject *v) {
4312
#if PY_VERSION_HEX >= 0x03000000
4313
PyObject *str = PyUnicode_InternFromString("(");
4316
swig_globalvar *var;
4317
for (var = v->vars; var; var=var->next) {
4318
tail = PyUnicode_FromString(var->name);
4319
joined = PyUnicode_Concat(str, tail);
4324
tail = PyUnicode_InternFromString(", ");
4325
joined = PyUnicode_Concat(str, tail);
4331
tail = PyUnicode_InternFromString(")");
4332
joined = PyUnicode_Concat(str, tail);
4337
PyObject *str = PyString_FromString("(");
4338
swig_globalvar *var;
4339
for (var = v->vars; var; var=var->next) {
4340
PyString_ConcatAndDel(&str,PyString_FromString(var->name));
4341
if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
4343
PyString_ConcatAndDel(&str,PyString_FromString(")"));
4349
swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) {
4351
PyObject *str = swig_varlink_str(v);
4352
fprintf(fp,"Swig global variables ");
4353
fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str));
4354
SWIG_Python_str_DelForPy3(tmp);
4360
swig_varlink_dealloc(swig_varlinkobject *v) {
4361
swig_globalvar *var = v->vars;
4363
swig_globalvar *n = var->next;
4370
SWIGINTERN PyObject *
4371
swig_varlink_getattr(swig_varlinkobject *v, char *n) {
4372
PyObject *res = NULL;
4373
swig_globalvar *var = v->vars;
4375
if (strcmp(var->name,n) == 0) {
4376
res = (*var->get_attr)();
4381
if (res == NULL && !PyErr_Occurred()) {
4382
PyErr_SetString(PyExc_NameError,"Unknown C global variable");
4388
swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
4390
swig_globalvar *var = v->vars;
4392
if (strcmp(var->name,n) == 0) {
4393
res = (*var->set_attr)(p);
4398
if (res == 1 && !PyErr_Occurred()) {
4399
PyErr_SetString(PyExc_NameError,"Unknown C global variable");
4404
SWIGINTERN PyTypeObject*
4405
swig_varlink_type(void) {
4406
static char varlink__doc__[] = "Swig var link object";
4407
static PyTypeObject varlink_type;
4408
static int type_init = 0;
4410
const PyTypeObject tmp
4412
/* PyObject header changed in Python 3 */
4413
#if PY_VERSION_HEX >= 0x03000000
4414
PyVarObject_HEAD_INIT(&PyType_Type, 0)
4416
PyObject_HEAD_INIT(NULL)
4417
0, /* Number of items in variable part (ob_size) */
4419
(char *)"swigvarlink", /* Type name (tp_name) */
4420
sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */
4421
0, /* Itemsize (tp_itemsize) */
4422
(destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */
4423
(printfunc) swig_varlink_print, /* Print (tp_print) */
4424
(getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */
4425
(setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */
4427
(reprfunc) swig_varlink_repr, /* tp_repr */
4428
0, /* tp_as_number */
4429
0, /* tp_as_sequence */
4430
0, /* tp_as_mapping */
4433
(reprfunc) swig_varlink_str, /* tp_str */
4434
0, /* tp_getattro */
4435
0, /* tp_setattro */
4436
0, /* tp_as_buffer */
4438
varlink__doc__, /* tp_doc */
4439
0, /* tp_traverse */
4441
0, /* tp_richcompare */
4442
0, /* tp_weaklistoffset */
4443
#if PY_VERSION_HEX >= 0x02020000
4444
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
4446
#if PY_VERSION_HEX >= 0x02030000
4450
0,0,0,0 /* tp_alloc -> tp_next */
4454
/* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */
4455
#if PY_VERSION_HEX < 0x03000000
4456
varlink_type.ob_type = &PyType_Type;
4460
return &varlink_type;
4463
/* Create a variable linking object for use later */
4464
SWIGINTERN PyObject *
4465
SWIG_Python_newvarlink(void) {
4466
swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
4470
return ((PyObject*) result);
4474
SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
4475
swig_varlinkobject *v = (swig_varlinkobject *) p;
4476
swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
4478
size_t size = strlen(name)+1;
4479
gv->name = (char *)malloc(size);
4481
strncpy(gv->name,name,size);
4482
gv->get_attr = get_attr;
4483
gv->set_attr = set_attr;
4490
SWIGINTERN PyObject *
4491
SWIG_globals(void) {
4492
static PyObject *_SWIG_globals = 0;
4493
if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink();
4494
return _SWIG_globals;
4497
/* -----------------------------------------------------------------------------
4498
* constants/methods manipulation
4499
* ----------------------------------------------------------------------------- */
4501
/* Install Constants */
4503
SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
4506
for (i = 0; constants[i].type; ++i) {
4507
switch(constants[i].type) {
4508
case SWIG_PY_POINTER:
4509
obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
4511
case SWIG_PY_BINARY:
4512
obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
4519
PyDict_SetItemString(d, constants[i].name, obj);
4525
/* -----------------------------------------------------------------------------*/
4526
/* Fix SwigMethods to carry the callback ptrs when needed */
4527
/* -----------------------------------------------------------------------------*/
4530
SWIG_Python_FixMethods(PyMethodDef *methods,
4531
swig_const_info *const_table,
4532
swig_type_info **types,
4533
swig_type_info **types_initial) {
4535
for (i = 0; methods[i].ml_name; ++i) {
4536
const char *c = methods[i].ml_doc;
4537
if (c && (c = strstr(c, "swig_ptr: "))) {
4539
swig_const_info *ci = 0;
4540
const char *name = c + 10;
4541
for (j = 0; const_table[j].type; ++j) {
4542
if (strncmp(const_table[j].name, name,
4543
strlen(const_table[j].name)) == 0) {
4544
ci = &(const_table[j]);
4549
size_t shift = (ci->ptype) - types;
4550
swig_type_info *ty = types_initial[shift];
4551
size_t ldoc = (c - methods[i].ml_doc);
4552
size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
4553
char *ndoc = (char*)malloc(ldoc + lptr + 10);
4556
void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
4558
strncpy(buff, methods[i].ml_doc, ldoc);
4560
strncpy(buff, "swig_ptr: ", 10);
4562
SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
4563
methods[i].ml_doc = ndoc;
4575
/* -----------------------------------------------------------------------------*
4576
* Partial Init method
4577
* -----------------------------------------------------------------------------*/
4584
#if PY_VERSION_HEX >= 0x03000000
4591
#if PY_VERSION_HEX >= 0x03000000
4592
static struct PyModuleDef SWIG_module = {
4593
PyModuleDef_HEAD_INIT,
4605
/* Fix SwigMethods to carry the callback ptrs when needed */
4606
SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
4608
#if PY_VERSION_HEX >= 0x03000000
4609
m = PyModule_Create(&SWIG_module);
4611
m = Py_InitModule((char *) SWIG_name, SwigMethods);
4613
d = PyModule_GetDict(m);
4615
SWIG_InitializeModule(0);
4616
SWIG_InstallConstants(d,swig_const_table);
4619
SWIG_Python_SetConstant(d, "read_ok",SWIG_From_int(static_cast< int >(read_ok)));
4620
SWIG_Python_SetConstant(d, "read_format_error",SWIG_From_int(static_cast< int >(read_format_error)));
4621
SWIG_Python_SetConstant(d, "read_not_found_error",SWIG_From_int(static_cast< int >(read_not_found_error)));
4622
SWIG_Python_SetConstant(d, "read_error",SWIG_From_int(static_cast< int >(read_error)));
4623
SWIG_Python_SetConstant(d, "write_ok",SWIG_From_int(static_cast< int >(write_ok)));
4624
SWIG_Python_SetConstant(d, "write_fail",SWIG_From_int(static_cast< int >(write_fail)));
4625
SWIG_Python_SetConstant(d, "write_error",SWIG_From_int(static_cast< int >(write_error)));
4626
SWIG_Python_SetConstant(d, "write_partial",SWIG_From_int(static_cast< int >(write_partial)));
4627
SWIG_Python_SetConstant(d, "connect_ok",SWIG_From_int(static_cast< int >(connect_ok)));
4628
SWIG_Python_SetConstant(d, "connect_not_found_error",SWIG_From_int(static_cast< int >(connect_not_found_error)));
4629
SWIG_Python_SetConstant(d, "connect_not_allowed_error",SWIG_From_int(static_cast< int >(connect_not_allowed_error)));
4630
SWIG_Python_SetConstant(d, "connect_system_error",SWIG_From_int(static_cast< int >(connect_system_error)));
4631
SWIG_Python_SetConstant(d, "connect_error",SWIG_From_int(static_cast< int >(connect_error)));
4632
#if PY_VERSION_HEX >= 0x03000000