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
* ----------------------------------------------------------------------------- */
11
/* -----------------------------------------------------------------------------
12
* This section contains generic SWIG labels for method/variable
13
* declarations/attributes, and other compiler dependent labels.
14
* ----------------------------------------------------------------------------- */
16
/* template workaround for compilers that cannot correctly implement the C++ standard */
17
#ifndef SWIGTEMPLATEDISAMBIGUATOR
18
# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
19
# define SWIGTEMPLATEDISAMBIGUATOR template
20
# elif defined(__HP_aCC)
21
/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
22
/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
23
# define SWIGTEMPLATEDISAMBIGUATOR template
25
# define SWIGTEMPLATEDISAMBIGUATOR
29
/* inline attribute */
31
# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
32
# define SWIGINLINE inline
38
/* attribute recognised by some compilers to avoid 'unused' warnings */
40
# if defined(__GNUC__)
41
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
42
# define SWIGUNUSED __attribute__ ((__unused__))
47
# define SWIGUNUSED __attribute__ ((__unused__))
53
#ifndef SWIG_MSC_UNSUPPRESS_4505
54
# if defined(_MSC_VER)
55
# pragma warning(disable : 4505) /* unreferenced local function has been removed */
59
#ifndef SWIGUNUSEDPARM
61
# define SWIGUNUSEDPARM(p)
63
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
67
/* internal SWIG method */
69
# define SWIGINTERN static SWIGUNUSED
72
/* internal inline SWIG method */
73
#ifndef SWIGINTERNINLINE
74
# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
77
/* exporting methods */
78
#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
79
# ifndef GCC_HASCLASSVISIBILITY
80
# define GCC_HASCLASSVISIBILITY
85
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
86
# if defined(STATIC_LINKED)
89
# define SWIGEXPORT __declspec(dllexport)
92
# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
93
# define SWIGEXPORT __attribute__ ((visibility("default")))
100
/* calling conventions for Windows */
102
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
103
# define SWIGSTDCALL __stdcall
109
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
110
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
111
# define _CRT_SECURE_NO_DEPRECATE
114
/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
115
#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
116
# define _SCL_SECURE_NO_DEPRECATE
120
#define SWIG_UnknownError -1
121
#define SWIG_IOError -2
122
#define SWIG_RuntimeError -3
123
#define SWIG_IndexError -4
124
#define SWIG_TypeError -5
125
#define SWIG_DivisionByZero -6
126
#define SWIG_OverflowError -7
127
#define SWIG_SyntaxError -8
128
#define SWIG_ValueError -9
129
#define SWIG_SystemError -10
130
#define SWIG_AttributeError -11
131
#define SWIG_MemoryError -12
132
#define SWIG_NullReferenceError -13
135
/* -----------------------------------------------------------------------------
138
* This file contains generic C API SWIG runtime support for pointer
140
* ----------------------------------------------------------------------------- */
142
/* This should only be incremented when either the layout of swig_type_info changes,
143
or for whatever reason, the runtime changes incompatibly */
144
#define SWIG_RUNTIME_VERSION "4"
146
/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
147
#ifdef SWIG_TYPE_TABLE
148
# define SWIG_QUOTE_STRING(x) #x
149
# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
150
# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
152
# define SWIG_TYPE_TABLE_NAME
156
You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
157
creating a static or dynamic library from the SWIG runtime code.
158
In 99.9% of the cases, SWIG just needs to declare them as 'static'.
160
But only do this if strictly necessary, ie, if you have problems
161
with your compiler or suchlike.
165
# define SWIGRUNTIME SWIGINTERN
168
#ifndef SWIGRUNTIMEINLINE
169
# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
172
/* Generic buffer size */
173
#ifndef SWIG_BUFFER_SIZE
174
# define SWIG_BUFFER_SIZE 1024
177
/* Flags for pointer conversions */
178
#define SWIG_POINTER_DISOWN 0x1
179
#define SWIG_CAST_NEW_MEMORY 0x2
181
/* Flags for new pointer objects */
182
#define SWIG_POINTER_OWN 0x1
186
Flags/methods for returning states.
188
The SWIG conversion methods, as ConvertPtr, return an integer
189
that tells if the conversion was successful or not. And if not,
190
an error code can be returned (see swigerrors.swg for the codes).
192
Use the following macros/flags to set or process the returning
195
In old versions of SWIG, code such as the following was usually written:
197
if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
203
Now you can be more explicit:
205
int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
206
if (SWIG_IsOK(res)) {
212
which is the same really, but now you can also do
215
int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
216
if (SWIG_IsOK(res)) {
218
if (SWIG_IsNewObj(res) {
228
I.e., now SWIG_ConvertPtr can return new objects and you can
229
identify the case and take care of the deallocation. Of course that
230
also requires SWIG_ConvertPtr to return new result values, such as
232
int SWIG_ConvertPtr(obj, ptr,...) {
234
if (<need new object>) {
235
*ptr = <ptr to new allocated object>;
238
*ptr = <ptr to old object>;
246
Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
247
more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
250
Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
251
allows to return the 'cast rank', for example, if you have this
258
food(1) // cast rank '1' (1 -> 1.0)
259
fooi(1) // cast rank '0'
261
just use the SWIG_AddCast()/SWIG_CheckState()
265
#define SWIG_ERROR (-1)
266
#define SWIG_IsOK(r) (r >= 0)
267
#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
269
/* The CastRankLimit says how many bits are used for the cast rank */
270
#define SWIG_CASTRANKLIMIT (1 << 8)
271
/* The NewMask denotes the object was created (using new/malloc) */
272
#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
273
/* The TmpMask is for in/out typemaps that use temporal objects */
274
#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
275
/* Simple returning values */
276
#define SWIG_BADOBJ (SWIG_ERROR)
277
#define SWIG_OLDOBJ (SWIG_OK)
278
#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
279
#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
280
/* Check, add and del mask methods */
281
#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
282
#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
283
#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
284
#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
285
#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
286
#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
289
#if defined(SWIG_CASTRANK_MODE)
290
# ifndef SWIG_TypeRank
291
# define SWIG_TypeRank unsigned long
293
# ifndef SWIG_MAXCASTRANK /* Default cast allowed */
294
# define SWIG_MAXCASTRANK (2)
296
# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
297
# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
298
SWIGINTERNINLINE int SWIG_AddCast(int r) {
299
return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
301
SWIGINTERNINLINE int SWIG_CheckState(int r) {
302
return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
304
#else /* no cast-rank mode */
305
# define SWIG_AddCast
306
# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
316
typedef void *(*swig_converter_func)(void *, int *);
317
typedef struct swig_type_info *(*swig_dycast_func)(void **);
319
/* Structure to store information on one type */
320
typedef struct swig_type_info {
321
const char *name; /* mangled name of this type */
322
const char *str; /* human readable name of this type */
323
swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
324
struct swig_cast_info *cast; /* linked list of types that can cast into this type */
325
void *clientdata; /* language specific type data */
326
int owndata; /* flag if the structure owns the clientdata */
329
/* Structure to store a type and conversion function used for casting */
330
typedef struct swig_cast_info {
331
swig_type_info *type; /* pointer to type that is equivalent to this type */
332
swig_converter_func converter; /* function to cast the void pointers */
333
struct swig_cast_info *next; /* pointer to next cast in linked list */
334
struct swig_cast_info *prev; /* pointer to the previous cast */
337
/* Structure used to store module information
338
* Each module generates one structure like this, and the runtime collects
339
* all of these structures and stores them in a circularly linked list.*/
340
typedef struct swig_module_info {
341
swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
342
size_t size; /* Number of types in this module */
343
struct swig_module_info *next; /* Pointer to next element in circularly linked list */
344
swig_type_info **type_initial; /* Array of initially generated type structures */
345
swig_cast_info **cast_initial; /* Array of initially generated casting structures */
346
void *clientdata; /* Language specific module data */
350
Compare two type names skipping the space characters, therefore
351
"char*" == "char *" and "Class<int>" == "Class<int >", etc.
353
Return 0 when the two name types are equivalent, as in
354
strncmp, but skipping ' '.
357
SWIG_TypeNameComp(const char *f1, const char *l1,
358
const char *f2, const char *l2) {
359
for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
360
while ((*f1 == ' ') && (f1 != l1)) ++f1;
361
while ((*f2 == ' ') && (f2 != l2)) ++f2;
362
if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
364
return (int)((l1 - f1) - (l2 - f2));
368
Check type equivalence in a name list like <name1>|<name2>|...
369
Return 0 if not equal, 1 if equal
372
SWIG_TypeEquiv(const char *nb, const char *tb) {
374
const char* te = tb + strlen(tb);
376
while (!equiv && *ne) {
377
for (nb = ne; *ne; ++ne) {
378
if (*ne == '|') break;
380
equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
387
Check type equivalence in a name list like <name1>|<name2>|...
388
Return 0 if equal, -1 if nb < tb, 1 if nb > tb
391
SWIG_TypeCompare(const char *nb, const char *tb) {
393
const char* te = tb + strlen(tb);
395
while (!equiv && *ne) {
396
for (nb = ne; *ne; ++ne) {
397
if (*ne == '|') break;
399
equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
409
SWIGRUNTIME swig_cast_info *
410
SWIG_TypeCheck(const char *c, swig_type_info *ty) {
412
swig_cast_info *iter = ty->cast;
414
if (strcmp(iter->type->name, c) == 0) {
415
if (iter == ty->cast)
417
/* Move iter to the top of the linked list */
418
iter->prev->next = iter->next;
420
iter->next->prev = iter->prev;
421
iter->next = ty->cast;
423
if (ty->cast) ty->cast->prev = iter;
434
Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
436
SWIGRUNTIME swig_cast_info *
437
SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
439
swig_cast_info *iter = ty->cast;
441
if (iter->type == from) {
442
if (iter == ty->cast)
444
/* Move iter to the top of the linked list */
445
iter->prev->next = iter->next;
447
iter->next->prev = iter->prev;
448
iter->next = ty->cast;
450
if (ty->cast) ty->cast->prev = iter;
461
Cast a pointer up an inheritance hierarchy
463
SWIGRUNTIMEINLINE void *
464
SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
465
return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
469
Dynamic pointer casting. Down an inheritance hierarchy
471
SWIGRUNTIME swig_type_info *
472
SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
473
swig_type_info *lastty = ty;
474
if (!ty || !ty->dcast) return ty;
475
while (ty && (ty->dcast)) {
476
ty = (*ty->dcast)(ptr);
483
Return the name associated with this type
485
SWIGRUNTIMEINLINE const char *
486
SWIG_TypeName(const swig_type_info *ty) {
491
Return the pretty name associated with this type,
492
that is an unmangled type name in a form presentable to the user.
494
SWIGRUNTIME const char *
495
SWIG_TypePrettyName(const swig_type_info *type) {
496
/* The "str" field contains the equivalent pretty names of the
497
type, separated by vertical-bar characters. We choose
498
to print the last name, as it is often (?) the most
500
if (!type) return NULL;
501
if (type->str != NULL) {
502
const char *last_name = type->str;
504
for (s = type->str; *s; s++)
505
if (*s == '|') last_name = s+1;
513
Set the clientdata field for a type
516
SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
517
swig_cast_info *cast = ti->cast;
518
/* if (ti->clientdata == clientdata) return; */
519
ti->clientdata = clientdata;
522
if (!cast->converter) {
523
swig_type_info *tc = cast->type;
524
if (!tc->clientdata) {
525
SWIG_TypeClientData(tc, clientdata);
532
SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
533
SWIG_TypeClientData(ti, clientdata);
538
Search for a swig_type_info structure only by mangled name
539
Search is a O(log #types)
541
We start searching at module start, and finish searching when start == end.
542
Note: if start == end at the beginning of the function, we go all the way around
545
SWIGRUNTIME swig_type_info *
546
SWIG_MangledTypeQueryModule(swig_module_info *start,
547
swig_module_info *end,
549
swig_module_info *iter = start;
552
register size_t l = 0;
553
register size_t r = iter->size - 1;
555
/* since l+r >= 0, we can (>> 1) instead (/ 2) */
556
register size_t i = (l + r) >> 1;
557
const char *iname = iter->types[i]->name;
559
register int compare = strcmp(name, iname);
561
return iter->types[i];
562
} else if (compare < 0) {
568
} else if (compare > 0) {
572
break; /* should never happen */
577
} while (iter != end);
582
Search for a swig_type_info structure for either a mangled name or a human readable name.
583
It first searches the mangled names of the types, which is a O(log #types)
584
If a type is not found it then searches the human readable names, which is O(#types).
586
We start searching at module start, and finish searching when start == end.
587
Note: if start == end at the beginning of the function, we go all the way around
590
SWIGRUNTIME swig_type_info *
591
SWIG_TypeQueryModule(swig_module_info *start,
592
swig_module_info *end,
594
/* STEP 1: Search the name field using binary search */
595
swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
599
/* STEP 2: If the type hasn't been found, do a complete search
600
of the str field (the human readable name) */
601
swig_module_info *iter = start;
603
register size_t i = 0;
604
for (; i < iter->size; ++i) {
605
if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
606
return iter->types[i];
609
} while (iter != end);
612
/* neither found a match */
617
Pack binary data into a string
620
SWIG_PackData(char *c, void *ptr, size_t sz) {
621
static const char hex[17] = "0123456789abcdef";
622
register const unsigned char *u = (unsigned char *) ptr;
623
register const unsigned char *eu = u + sz;
624
for (; u != eu; ++u) {
625
register unsigned char uu = *u;
626
*(c++) = hex[(uu & 0xf0) >> 4];
627
*(c++) = hex[uu & 0xf];
633
Unpack binary data from a string
635
SWIGRUNTIME const char *
636
SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
637
register unsigned char *u = (unsigned char *) ptr;
638
register const unsigned char *eu = u + sz;
639
for (; u != eu; ++u) {
640
register char d = *(c++);
641
register unsigned char uu;
642
if ((d >= '0') && (d <= '9'))
643
uu = (unsigned char)((d - '0') << 4);
644
else if ((d >= 'a') && (d <= 'f'))
645
uu = (unsigned char)((d - ('a'-10)) << 4);
649
if ((d >= '0') && (d <= '9'))
650
uu |= (unsigned char)(d - '0');
651
else if ((d >= 'a') && (d <= 'f'))
652
uu |= (unsigned char)(d - ('a'-10));
661
Pack 'void *' into a string buffer.
664
SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
666
if ((2*sizeof(void *) + 2) > bsz) return 0;
668
r = SWIG_PackData(r,&ptr,sizeof(void *));
669
if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
674
SWIGRUNTIME const char *
675
SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
677
if (strcmp(c,"NULL") == 0) {
684
return SWIG_UnpackData(++c,ptr,sizeof(void *));
688
SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
690
size_t lname = (name ? strlen(name) : 0);
691
if ((2*sz + 2 + lname) > bsz) return 0;
693
r = SWIG_PackData(r,ptr,sz);
695
strncpy(r,name,lname+1);
702
SWIGRUNTIME const char *
703
SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
705
if (strcmp(c,"NULL") == 0) {
712
return SWIG_UnpackData(++c,ptr,sz);
719
/* Needed on some windows machines---since MS plays funny games with the header files under C++ */
728
/* Add in functionality missing in older versions of Perl. Much of this is based on Devel-PPPort on cpan. */
730
/* Add PERL_REVISION, PERL_VERSION, PERL_SUBVERSION if missing */
731
#ifndef PERL_REVISION
732
# if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
733
# define PERL_PATCHLEVEL_H_IMPLICIT
734
# include <patchlevel.h>
736
# if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
737
# include <could_not_find_Perl_patchlevel.h>
739
# ifndef PERL_REVISION
740
# define PERL_REVISION (5)
741
# define PERL_VERSION PATCHLEVEL
742
# define PERL_SUBVERSION SUBVERSION
746
#if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE)
747
#define PerlIO_exportFILE(fh,fl) (FILE*)(fh)
751
# define SvIOK_UV(sv) (SvIOK(sv) && (SvUVX(sv) == SvIVX(sv)))
755
# define SvUOK(sv) SvIOK_UV(sv)
758
#if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5)))
759
# define PL_sv_undef sv_undef
761
# define PL_errgv errgv
762
# define PL_sv_no sv_no
763
# define PL_sv_yes sv_yes
764
# define PL_markstack_ptr markstack_ptr
769
# define IVSIZE LONGSIZE
771
# define IVSIZE 4 /* A bold guess, but the best we can make. */
776
# if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
778
# define INT2PTR(any,d) (any)(d)
780
# if PTRSIZE == LONGSIZE
781
# define PTRV unsigned long
783
# define PTRV unsigned
785
# define INT2PTR(any,d) (any)(PTRV)(d)
788
# define NUM2PTR(any,d) (any)(PTRV)(d)
789
# define PTR2IV(p) INT2PTR(IV,p)
790
# define PTR2UV(p) INT2PTR(UV,p)
791
# define PTR2NV(p) NUM2PTR(NV,p)
793
# if PTRSIZE == LONGSIZE
794
# define PTR2ul(p) (unsigned long)(p)
796
# define PTR2ul(p) INT2PTR(unsigned long,p)
798
#endif /* !INT2PTR */
801
# define SvPV_nolen(x) SvPV(x,PL_na)
805
# define get_sv perl_get_sv
809
# define ERRSV get_sv("@",FALSE)
820
/* -----------------------------------------------------------------------------
822
* ----------------------------------------------------------------------------- */
824
SWIGINTERN const char*
825
SWIG_Perl_ErrorType(int code) {
827
case SWIG_MemoryError:
828
return "MemoryError";
831
case SWIG_RuntimeError:
832
return "RuntimeError";
833
case SWIG_IndexError:
837
case SWIG_DivisionByZero:
838
return "ZeroDivisionError";
839
case SWIG_OverflowError:
840
return "OverflowError";
841
case SWIG_SyntaxError:
842
return "SyntaxError";
843
case SWIG_ValueError:
845
case SWIG_SystemError:
846
return "SystemError";
847
case SWIG_AttributeError:
848
return "AttributeError";
850
return "RuntimeError";
854
/* -----------------------------------------------------------------------------
857
* This file contains the runtime support for Perl modules
858
* and includes code for managing global variables and pointer
860
* ----------------------------------------------------------------------------- */
863
#define SWIG_PERL_OBJECT_DECL CPerlObj *SWIGUNUSEDPARM(pPerl),
864
#define SWIG_PERL_OBJECT_CALL pPerl,
866
#define SWIG_PERL_OBJECT_DECL
867
#define SWIG_PERL_OBJECT_CALL
870
/* Common SWIG API */
872
/* for raw pointers */
873
#define SWIG_ConvertPtr(obj, pp, type, flags) SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags)
874
#define SWIG_ConvertPtrAndOwn(obj, pp, type, flags,own) SWIG_Perl_ConvertPtrAndOwn(SWIG_PERL_OBJECT_CALL obj, pp, type, flags, own)
875
#define SWIG_NewPointerObj(p, type, flags) SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags)
877
/* for raw packed data */
878
#define SWIG_ConvertPacked(obj, p, s, type) SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type)
879
#define SWIG_NewPackedObj(p, s, type) SWIG_Perl_NewPackedObj(SWIG_PERL_OBJECT_CALL p, s, type)
881
/* for class or struct pointers */
882
#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
883
#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
885
/* for C or C++ function pointers */
886
#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0)
887
#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0)
889
/* for C++ member pointers, ie, member methods */
890
#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_ConvertPacked(obj, ptr, sz, ty)
891
#define SWIG_NewMemberObj(ptr, sz, type) SWIG_NewPackedObj(ptr, sz, type)
896
#define SWIG_GetModule(clientdata) SWIG_Perl_GetModule()
897
#define SWIG_SetModule(clientdata, pointer) SWIG_Perl_SetModule(pointer)
900
/* Error manipulation */
902
#define SWIG_ErrorType(code) SWIG_Perl_ErrorType(code)
903
#define SWIG_Error(code, msg) sv_setpvf(get_sv("@", GV_ADD), "%s %s", SWIG_ErrorType(code), msg)
904
#define SWIG_fail goto fail
906
/* Perl-specific SWIG API */
908
#define SWIG_MakePtr(sv, ptr, type, flags) SWIG_Perl_MakePtr(SWIG_PERL_OBJECT_CALL sv, ptr, type, flags)
909
#define SWIG_MakePackedObj(sv, p, s, type) SWIG_Perl_MakePackedObj(SWIG_PERL_OBJECT_CALL sv, p, s, type)
910
#define SWIG_SetError(str) SWIG_Error(SWIG_RuntimeError, str)
913
#define SWIG_PERL_DECL_ARGS_1(arg1) (SWIG_PERL_OBJECT_DECL arg1)
914
#define SWIG_PERL_CALL_ARGS_1(arg1) (SWIG_PERL_OBJECT_CALL arg1)
915
#define SWIG_PERL_DECL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_DECL arg1, arg2)
916
#define SWIG_PERL_CALL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_CALL arg1, arg2)
918
/* -----------------------------------------------------------------------------
919
* pointers/data manipulation
920
* ----------------------------------------------------------------------------- */
922
/* For backward compatibility only */
923
#define SWIG_POINTER_EXCEPTION 0
929
#define SWIG_OWNER SWIG_POINTER_OWN
930
#define SWIG_SHADOW SWIG_OWNER << 1
932
#define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL
934
/* SWIG Perl macros */
936
/* Macro to declare an XS function */
938
# define XSPROTO(name) void name(pTHX_ CV* cv)
941
/* Macro to call an XS function */
943
# define SWIG_CALLXS(_name) _name(cv,pPerl)
945
# ifndef MULTIPLICITY
946
# define SWIG_CALLXS(_name) _name(cv)
948
# define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv)
953
#define MAGIC_PPERL CPerlObj *pPerl = (CPerlObj *) this;
958
typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *);
963
#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
964
#define SWIGCLASS_STATIC
966
#else /* PERL_OBJECT */
969
#define SWIGCLASS_STATIC static SWIGUNUSED
972
#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
977
typedef int (*SwigMagicFunc)(SV *, MAGIC *);
982
#else /* MULTIPLICITY */
984
#define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b)
989
typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *);
994
#endif /* MULTIPLICITY */
995
#endif /* PERL_OBJECT */
998
# define SWIG_croak_null() SWIG_Perl_croak_null(pPerl)
999
static void SWIG_Perl_croak_null(CPerlObj *pPerl)
1001
static void SWIG_croak_null()
1004
SV *err = get_sv("@", GV_ADD);
1005
# if (PERL_VERSION < 6)
1008
if (sv_isobject(err))
1011
croak("%s", SvPV_nolen(err));
1017
Define how strict is the cast between strings and integers/doubles
1018
when overloading between these types occurs.
1020
The default is making it as strict as possible by using SWIG_AddCast
1023
You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to
1024
disable the SWIG_AddCast, making the casting between string and
1025
numbers less strict.
1027
In the end, we try to solve the overloading between strings and
1028
numerical types in the more natural way, but if you can avoid it,
1029
well, avoid it using %rename, for example.
1031
#ifndef SWIG_PERL_NO_STRICT_STR2NUM
1032
# ifndef SWIG_PERL_STRICT_STR2NUM
1033
# define SWIG_PERL_STRICT_STR2NUM
1036
#ifdef SWIG_PERL_STRICT_STR2NUM
1037
/* string takes precedence */
1038
#define SWIG_Str2NumCast(x) SWIG_AddCast(x)
1040
/* number takes precedence */
1041
#define SWIG_Str2NumCast(x) x
1048
SWIGRUNTIME const char *
1049
SWIG_Perl_TypeProxyName(const swig_type_info *type) {
1050
if (!type) return NULL;
1051
if (type->clientdata != NULL) {
1052
return (const char*) type->clientdata;
1059
/* Identical to SWIG_TypeCheck, except for strcmp comparison */
1060
SWIGRUNTIME swig_cast_info *
1061
SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) {
1063
swig_cast_info *iter = ty->cast;
1065
if (strcmp(SWIG_Perl_TypeProxyName(iter->type), c) == 0) {
1066
if (iter == ty->cast)
1068
/* Move iter to the top of the linked list */
1069
iter->prev->next = iter->next;
1071
iter->next->prev = iter->prev;
1072
iter->next = ty->cast;
1074
if (ty->cast) ty->cast->prev = iter;
1084
/* Function for getting a pointer value */
1087
SWIG_Perl_ConvertPtrAndOwn(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags, int *own) {
1089
void *voidptr = (void *)0;
1095
/* If magical, apply more magic */
1099
/* Check to see if this is an object */
1100
if (sv_isobject(sv)) {
1102
tsv = (SV*) SvRV(sv);
1103
if ((SvTYPE(tsv) == SVt_PVHV)) {
1105
if (SvMAGICAL(tsv)) {
1106
mg = mg_find(tsv,'P');
1109
if (sv_isobject(sv)) {
1110
tsv = (SV*)SvRV(sv);
1120
voidptr = INT2PTR(void *,tmp);
1121
} else if (! SvOK(sv)) { /* Check for undef */
1122
*(ptr) = (void *) 0;
1124
} else if (SvTYPE(sv) == SVt_RV) { /* Check for NULL pointer */
1126
/* In Perl 5.12 and later, SVt_RV == SVt_IV, so sv could be a valid integer value. */
1130
/* NULL pointer (reference to undef). */
1131
*(ptr) = (void *) 0;
1137
} else { /* Don't know what it is */
1141
/* Now see if the types match */
1142
char *_c = HvNAME(SvSTASH(SvRV(sv)));
1143
tc = SWIG_TypeProxyCheck(_c,_t);
1149
*ptr = SWIG_TypeCast(tc,voidptr,&newmemory);
1150
if (newmemory == SWIG_CAST_NEW_MEMORY) {
1151
assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
1153
*own = *own | SWIG_CAST_NEW_MEMORY;
1161
* DISOWN implementation: we need a perl guru to check this one.
1163
if (tsv && (flags & SWIG_POINTER_DISOWN)) {
1165
* almost copy paste code from below SWIG_POINTER_OWN setting
1168
HV *stash = SvSTASH(SvRV(obj));
1169
GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
1173
* To set ownership (see below), a newSViv(1) entry is added.
1174
* Hence, to remove ownership, we delete the entry.
1176
if (hv_exists_ent(hv, obj, 0)) {
1177
hv_delete_ent(hv, obj, 0, 0);
1185
SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) {
1186
return SWIG_Perl_ConvertPtrAndOwn(sv, ptr, _t, flags, 0);
1190
SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) {
1191
if (ptr && (flags & (SWIG_SHADOW | SWIG_POINTER_OWN))) {
1196
sv_setref_pv(obj, SWIG_Perl_TypeProxyName(t), ptr);
1197
stash=SvSTASH(SvRV(obj));
1198
if (flags & SWIG_POINTER_OWN) {
1200
GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
1202
gv_init(gv, stash, "OWNER", 5, FALSE);
1204
hv_store_ent(hv, obj, newSViv(1), 0);
1206
sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0);
1208
self=newRV_noinc((SV *)hash);
1210
SvREFCNT_dec((SV *)self);
1211
sv_bless(sv, stash);
1214
sv_setref_pv(sv, SWIG_Perl_TypeProxyName(t), ptr);
1218
SWIGRUNTIMEINLINE SV *
1219
SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) {
1220
SV *result = sv_newmortal();
1221
SWIG_MakePtr(result, ptr, t, flags);
1226
SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) {
1229
if ((2*sz + 1 + strlen(SWIG_Perl_TypeProxyName(type))) > 1000) return;
1231
r = SWIG_PackData(r,ptr,sz);
1232
strcpy(r,SWIG_Perl_TypeProxyName(type));
1233
sv_setpv(sv, result);
1237
SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info *type) {
1238
SV *result = sv_newmortal();
1239
SWIG_Perl_MakePackedObj(result, ptr, sz, type);
1243
/* Convert a packed value value */
1245
SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) {
1249
if ((!obj) || (!SvOK(obj))) return SWIG_ERROR;
1250
c = SvPV_nolen(obj);
1251
/* Pointer values must start with leading underscore */
1252
if (*c != '_') return SWIG_ERROR;
1254
c = SWIG_UnpackData(c,ptr,sz);
1256
tc = SWIG_TypeCheck(c,ty);
1257
if (!tc) return SWIG_ERROR;
1263
/* Macros for low-level exception handling */
1264
#define SWIG_croak(x) { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; }
1267
typedef XSPROTO(SwigPerlWrapper);
1268
typedef SwigPerlWrapper *SwigPerlWrapperPtr;
1270
/* Structure for command table */
1273
SwigPerlWrapperPtr wrapper;
1274
} swig_command_info;
1276
/* Information for constant table */
1279
#define SWIG_FLOAT 2
1280
#define SWIG_STRING 3
1281
#define SWIG_POINTER 4
1282
#define SWIG_BINARY 5
1284
/* Constant information structure */
1285
typedef struct swig_constant_info {
1291
swig_type_info **ptype;
1292
} swig_constant_info;
1295
/* Structure for variable table */
1300
swig_type_info **type;
1301
} swig_variable_info;
1303
/* Magic variable code */
1306
# define swig_create_magic(s,a,b,c) _swig_create_magic(s,const_cast<char*>(a),b,c)
1308
# define swig_create_magic(s,a,b,c) _swig_create_magic(s,(char*)(a),b,c)
1310
# ifndef MULTIPLICITY
1311
SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *))
1313
SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *))
1316
# define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c)
1317
SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *))
1321
sv_magic(sv,sv,'U',name,strlen(name));
1322
mg = mg_find(sv,'U');
1323
mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
1324
mg->mg_virtual->svt_get = (SwigMagicFunc) get;
1325
mg->mg_virtual->svt_set = (SwigMagicFunc) set;
1326
mg->mg_virtual->svt_len = 0;
1327
mg->mg_virtual->svt_clear = 0;
1328
mg->mg_virtual->svt_free = 0;
1332
SWIGRUNTIME swig_module_info *
1333
SWIG_Perl_GetModule(void) {
1334
static void *type_pointer = (void *)0;
1337
/* first check if pointer already created */
1338
if (!type_pointer) {
1339
pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE | GV_ADDMULTI);
1340
if (pointer && SvOK(pointer)) {
1341
type_pointer = INT2PTR(swig_type_info **, SvIV(pointer));
1345
return (swig_module_info *) type_pointer;
1349
SWIG_Perl_SetModule(swig_module_info *module) {
1352
/* create a new pointer */
1353
pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE | GV_ADDMULTI);
1354
sv_setiv(pointer, PTR2IV(module));
1360
/* -----------------------------------------------------------------------------*
1361
Standard SWIG API for use inside user code.
1363
Don't include this file directly, run the command
1364
swig -python -external-runtime
1365
Also, read the Modules chapter of the SWIG Manual.
1367
* -----------------------------------------------------------------------------*/
1369
#ifdef SWIG_MODULE_CLIENTDATA_TYPE
1371
SWIGRUNTIMEINLINE swig_type_info *
1372
SWIG_TypeQuery(SWIG_MODULE_CLIENTDATA_TYPE clientdata, const char *name) {
1373
swig_module_info *module = SWIG_GetModule(clientdata);
1374
return SWIG_TypeQueryModule(module, module, name);
1377
SWIGRUNTIMEINLINE swig_type_info *
1378
SWIG_MangledTypeQuery(SWIG_MODULE_CLIENTDATA_TYPE clientdata, const char *name) {
1379
swig_module_info *module = SWIG_GetModule(clientdata);
1380
return SWIG_MangledTypeQueryModule(module, module, name);
1385
SWIGRUNTIMEINLINE swig_type_info *
1386
SWIG_TypeQuery(const char *name) {
1387
swig_module_info *module = SWIG_GetModule(NULL);
1388
return SWIG_TypeQueryModule(module, module, name);
1391
SWIGRUNTIMEINLINE swig_type_info *
1392
SWIG_MangledTypeQuery(const char *name) {
1393
swig_module_info *module = SWIG_GetModule(NULL);
1394
return SWIG_MangledTypeQueryModule(module, module, name);