1
1
/* ----------------------------------------------------------------------------
2
2
* This file was automatically generated by SWIG (http://www.swig.org).
5
* This file is not intended to be easily readable and contains a number of
5
* This file is not intended to be easily readable and contains a number of
6
6
* coding conventions designed to improve portability and efficiency. Do not make
7
* changes to this file unless you know what you are doing--modify the SWIG
8
* interface file instead.
7
* changes to this file unless you know what you are doing--modify the SWIG
8
* interface file instead.
9
9
* ----------------------------------------------------------------------------- */
42
42
# if defined(__GNUC__)
43
43
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
44
# define SWIGUNUSED __attribute__ ((__unused__))
44
# define SWIGUNUSED __attribute__ ((__unused__))
46
46
# define SWIGUNUSED
48
48
# elif defined(__ICC)
49
# define SWIGUNUSED __attribute__ ((__unused__))
49
# define SWIGUNUSED __attribute__ ((__unused__))
55
55
#ifndef SWIG_MSC_UNSUPPRESS_4505
56
56
# if defined(_MSC_VER)
57
57
# pragma warning(disable : 4505) /* unreferenced local function has been removed */
61
61
#ifndef SWIGUNUSEDPARM
62
62
# ifdef __cplusplus
63
63
# define SWIGUNUSEDPARM(p)
65
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
65
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
150
150
#ifndef SWIGUNUSED
151
151
# if defined(__GNUC__)
152
152
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
153
# define SWIGUNUSED __attribute__ ((__unused__))
153
# define SWIGUNUSED __attribute__ ((__unused__))
155
155
# define SWIGUNUSED
157
157
# elif defined(__ICC)
158
# define SWIGUNUSED __attribute__ ((__unused__))
158
# define SWIGUNUSED __attribute__ ((__unused__))
164
164
#ifndef SWIG_MSC_UNSUPPRESS_4505
165
165
# if defined(_MSC_VER)
166
166
# pragma warning(disable : 4505) /* unreferenced local function has been removed */
170
170
#ifndef SWIGUNUSEDPARM
171
171
# ifdef __cplusplus
172
172
# define SWIGUNUSEDPARM(p)
174
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
174
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
252
252
You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
253
253
creating a static or dynamic library from the SWIG runtime code.
254
254
In 99.9% of the cases, SWIG just needs to declare them as 'static'.
256
256
But only do this if strictly necessary, ie, if you have problems
257
257
with your compiler or suchlike.
278
278
#define SWIG_POINTER_OWN 0x1
282
282
Flags/methods for returning states.
284
The SWIG conversion methods, as ConvertPtr, return an integer
284
The SWIG conversion methods, as ConvertPtr, return an integer
285
285
that tells if the conversion was successful or not. And if not,
286
286
an error code can be returned (see swigerrors.swg for the codes).
288
288
Use the following macros/flags to set or process the returning
291
291
In old versions of SWIG, code such as the following was usually written:
293
293
if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
324
324
I.e., now SWIG_ConvertPtr can return new objects and you can
325
325
identify the case and take care of the deallocation. Of course that
326
326
also requires SWIG_ConvertPtr to return new result values, such as
328
int SWIG_ConvertPtr(obj, ptr,...) {
330
if (<need new object>) {
331
*ptr = <ptr to new allocated object>;
334
*ptr = <ptr to old object>;
328
int SWIG_ConvertPtr(obj, ptr,...) {
330
if (<need new object>) {
331
*ptr = <ptr to new allocated object>;
334
*ptr = <ptr to old object>;
342
342
Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
354
354
food(1) // cast rank '1' (1 -> 1.0)
355
355
fooi(1) // cast rank '0'
357
357
just use the SWIG_AddCast()/SWIG_CheckState()
361
361
#define SWIG_ERROR (-1)
362
362
#define SWIG_IsOK(r) (r >= 0)
363
#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
363
#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
365
365
/* The CastRankLimit says how many bits are used for the cast rank */
366
366
#define SWIG_CASTRANKLIMIT (1 << 8)
392
392
# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
393
393
# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
394
SWIGINTERNINLINE int SWIG_AddCast(int r) {
394
SWIGINTERNINLINE int SWIG_AddCast(int r) {
395
395
return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
397
SWIGINTERNINLINE int SWIG_CheckState(int r) {
398
return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
397
SWIGINTERNINLINE int SWIG_CheckState(int r) {
398
return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
400
400
#else /* no cast-rank mode */
401
# define SWIG_AddCast
401
# define SWIG_AddCast(r) (r)
402
402
# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
464
464
Check type equivalence in a name list like <name1>|<name2>|...
465
Return 0 if equal, -1 if nb < tb, 1 if nb > tb
468
SWIG_TypeCmp(const char *nb, const char *tb) {
470
const char* te = tb + strlen(tb);
472
while (equiv != 0 && *ne) {
473
for (nb = ne; *ne; ++ne) {
474
if (*ne == '|') break;
476
equiv = SWIG_TypeNameComp(nb, ne, tb, te);
483
Check type equivalence in a name list like <name1>|<name2>|...
465
484
Return 0 if not equal, 1 if equal
468
487
SWIG_TypeEquiv(const char *nb, const char *tb) {
470
const char* te = tb + strlen(tb);
472
while (!equiv && *ne) {
473
for (nb = ne; *ne; ++ne) {
474
if (*ne == '|') break;
476
equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
483
Check type equivalence in a name list like <name1>|<name2>|...
484
Return 0 if equal, -1 if nb < tb, 1 if nb > tb
487
SWIG_TypeCompare(const char *nb, const char *tb) {
489
const char* te = tb + strlen(tb);
491
while (!equiv && *ne) {
492
for (nb = ne; *ne; ++ne) {
493
if (*ne == '|') break;
495
equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
488
return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
503
492
Check the typename
613
602
swig_cast_info *cast = ti->cast;
614
603
/* if (ti->clientdata == clientdata) return; */
615
604
ti->clientdata = clientdata;
618
607
if (!cast->converter) {
619
608
swig_type_info *tc = cast->type;
620
609
if (!tc->clientdata) {
621
610
SWIG_TypeClientData(tc, clientdata);
624
613
cast = cast->next;
629
618
SWIG_TypeClientData(ti, clientdata);
634
623
Search for a swig_type_info structure only by mangled name
635
624
Search is a O(log #types)
637
We start searching at module start, and finish searching when start == end.
626
We start searching at module start, and finish searching when start == end.
638
627
Note: if start == end at the beginning of the function, we go all the way around
639
628
the circular list.
641
630
SWIGRUNTIME swig_type_info *
642
SWIG_MangledTypeQueryModule(swig_module_info *start,
643
swig_module_info *end,
631
SWIG_MangledTypeQueryModule(swig_module_info *start,
632
swig_module_info *end,
644
633
const char *name) {
645
634
swig_module_info *iter = start;
649
638
register size_t r = iter->size - 1;
651
640
/* since l+r >= 0, we can (>> 1) instead (/ 2) */
652
register size_t i = (l + r) >> 1;
641
register size_t i = (l + r) >> 1;
653
642
const char *iname = iter->types[i]->name;
655
644
register int compare = strcmp(name, iname);
657
646
return iter->types[i];
658
647
} else if (compare < 0) {
678
667
Search for a swig_type_info structure for either a mangled name or a human readable name.
679
668
It first searches the mangled names of the types, which is a O(log #types)
680
669
If a type is not found it then searches the human readable names, which is O(#types).
682
We start searching at module start, and finish searching when start == end.
671
We start searching at module start, and finish searching when start == end.
683
672
Note: if start == end at the beginning of the function, we go all the way around
684
673
the circular list.
686
675
SWIGRUNTIME swig_type_info *
687
SWIG_TypeQueryModule(swig_module_info *start,
688
swig_module_info *end,
676
SWIG_TypeQueryModule(swig_module_info *start,
677
swig_module_info *end,
689
678
const char *name) {
690
679
/* STEP 1: Search the name field using binary search */
691
680
swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
739
728
uu = ((d - '0') << 4);
740
729
else if ((d >= 'a') && (d <= 'f'))
741
730
uu = ((d - ('a'-10)) << 4);
743
732
return (char *) 0;
745
734
if ((d >= '0') && (d <= '9'))
747
736
else if ((d >= 'a') && (d <= 'f'))
748
737
uu |= (d - ('a'-10));
750
739
return (char *) 0;
757
746
Pack 'void *' into a string buffer.
759
748
SWIGRUNTIME char *
815
804
/* Errors in SWIG */
816
#define SWIG_UnknownError -1
817
#define SWIG_IOError -2
818
#define SWIG_RuntimeError -3
819
#define SWIG_IndexError -4
820
#define SWIG_TypeError -5
821
#define SWIG_DivisionByZero -6
822
#define SWIG_OverflowError -7
823
#define SWIG_SyntaxError -8
824
#define SWIG_ValueError -9
805
#define SWIG_UnknownError -1
806
#define SWIG_IOError -2
807
#define SWIG_RuntimeError -3
808
#define SWIG_IndexError -4
809
#define SWIG_TypeError -5
810
#define SWIG_DivisionByZero -6
811
#define SWIG_OverflowError -7
812
#define SWIG_SyntaxError -8
813
#define SWIG_ValueError -9
825
814
#define SWIG_SystemError -10
826
815
#define SWIG_AttributeError -11
827
#define SWIG_MemoryError -12
816
#define SWIG_MemoryError -12
828
817
#define SWIG_NullReferenceError -13
1764
1753
int SWIG_Ruby_arity( VALUE proc, int minimal )
1766
if ( rb_respond_to( proc, swig_arity_id ) == Qtrue )
1755
if ( rb_respond_to( proc, swig_arity_id ) )
1768
1757
VALUE num = rb_funcall( proc, swig_arity_id, 0 );
1769
1758
int arity = NUM2INT(num);
2213
2202
/* -----------------------------------------------------------------------------
2214
2203
* Type initialization:
2215
* This problem is tough by the requirement that no dynamic
2216
* memory is used. Also, since swig_type_info structures store pointers to
2204
* This problem is tough by the requirement that no dynamic
2205
* memory is used. Also, since swig_type_info structures store pointers to
2217
2206
* swig_cast_info structures and swig_cast_info structures store pointers back
2218
* to swig_type_info structures, we need some lookup code at initialization.
2219
* The idea is that swig generates all the structures that are needed.
2220
* The runtime then collects these partially filled structures.
2221
* The SWIG_InitializeModule function takes these initial arrays out of
2207
* to swig_type_info structures, we need some lookup code at initialization.
2208
* The idea is that swig generates all the structures that are needed.
2209
* The runtime then collects these partially filled structures.
2210
* The SWIG_InitializeModule function takes these initial arrays out of
2222
2211
* swig_module, and does all the lookup, filling in the swig_module.types
2223
2212
* array with the correct data and linking the correct swig_cast_info
2224
2213
* structures together.
2226
* The generated swig_type_info structures are assigned staticly to an initial
2215
* The generated swig_type_info structures are assigned staticly to an initial
2227
2216
* array. We just loop through that array, and handle each type individually.
2228
2217
* First we lookup if this type has been already loaded, and if so, use the
2229
2218
* loaded structure instead of the generated one. Then we have to fill in the
2233
2222
* a column is one of the swig_cast_info structures for that type.
2234
2223
* The cast_initial array is actually an array of arrays, because each row has
2235
2224
* a variable number of columns. So to actually build the cast linked list,
2236
* we find the array of casts associated with the type, and loop through it
2225
* we find the array of casts associated with the type, and loop through it
2237
2226
* adding the casts to the list. The one last trick we need to do is making
2238
2227
* sure the type pointer in the swig_cast_info struct is correct.
2240
* First off, we lookup the cast->type name to see if it is already loaded.
2229
* First off, we lookup the cast->type name to see if it is already loaded.
2241
2230
* There are three cases to handle:
2242
2231
* 1) If the cast->type has already been loaded AND the type we are adding
2243
2232
* casting info to has not been loaded (it is in this module), THEN we
2244
2233
* replace the cast->type pointer with the type pointer that has already
2246
* 2) If BOTH types (the one we are adding casting info to, and the
2235
* 2) If BOTH types (the one we are adding casting info to, and the
2247
2236
* cast->type) are loaded, THEN the cast info has already been loaded by
2248
2237
* the previous module so we just ignore it.
2249
2238
* 3) Finally, if cast->type has not already been loaded, then we add that
2306
2295
module_head->next = &swig_module;
2309
/* When multiple interpeters are used, a module could have already been initialized in
2298
/* When multiple interpreters are used, a module could have already been initialized in
2310
2299
a different interpreter, but not yet have a pointer in this interpreter.
2311
2300
In this case, we do not want to continue adding types... everything should be
2312
2301
set up already */