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
* ----------------------------------------------------------------------------- */
16
#define SWIG_CASTRANK_MODE
18
/* -----------------------------------------------------------------------------
19
* This section contains generic SWIG labels for method/variable
20
* declarations/attributes, and other compiler dependent labels.
21
* ----------------------------------------------------------------------------- */
23
/* template workaround for compilers that cannot correctly implement the C++ standard */
24
#ifndef SWIGTEMPLATEDISAMBIGUATOR
25
# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
26
# define SWIGTEMPLATEDISAMBIGUATOR template
27
# elif defined(__HP_aCC)
28
/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
29
/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
30
# define SWIGTEMPLATEDISAMBIGUATOR template
32
# define SWIGTEMPLATEDISAMBIGUATOR
36
/* inline attribute */
38
# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
39
# define SWIGINLINE inline
45
/* attribute recognised by some compilers to avoid 'unused' warnings */
47
# if defined(__GNUC__)
48
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
49
# define SWIGUNUSED __attribute__ ((__unused__))
54
# define SWIGUNUSED __attribute__ ((__unused__))
60
#ifndef SWIG_MSC_UNSUPPRESS_4505
61
# if defined(_MSC_VER)
62
# pragma warning(disable : 4505) /* unreferenced local function has been removed */
66
#ifndef SWIGUNUSEDPARM
68
# define SWIGUNUSEDPARM(p)
70
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
74
/* internal SWIG method */
76
# define SWIGINTERN static SWIGUNUSED
79
/* internal inline SWIG method */
80
#ifndef SWIGINTERNINLINE
81
# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
84
/* exporting methods */
86
# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
87
# ifndef GCC_HASCLASSVISIBILITY
88
# define GCC_HASCLASSVISIBILITY
94
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
95
# if defined(STATIC_LINKED)
98
# define SWIGEXPORT __declspec(dllexport)
101
# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
102
# define SWIGEXPORT __attribute__ ((visibility("default")))
109
/* calling conventions for Windows */
111
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
112
# define SWIGSTDCALL __stdcall
118
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
119
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
120
# define _CRT_SECURE_NO_DEPRECATE
123
/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
124
#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
125
# define _SCL_SECURE_NO_DEPRECATE
128
/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
129
#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
130
# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
133
/* Intel's compiler complains if a variable which was never initialised is
134
* cast to void, which is a common idiom which we use to indicate that we
135
* are aware a variable isn't used. So we just silence that warning.
136
* See: https://github.com/swig/swig/issues/192 for more discussion.
138
#ifdef __INTEL_COMPILER
139
# pragma warning disable 592
142
/* -----------------------------------------------------------------------------
145
* This file contains generic C API SWIG runtime support for pointer
147
* ----------------------------------------------------------------------------- */
149
/* This should only be incremented when either the layout of swig_type_info changes,
150
or for whatever reason, the runtime changes incompatibly */
151
#define SWIG_RUNTIME_VERSION "4"
153
/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
154
#ifdef SWIG_TYPE_TABLE
155
# define SWIG_QUOTE_STRING(x) #x
156
# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
157
# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
159
# define SWIG_TYPE_TABLE_NAME
163
You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
164
creating a static or dynamic library from the SWIG runtime code.
165
In 99.9% of the cases, SWIG just needs to declare them as 'static'.
167
But only do this if strictly necessary, ie, if you have problems
168
with your compiler or suchlike.
172
# define SWIGRUNTIME SWIGINTERN
175
#ifndef SWIGRUNTIMEINLINE
176
# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
179
/* Generic buffer size */
180
#ifndef SWIG_BUFFER_SIZE
181
# define SWIG_BUFFER_SIZE 1024
184
/* Flags for pointer conversions */
185
#define SWIG_POINTER_DISOWN 0x1
186
#define SWIG_CAST_NEW_MEMORY 0x2
188
/* Flags for new pointer objects */
189
#define SWIG_POINTER_OWN 0x1
193
Flags/methods for returning states.
195
The SWIG conversion methods, as ConvertPtr, return an integer
196
that tells if the conversion was successful or not. And if not,
197
an error code can be returned (see swigerrors.swg for the codes).
199
Use the following macros/flags to set or process the returning
202
In old versions of SWIG, code such as the following was usually written:
204
if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
210
Now you can be more explicit:
212
int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
213
if (SWIG_IsOK(res)) {
219
which is the same really, but now you can also do
222
int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
223
if (SWIG_IsOK(res)) {
225
if (SWIG_IsNewObj(res) {
235
I.e., now SWIG_ConvertPtr can return new objects and you can
236
identify the case and take care of the deallocation. Of course that
237
also requires SWIG_ConvertPtr to return new result values, such as
239
int SWIG_ConvertPtr(obj, ptr,...) {
241
if (<need new object>) {
242
*ptr = <ptr to new allocated object>;
245
*ptr = <ptr to old object>;
253
Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
254
more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
257
Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
258
allows to return the 'cast rank', for example, if you have this
265
food(1) // cast rank '1' (1 -> 1.0)
266
fooi(1) // cast rank '0'
268
just use the SWIG_AddCast()/SWIG_CheckState()
272
#define SWIG_ERROR (-1)
273
#define SWIG_IsOK(r) (r >= 0)
274
#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
276
/* The CastRankLimit says how many bits are used for the cast rank */
277
#define SWIG_CASTRANKLIMIT (1 << 8)
278
/* The NewMask denotes the object was created (using new/malloc) */
279
#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
280
/* The TmpMask is for in/out typemaps that use temporal objects */
281
#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
282
/* Simple returning values */
283
#define SWIG_BADOBJ (SWIG_ERROR)
284
#define SWIG_OLDOBJ (SWIG_OK)
285
#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
286
#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
287
/* Check, add and del mask methods */
288
#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
289
#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
290
#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
291
#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
292
#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
293
#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
296
#if defined(SWIG_CASTRANK_MODE)
297
# ifndef SWIG_TypeRank
298
# define SWIG_TypeRank unsigned long
300
# ifndef SWIG_MAXCASTRANK /* Default cast allowed */
301
# define SWIG_MAXCASTRANK (2)
303
# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
304
# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
305
SWIGINTERNINLINE int SWIG_AddCast(int r) {
306
return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
308
SWIGINTERNINLINE int SWIG_CheckState(int r) {
309
return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
311
#else /* no cast-rank mode */
312
# define SWIG_AddCast(r) (r)
313
# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
323
typedef void *(*swig_converter_func)(void *, int *);
324
typedef struct swig_type_info *(*swig_dycast_func)(void **);
326
/* Structure to store information on one type */
327
typedef struct swig_type_info {
328
const char *name; /* mangled name of this type */
329
const char *str; /* human readable name of this type */
330
swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
331
struct swig_cast_info *cast; /* linked list of types that can cast into this type */
332
void *clientdata; /* language specific type data */
333
int owndata; /* flag if the structure owns the clientdata */
336
/* Structure to store a type and conversion function used for casting */
337
typedef struct swig_cast_info {
338
swig_type_info *type; /* pointer to type that is equivalent to this type */
339
swig_converter_func converter; /* function to cast the void pointers */
340
struct swig_cast_info *next; /* pointer to next cast in linked list */
341
struct swig_cast_info *prev; /* pointer to the previous cast */
344
/* Structure used to store module information
345
* Each module generates one structure like this, and the runtime collects
346
* all of these structures and stores them in a circularly linked list.*/
347
typedef struct swig_module_info {
348
swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
349
size_t size; /* Number of types in this module */
350
struct swig_module_info *next; /* Pointer to next element in circularly linked list */
351
swig_type_info **type_initial; /* Array of initially generated type structures */
352
swig_cast_info **cast_initial; /* Array of initially generated casting structures */
353
void *clientdata; /* Language specific module data */
357
Compare two type names skipping the space characters, therefore
358
"char*" == "char *" and "Class<int>" == "Class<int >", etc.
360
Return 0 when the two name types are equivalent, as in
361
strncmp, but skipping ' '.
364
SWIG_TypeNameComp(const char *f1, const char *l1,
365
const char *f2, const char *l2) {
366
for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
367
while ((*f1 == ' ') && (f1 != l1)) ++f1;
368
while ((*f2 == ' ') && (f2 != l2)) ++f2;
369
if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
371
return (int)((l1 - f1) - (l2 - f2));
375
Check type equivalence in a name list like <name1>|<name2>|...
376
Return 0 if equal, -1 if nb < tb, 1 if nb > tb
379
SWIG_TypeCmp(const char *nb, const char *tb) {
381
const char* te = tb + strlen(tb);
383
while (equiv != 0 && *ne) {
384
for (nb = ne; *ne; ++ne) {
385
if (*ne == '|') break;
387
equiv = SWIG_TypeNameComp(nb, ne, tb, te);
394
Check type equivalence in a name list like <name1>|<name2>|...
395
Return 0 if not equal, 1 if equal
398
SWIG_TypeEquiv(const char *nb, const char *tb) {
399
return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
405
SWIGRUNTIME swig_cast_info *
406
SWIG_TypeCheck(const char *c, swig_type_info *ty) {
408
swig_cast_info *iter = ty->cast;
410
if (strcmp(iter->type->name, c) == 0) {
411
if (iter == ty->cast)
413
/* Move iter to the top of the linked list */
414
iter->prev->next = iter->next;
416
iter->next->prev = iter->prev;
417
iter->next = ty->cast;
419
if (ty->cast) ty->cast->prev = iter;
430
Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
432
SWIGRUNTIME swig_cast_info *
433
SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
435
swig_cast_info *iter = ty->cast;
437
if (iter->type == from) {
438
if (iter == ty->cast)
440
/* Move iter to the top of the linked list */
441
iter->prev->next = iter->next;
443
iter->next->prev = iter->prev;
444
iter->next = ty->cast;
446
if (ty->cast) ty->cast->prev = iter;
457
Cast a pointer up an inheritance hierarchy
459
SWIGRUNTIMEINLINE void *
460
SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
461
return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
465
Dynamic pointer casting. Down an inheritance hierarchy
467
SWIGRUNTIME swig_type_info *
468
SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
469
swig_type_info *lastty = ty;
470
if (!ty || !ty->dcast) return ty;
471
while (ty && (ty->dcast)) {
472
ty = (*ty->dcast)(ptr);
479
Return the name associated with this type
481
SWIGRUNTIMEINLINE const char *
482
SWIG_TypeName(const swig_type_info *ty) {
487
Return the pretty name associated with this type,
488
that is an unmangled type name in a form presentable to the user.
490
SWIGRUNTIME const char *
491
SWIG_TypePrettyName(const swig_type_info *type) {
492
/* The "str" field contains the equivalent pretty names of the
493
type, separated by vertical-bar characters. We choose
494
to print the last name, as it is often (?) the most
496
if (!type) return NULL;
497
if (type->str != NULL) {
498
const char *last_name = type->str;
500
for (s = type->str; *s; s++)
501
if (*s == '|') last_name = s+1;
509
Set the clientdata field for a type
512
SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
513
swig_cast_info *cast = ti->cast;
514
/* if (ti->clientdata == clientdata) return; */
515
ti->clientdata = clientdata;
518
if (!cast->converter) {
519
swig_type_info *tc = cast->type;
520
if (!tc->clientdata) {
521
SWIG_TypeClientData(tc, clientdata);
528
SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
529
SWIG_TypeClientData(ti, clientdata);
534
Search for a swig_type_info structure only by mangled name
535
Search is a O(log #types)
537
We start searching at module start, and finish searching when start == end.
538
Note: if start == end at the beginning of the function, we go all the way around
541
SWIGRUNTIME swig_type_info *
542
SWIG_MangledTypeQueryModule(swig_module_info *start,
543
swig_module_info *end,
545
swig_module_info *iter = start;
549
size_t r = iter->size - 1;
551
/* since l+r >= 0, we can (>> 1) instead (/ 2) */
552
size_t i = (l + r) >> 1;
553
const char *iname = iter->types[i]->name;
555
int compare = strcmp(name, iname);
557
return iter->types[i];
558
} else if (compare < 0) {
564
} else if (compare > 0) {
568
break; /* should never happen */
573
} while (iter != end);
578
Search for a swig_type_info structure for either a mangled name or a human readable name.
579
It first searches the mangled names of the types, which is a O(log #types)
580
If a type is not found it then searches the human readable names, which is O(#types).
582
We start searching at module start, and finish searching when start == end.
583
Note: if start == end at the beginning of the function, we go all the way around
586
SWIGRUNTIME swig_type_info *
587
SWIG_TypeQueryModule(swig_module_info *start,
588
swig_module_info *end,
590
/* STEP 1: Search the name field using binary search */
591
swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
595
/* STEP 2: If the type hasn't been found, do a complete search
596
of the str field (the human readable name) */
597
swig_module_info *iter = start;
600
for (; i < iter->size; ++i) {
601
if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
602
return iter->types[i];
605
} while (iter != end);
608
/* neither found a match */
613
Pack binary data into a string
616
SWIG_PackData(char *c, void *ptr, size_t sz) {
617
static const char hex[17] = "0123456789abcdef";
618
const unsigned char *u = (unsigned char *) ptr;
619
const unsigned char *eu = u + sz;
620
for (; u != eu; ++u) {
621
unsigned char uu = *u;
622
*(c++) = hex[(uu & 0xf0) >> 4];
623
*(c++) = hex[uu & 0xf];
629
Unpack binary data from a string
631
SWIGRUNTIME const char *
632
SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
633
unsigned char *u = (unsigned char *) ptr;
634
const unsigned char *eu = u + sz;
635
for (; u != eu; ++u) {
638
if ((d >= '0') && (d <= '9'))
639
uu = (unsigned char)((d - '0') << 4);
640
else if ((d >= 'a') && (d <= 'f'))
641
uu = (unsigned char)((d - ('a'-10)) << 4);
645
if ((d >= '0') && (d <= '9'))
646
uu |= (unsigned char)(d - '0');
647
else if ((d >= 'a') && (d <= 'f'))
648
uu |= (unsigned char)(d - ('a'-10));
657
Pack 'void *' into a string buffer.
660
SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
662
if ((2*sizeof(void *) + 2) > bsz) return 0;
664
r = SWIG_PackData(r,&ptr,sizeof(void *));
665
if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
670
SWIGRUNTIME const char *
671
SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
673
if (strcmp(c,"NULL") == 0) {
680
return SWIG_UnpackData(++c,ptr,sizeof(void *));
684
SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
686
size_t lname = (name ? strlen(name) : 0);
687
if ((2*sz + 2 + lname) > bsz) return 0;
689
r = SWIG_PackData(r,ptr,sz);
691
strncpy(r,name,lname+1);
698
SWIGRUNTIME const char *
699
SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
701
if (strcmp(c,"NULL") == 0) {
708
return SWIG_UnpackData(++c,ptr,sz);
716
#define SWIG_UnknownError -1
717
#define SWIG_IOError -2
718
#define SWIG_RuntimeError -3
719
#define SWIG_IndexError -4
720
#define SWIG_TypeError -5
721
#define SWIG_DivisionByZero -6
722
#define SWIG_OverflowError -7
723
#define SWIG_SyntaxError -8
724
#define SWIG_ValueError -9
725
#define SWIG_SystemError -10
726
#define SWIG_AttributeError -11
727
#define SWIG_MemoryError -12
728
#define SWIG_NullReferenceError -13
733
/* Needed on some windows machines---since MS plays funny games with the header files under C++ */
742
/* Add in functionality missing in older versions of Perl. Much of this is based on Devel-PPPort on cpan. */
744
/* Add PERL_REVISION, PERL_VERSION, PERL_SUBVERSION if missing */
745
#ifndef PERL_REVISION
746
# if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
747
# define PERL_PATCHLEVEL_H_IMPLICIT
748
# include <patchlevel.h>
750
# if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
751
# include <could_not_find_Perl_patchlevel.h>
753
# ifndef PERL_REVISION
754
# define PERL_REVISION (5)
755
# define PERL_VERSION PATCHLEVEL
756
# define PERL_SUBVERSION SUBVERSION
760
#if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE)
761
#define PerlIO_exportFILE(fh,fl) (FILE*)(fh)
765
# define SvIOK_UV(sv) (SvIOK(sv) && (SvUVX(sv) == SvIVX(sv)))
769
# define SvUOK(sv) SvIOK_UV(sv)
772
#if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5)))
773
# define PL_sv_undef sv_undef
775
# define PL_errgv errgv
776
# define PL_sv_no sv_no
777
# define PL_sv_yes sv_yes
778
# define PL_markstack_ptr markstack_ptr
783
# define IVSIZE LONGSIZE
785
# define IVSIZE 4 /* A bold guess, but the best we can make. */
790
# if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
792
# define INT2PTR(any,d) (any)(d)
794
# if PTRSIZE == LONGSIZE
795
# define PTRV unsigned long
797
# define PTRV unsigned
799
# define INT2PTR(any,d) (any)(PTRV)(d)
802
# define NUM2PTR(any,d) (any)(PTRV)(d)
803
# define PTR2IV(p) INT2PTR(IV,p)
804
# define PTR2UV(p) INT2PTR(UV,p)
805
# define PTR2NV(p) NUM2PTR(NV,p)
807
# if PTRSIZE == LONGSIZE
808
# define PTR2ul(p) (unsigned long)(p)
810
# define PTR2ul(p) INT2PTR(unsigned long,p)
812
#endif /* !INT2PTR */
815
# define SvPV_nolen(x) SvPV(x,PL_na)
819
# define get_sv perl_get_sv
823
# define ERRSV get_sv("@",FALSE)
835
/* -----------------------------------------------------------------------------
837
* ----------------------------------------------------------------------------- */
839
SWIGINTERN const char*
840
SWIG_Perl_ErrorType(int code) {
842
case SWIG_MemoryError:
843
return "MemoryError";
846
case SWIG_RuntimeError:
847
return "RuntimeError";
848
case SWIG_IndexError:
852
case SWIG_DivisionByZero:
853
return "ZeroDivisionError";
854
case SWIG_OverflowError:
855
return "OverflowError";
856
case SWIG_SyntaxError:
857
return "SyntaxError";
858
case SWIG_ValueError:
860
case SWIG_SystemError:
861
return "SystemError";
862
case SWIG_AttributeError:
863
return "AttributeError";
865
return "RuntimeError";
870
/* -----------------------------------------------------------------------------
873
* This file contains the runtime support for Perl modules
874
* and includes code for managing global variables and pointer
876
* ----------------------------------------------------------------------------- */
879
#define SWIG_PERL_OBJECT_DECL CPerlObj *SWIGUNUSEDPARM(pPerl),
880
#define SWIG_PERL_OBJECT_CALL pPerl,
882
#define SWIG_PERL_OBJECT_DECL
883
#define SWIG_PERL_OBJECT_CALL
886
/* Common SWIG API */
888
/* for raw pointers */
889
#define SWIG_ConvertPtr(obj, pp, type, flags) SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags)
890
#define SWIG_ConvertPtrAndOwn(obj, pp, type, flags,own) SWIG_Perl_ConvertPtrAndOwn(SWIG_PERL_OBJECT_CALL obj, pp, type, flags, own)
891
#define SWIG_NewPointerObj(p, type, flags) SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags)
892
#define swig_owntype int
894
/* for raw packed data */
895
#define SWIG_ConvertPacked(obj, p, s, type) SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type)
896
#define SWIG_NewPackedObj(p, s, type) SWIG_Perl_NewPackedObj(SWIG_PERL_OBJECT_CALL p, s, type)
898
/* for class or struct pointers */
899
#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
900
#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
902
/* for C or C++ function pointers */
903
#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0)
904
#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0)
906
/* for C++ member pointers, ie, member methods */
907
#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_ConvertPacked(obj, ptr, sz, ty)
908
#define SWIG_NewMemberObj(ptr, sz, type) SWIG_NewPackedObj(ptr, sz, type)
913
#define SWIG_GetModule(clientdata) SWIG_Perl_GetModule(clientdata)
914
#define SWIG_SetModule(clientdata, pointer) SWIG_Perl_SetModule(pointer)
917
/* Error manipulation */
919
#define SWIG_ErrorType(code) SWIG_Perl_ErrorType(code)
920
#define SWIG_Error(code, msg) sv_setpvf(get_sv("@", GV_ADD), "%s %s", SWIG_ErrorType(code), msg)
921
#define SWIG_fail goto fail
923
/* Perl-specific SWIG API */
925
#define SWIG_MakePtr(sv, ptr, type, flags) SWIG_Perl_MakePtr(SWIG_PERL_OBJECT_CALL sv, ptr, type, flags)
926
#define SWIG_MakePackedObj(sv, p, s, type) SWIG_Perl_MakePackedObj(SWIG_PERL_OBJECT_CALL sv, p, s, type)
927
#define SWIG_SetError(str) SWIG_Error(SWIG_RuntimeError, str)
930
#define SWIG_PERL_DECL_ARGS_1(arg1) (SWIG_PERL_OBJECT_DECL arg1)
931
#define SWIG_PERL_CALL_ARGS_1(arg1) (SWIG_PERL_OBJECT_CALL arg1)
932
#define SWIG_PERL_DECL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_DECL arg1, arg2)
933
#define SWIG_PERL_CALL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_CALL arg1, arg2)
935
/* -----------------------------------------------------------------------------
936
* pointers/data manipulation
937
* ----------------------------------------------------------------------------- */
939
/* For backward compatibility only */
940
#define SWIG_POINTER_EXCEPTION 0
946
#define SWIG_OWNER SWIG_POINTER_OWN
947
#define SWIG_SHADOW SWIG_OWNER << 1
949
#define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL
951
/* SWIG Perl macros */
953
/* Macro to declare an XS function */
955
# define XSPROTO(name) void name(pTHX_ CV* cv)
958
/* Macro to call an XS function */
960
# define SWIG_CALLXS(_name) _name(cv,pPerl)
962
# ifndef MULTIPLICITY
963
# define SWIG_CALLXS(_name) _name(cv)
965
# define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv)
970
#define MAGIC_PPERL CPerlObj *pPerl = (CPerlObj *) this;
975
typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *);
980
#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
981
#define SWIGCLASS_STATIC
983
#else /* PERL_OBJECT */
986
#define SWIGCLASS_STATIC static SWIGUNUSED
989
#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
994
typedef int (*SwigMagicFunc)(SV *, MAGIC *);
999
#else /* MULTIPLICITY */
1001
#define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b)
1006
typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *);
1011
#endif /* MULTIPLICITY */
1012
#endif /* PERL_OBJECT */
1015
# define SWIG_croak_null() SWIG_Perl_croak_null(pPerl)
1016
static void SWIGUNUSED SWIG_Perl_croak_null(CPerlObj *pPerl)
1018
static void SWIGUNUSED SWIG_croak_null()
1021
SV *err = get_sv("@", GV_ADD);
1022
# if (PERL_VERSION < 6)
1025
if (sv_isobject(err))
1028
croak("%s", SvPV_nolen(err));
1034
Define how strict is the cast between strings and integers/doubles
1035
when overloading between these types occurs.
1037
The default is making it as strict as possible by using SWIG_AddCast
1040
You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to
1041
disable the SWIG_AddCast, making the casting between string and
1042
numbers less strict.
1044
In the end, we try to solve the overloading between strings and
1045
numerical types in the more natural way, but if you can avoid it,
1046
well, avoid it using %rename, for example.
1048
#ifndef SWIG_PERL_NO_STRICT_STR2NUM
1049
# ifndef SWIG_PERL_STRICT_STR2NUM
1050
# define SWIG_PERL_STRICT_STR2NUM
1053
#ifdef SWIG_PERL_STRICT_STR2NUM
1054
/* string takes precedence */
1055
#define SWIG_Str2NumCast(x) SWIG_AddCast(x)
1057
/* number takes precedence */
1058
#define SWIG_Str2NumCast(x) x
1065
SWIGRUNTIME const char *
1066
SWIG_Perl_TypeProxyName(const swig_type_info *type) {
1067
if (!type) return NULL;
1068
if (type->clientdata != NULL) {
1069
return (const char*) type->clientdata;
1076
/* Identical to SWIG_TypeCheck, except for strcmp comparison */
1077
SWIGRUNTIME swig_cast_info *
1078
SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) {
1080
swig_cast_info *iter = ty->cast;
1082
if (strcmp(SWIG_Perl_TypeProxyName(iter->type), c) == 0) {
1083
if (iter == ty->cast)
1085
/* Move iter to the top of the linked list */
1086
iter->prev->next = iter->next;
1088
iter->next->prev = iter->prev;
1089
iter->next = ty->cast;
1091
if (ty->cast) ty->cast->prev = iter;
1101
/* Function for getting a pointer value */
1104
SWIG_Perl_ConvertPtrAndOwn(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags, int *own) {
1106
void *voidptr = (void *)0;
1112
/* If magical, apply more magic */
1116
/* Check to see if this is an object */
1117
if (sv_isobject(sv)) {
1119
tsv = (SV*) SvRV(sv);
1120
if ((SvTYPE(tsv) == SVt_PVHV)) {
1122
if (SvMAGICAL(tsv)) {
1123
mg = mg_find(tsv,'P');
1126
if (sv_isobject(sv)) {
1127
tsv = (SV*)SvRV(sv);
1137
voidptr = INT2PTR(void *,tmp);
1138
} else if (! SvOK(sv)) { /* Check for undef */
1139
*(ptr) = (void *) 0;
1141
} else if (SvTYPE(sv) == SVt_RV) { /* Check for NULL pointer */
1143
/* In Perl 5.12 and later, SVt_RV == SVt_IV, so sv could be a valid integer value. */
1147
/* NULL pointer (reference to undef). */
1148
*(ptr) = (void *) 0;
1154
} else { /* Don't know what it is */
1158
/* Now see if the types match */
1159
char *_c = HvNAME(SvSTASH(SvRV(sv)));
1160
tc = SWIG_TypeProxyCheck(_c,_t);
1161
#ifdef SWIG_DIRECTORS
1162
if (!tc && !sv_derived_from(sv,SWIG_Perl_TypeProxyName(_t))) {
1170
*ptr = SWIG_TypeCast(tc,voidptr,&newmemory);
1171
if (newmemory == SWIG_CAST_NEW_MEMORY) {
1172
assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
1174
*own = *own | SWIG_CAST_NEW_MEMORY;
1182
* DISOWN implementation: we need a perl guru to check this one.
1184
if (tsv && (flags & SWIG_POINTER_DISOWN)) {
1186
* almost copy paste code from below SWIG_POINTER_OWN setting
1189
HV *stash = SvSTASH(SvRV(obj));
1190
GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
1194
* To set ownership (see below), a newSViv(1) entry is added.
1195
* Hence, to remove ownership, we delete the entry.
1197
if (hv_exists_ent(hv, obj, 0)) {
1198
hv_delete_ent(hv, obj, 0, 0);
1206
SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) {
1207
return SWIG_Perl_ConvertPtrAndOwn(sv, ptr, _t, flags, 0);
1211
SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) {
1212
if (ptr && (flags & (SWIG_SHADOW | SWIG_POINTER_OWN))) {
1217
sv_setref_pv(obj, SWIG_Perl_TypeProxyName(t), ptr);
1218
stash=SvSTASH(SvRV(obj));
1219
if (flags & SWIG_POINTER_OWN) {
1221
GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
1223
gv_init(gv, stash, "OWNER", 5, FALSE);
1225
hv_store_ent(hv, obj, newSViv(1), 0);
1227
sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0);
1229
self=newRV_noinc((SV *)hash);
1231
SvREFCNT_dec((SV *)self);
1232
sv_bless(sv, stash);
1235
sv_setref_pv(sv, SWIG_Perl_TypeProxyName(t), ptr);
1239
SWIGRUNTIMEINLINE SV *
1240
SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) {
1241
SV *result = sv_newmortal();
1242
SWIG_MakePtr(result, ptr, t, flags);
1247
SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) {
1250
if ((2*sz + 1 + strlen(SWIG_Perl_TypeProxyName(type))) > 1000) return;
1252
r = SWIG_PackData(r,ptr,sz);
1253
strcpy(r,SWIG_Perl_TypeProxyName(type));
1254
sv_setpv(sv, result);
1258
SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info *type) {
1259
SV *result = sv_newmortal();
1260
SWIG_Perl_MakePackedObj(result, ptr, sz, type);
1264
/* Convert a packed value value */
1266
SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) {
1270
if ((!obj) || (!SvOK(obj))) return SWIG_ERROR;
1271
c = SvPV_nolen(obj);
1272
/* Pointer values must start with leading underscore */
1273
if (*c != '_') return SWIG_ERROR;
1275
c = SWIG_UnpackData(c,ptr,sz);
1277
tc = SWIG_TypeCheck(c,ty);
1278
if (!tc) return SWIG_ERROR;
1284
/* Macros for low-level exception handling */
1285
#define SWIG_croak(x) { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; }
1288
typedef XSPROTO(SwigPerlWrapper);
1289
typedef SwigPerlWrapper *SwigPerlWrapperPtr;
1291
/* Structure for command table */
1294
SwigPerlWrapperPtr wrapper;
1295
} swig_command_info;
1297
/* Information for constant table */
1300
#define SWIG_FLOAT 2
1301
#define SWIG_STRING 3
1302
#define SWIG_POINTER 4
1303
#define SWIG_BINARY 5
1305
/* Constant information structure */
1306
typedef struct swig_constant_info {
1312
swig_type_info **ptype;
1313
} swig_constant_info;
1316
/* Structure for variable table */
1321
swig_type_info **type;
1322
} swig_variable_info;
1324
/* Magic variable code */
1327
# define swig_create_magic(s,a,b,c) _swig_create_magic(s,const_cast<char*>(a),b,c)
1329
# define swig_create_magic(s,a,b,c) _swig_create_magic(s,(char*)(a),b,c)
1331
# ifndef MULTIPLICITY
1332
SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *))
1334
SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *))
1337
# define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c)
1338
SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *))
1342
sv_magic(sv,sv,'U',name,strlen(name));
1343
mg = mg_find(sv,'U');
1344
mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
1345
mg->mg_virtual->svt_get = (SwigMagicFunc) get;
1346
mg->mg_virtual->svt_set = (SwigMagicFunc) set;
1347
mg->mg_virtual->svt_len = 0;
1348
mg->mg_virtual->svt_clear = 0;
1349
mg->mg_virtual->svt_free = 0;
1353
SWIGRUNTIME swig_module_info *
1354
SWIG_Perl_GetModule(void *SWIGUNUSEDPARM(clientdata)) {
1355
static void *type_pointer = (void *)0;
1358
/* first check if pointer already created */
1359
if (!type_pointer) {
1360
pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE | GV_ADDMULTI);
1361
if (pointer && SvOK(pointer)) {
1362
type_pointer = INT2PTR(swig_type_info **, SvIV(pointer));
1366
return (swig_module_info *) type_pointer;
1370
SWIG_Perl_SetModule(swig_module_info *module) {
1373
/* create a new pointer */
1374
pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE | GV_ADDMULTI);
1375
sv_setiv(pointer, PTR2IV(module));
1382
/* Workaround perl5 global namespace pollution. Note that undefining library
1383
* functions like fopen will not solve the problem on all platforms as fopen
1384
* might be a macro on Windows but not necessarily on other operating systems. */
1492
/* Leave if macro is from C99 stdbool.h */
1493
#ifndef __bool_true_false_are_defined
1501
#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
1503
#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
1507
/* -------- TYPES TABLE (BEGIN) -------- */
1509
#define SWIGTYPE_p_char swig_types[0]
1510
static swig_type_info *swig_types[2];
1511
static swig_module_info swig_module = {swig_types, 1, 0, 0, 0, 0};
1512
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1513
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1515
/* -------- TYPES TABLE (END) -------- */
1517
#define SWIG_init boot_MathML__itex2MML
1519
#define SWIG_name "MathML::itex2MMLc::boot_MathML__itex2MML"
1520
#define SWIG_prefix "MathML::itex2MMLc::"
1522
#define SWIGVERSION 0x030012
1523
#define SWIG_VERSION SWIGVERSION
1526
#define SWIG_as_voidptr(a) (void *)((const void *)(a))
1527
#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a))
1534
#ifndef MULTIPLICITY
1535
SWIGEXPORT void SWIG_init (CV* cv);
1537
SWIGEXPORT void SWIG_init (pTHXo_ CV* cv);
1540
SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *);
1544
#include "itex2MML.h"
1545
extern const char * itex2MML_output ();
1548
SWIGINTERN swig_type_info*
1549
SWIG_pchar_descriptor(void)
1551
static int init = 0;
1552
static swig_type_info* info = 0;
1554
info = SWIG_TypeQuery("_p_char");
1562
SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
1564
if (SvMAGICAL(obj)) {
1565
SV *tmp = sv_newmortal();
1571
char *cstr = SvPV(obj, len);
1572
size_t size = len + 1;
1575
if (*alloc == SWIG_NEWOBJ) {
1576
*cptr = (char *)memcpy(malloc((size)*sizeof(char)), cstr, sizeof(char)*(size));
1579
*alloc = SWIG_OLDOBJ;
1583
if (psize) *psize = size;
1586
swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
1587
if (pchar_descriptor) {
1589
if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) {
1590
if (cptr) *cptr = vptr;
1591
if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
1592
if (alloc) *alloc = SWIG_OLDOBJ;
1597
return SWIG_TypeError;
1605
#if !defined(SWIG_NO_LLONG_MAX)
1606
# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
1607
# define LLONG_MAX __LONG_LONG_MAX__
1608
# define LLONG_MIN (-LLONG_MAX - 1LL)
1609
# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
1617
# define strtoull _strtoui64
1620
# define strtoll _strtoi64
1626
SWIG_AsVal_double SWIG_PERL_DECL_ARGS_2(SV *obj, double *val)
1629
if (val) *val = SvNV(obj);
1631
} else if (SvIOK(obj)) {
1632
if (val) *val = (double) SvIV(obj);
1633
return SWIG_AddCast(SWIG_OK);
1635
const char *nptr = SvPV_nolen(obj);
1640
v = strtod(nptr, &endptr);
1641
if (errno == ERANGE) {
1643
return SWIG_OverflowError;
1645
if (*endptr == '\0') {
1647
return SWIG_Str2NumCast(SWIG_OK);
1652
return SWIG_TypeError;
1662
SWIGINTERNINLINE int
1663
SWIG_CanCastAsInteger(double *d, double min, double max) {
1665
if ((min <= x && x <= max)) {
1666
double fx = floor(x);
1667
double cx = ceil(x);
1668
double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */
1669
if ((errno == EDOM) || (errno == ERANGE)) {
1672
double summ, reps, diff;
1675
} else if (rd > x) {
1682
if (reps < 8*DBL_EPSILON) {
1693
SWIG_AsVal_unsigned_SS_long SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long *val)
1697
if (UVSIZE <= sizeof(*val) || v <= ULONG_MAX) {
1701
return SWIG_OverflowError;
1702
} else if (SvIOK(obj)) {
1704
if (v >= 0 && (IVSIZE <= sizeof(*val) || v <= ULONG_MAX)) {
1708
return SWIG_OverflowError;
1711
const char *nptr = SvPV_nolen(obj);
1716
v = strtoul(nptr, &endptr,0);
1717
if (errno == ERANGE) {
1719
return SWIG_OverflowError;
1721
if (*endptr == '\0') {
1723
return SWIG_Str2NumCast(SWIG_OK);
1729
int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
1730
if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
1731
if (val) *val = (unsigned long)(d);
1736
return SWIG_TypeError;
1740
#if defined(LLONG_MAX) && !defined(SWIG_LONG_LONG_AVAILABLE)
1741
# define SWIG_LONG_LONG_AVAILABLE
1745
#ifdef SWIG_LONG_LONG_AVAILABLE
1747
SWIG_AsVal_unsigned_SS_long_SS_long SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long long *val)
1750
/* pretty sure this should be conditional on
1751
* (UVSIZE <= sizeof(*val) || v <= ULLONG_MAX) */
1752
if (val) *val = SvUV(obj);
1754
} else if (SvIOK(obj)) {
1756
if (v >= 0 && (IVSIZE <= sizeof(*val) || v <= ULLONG_MAX)) {
1760
return SWIG_OverflowError;
1764
const char *nptr = SvPV_nolen(obj);
1767
unsigned long long v;
1769
v = strtoull(nptr, &endptr,0);
1770
if (errno == ERANGE) {
1772
return SWIG_OverflowError;
1774
if (*endptr == '\0') {
1776
return SWIG_Str2NumCast(SWIG_OK);
1781
const double mant_max = 1LL << DBL_MANT_DIG;
1783
int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
1784
if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, mant_max)) {
1785
if (val) *val = (unsigned long long)(d);
1790
return SWIG_TypeError;
1795
SWIGINTERNINLINE int
1796
SWIG_AsVal_size_t SWIG_PERL_DECL_ARGS_2(SV * obj, size_t *val)
1798
int res = SWIG_TypeError;
1799
#ifdef SWIG_LONG_LONG_AVAILABLE
1800
if (sizeof(size_t) <= sizeof(unsigned long)) {
1803
res = SWIG_AsVal_unsigned_SS_long SWIG_PERL_CALL_ARGS_2(obj, val ? &v : 0);
1804
if (SWIG_IsOK(res) && val) *val = (size_t)(v);
1805
#ifdef SWIG_LONG_LONG_AVAILABLE
1806
} else if (sizeof(size_t) <= sizeof(unsigned long long)) {
1807
unsigned long long v;
1808
res = SWIG_AsVal_unsigned_SS_long_SS_long SWIG_PERL_CALL_ARGS_2(obj, val ? &v : 0);
1809
if (SWIG_IsOK(res) && val) *val = (size_t)(v);
1816
SWIGINTERNINLINE SV *
1817
SWIG_From_long SWIG_PERL_DECL_ARGS_1(long value)
1820
if (IVSIZE >= sizeof(value) || (value >= IV_MIN && value <= IV_MAX))
1821
sv = newSViv(value);
1823
sv = newSVpvf("%ld", value);
1824
return sv_2mortal(sv);
1828
SWIGINTERNINLINE SV *
1829
SWIG_From_int SWIG_PERL_DECL_ARGS_1(int value)
1831
return SWIG_From_long SWIG_PERL_CALL_ARGS_1(value);
1835
SWIGINTERNINLINE SV *
1836
SWIG_FromCharPtrAndSize(const char* carray, size_t size)
1838
SV *obj = sv_newmortal();
1840
sv_setpvn(obj, carray, size);
1842
sv_setsv(obj, &PL_sv_undef);
1848
SWIGINTERNINLINE SV *
1849
SWIG_FromCharPtr(const char *cptr)
1851
return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
1859
#define MAGIC_CLASS _wrap_MathML__itex2MML_var::
1860
class _wrap_MathML__itex2MML_var : public CPerlObj {
1865
SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *SWIGUNUSEDPARM(sv), MAGIC *SWIGUNUSEDPARM(mg)) {
1867
croak("Value is read-only.");
1883
XS(_wrap_itex2MML_filter) {
1885
char *arg1 = (char *) 0 ;
1896
if ((items < 2) || (items > 2)) {
1897
SWIG_croak("Usage: itex2MML_filter(buffer,length);");
1899
res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
1900
if (!SWIG_IsOK(res1)) {
1901
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "itex2MML_filter" "', argument " "1"" of type '" "char const *""'");
1903
arg1 = (char *)(buf1);
1904
ecode2 = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
1905
if (!SWIG_IsOK(ecode2)) {
1906
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "itex2MML_filter" "', argument " "2"" of type '" "size_t""'");
1908
arg2 = (size_t)(val2);
1909
result = (int)itex2MML_filter((char const *)arg1,arg2);
1910
ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
1911
if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
1915
if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
1922
XS(_wrap_itex2MML_html_filter) {
1924
char *arg1 = (char *) 0 ;
1935
if ((items < 2) || (items > 2)) {
1936
SWIG_croak("Usage: itex2MML_html_filter(buffer,length);");
1938
res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
1939
if (!SWIG_IsOK(res1)) {
1940
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "itex2MML_html_filter" "', argument " "1"" of type '" "char const *""'");
1942
arg1 = (char *)(buf1);
1943
ecode2 = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
1944
if (!SWIG_IsOK(ecode2)) {
1945
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "itex2MML_html_filter" "', argument " "2"" of type '" "size_t""'");
1947
arg2 = (size_t)(val2);
1948
result = (int)itex2MML_html_filter((char const *)arg1,arg2);
1949
ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
1950
if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
1954
if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
1961
XS(_wrap_itex2MML_output) {
1967
if ((items < 0) || (items > 0)) {
1968
SWIG_croak("Usage: itex2MML_output();");
1970
result = (char *)itex2MML_output();
1971
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
1980
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
1982
static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
1984
static swig_type_info *swig_type_initial[] = {
1988
static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
1990
static swig_cast_info *swig_cast_initial[] = {
1995
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
1997
static swig_constant_info swig_constants[] = {
2003
static swig_variable_info swig_variables[] = {
2006
static swig_command_info swig_commands[] = {
2007
{"MathML::itex2MMLc::itex2MML_filter", _wrap_itex2MML_filter},
2008
{"MathML::itex2MMLc::itex2MML_html_filter", _wrap_itex2MML_html_filter},
2009
{"MathML::itex2MMLc::itex2MML_output", _wrap_itex2MML_output},
2012
/* -----------------------------------------------------------------------------
2013
* Type initialization:
2014
* This problem is tough by the requirement that no dynamic
2015
* memory is used. Also, since swig_type_info structures store pointers to
2016
* swig_cast_info structures and swig_cast_info structures store pointers back
2017
* to swig_type_info structures, we need some lookup code at initialization.
2018
* The idea is that swig generates all the structures that are needed.
2019
* The runtime then collects these partially filled structures.
2020
* The SWIG_InitializeModule function takes these initial arrays out of
2021
* swig_module, and does all the lookup, filling in the swig_module.types
2022
* array with the correct data and linking the correct swig_cast_info
2023
* structures together.
2025
* The generated swig_type_info structures are assigned statically to an initial
2026
* array. We just loop through that array, and handle each type individually.
2027
* First we lookup if this type has been already loaded, and if so, use the
2028
* loaded structure instead of the generated one. Then we have to fill in the
2029
* cast linked list. The cast data is initially stored in something like a
2030
* two-dimensional array. Each row corresponds to a type (there are the same
2031
* number of rows as there are in the swig_type_initial array). Each entry in
2032
* a column is one of the swig_cast_info structures for that type.
2033
* The cast_initial array is actually an array of arrays, because each row has
2034
* a variable number of columns. So to actually build the cast linked list,
2035
* we find the array of casts associated with the type, and loop through it
2036
* adding the casts to the list. The one last trick we need to do is making
2037
* sure the type pointer in the swig_cast_info struct is correct.
2039
* First off, we lookup the cast->type name to see if it is already loaded.
2040
* There are three cases to handle:
2041
* 1) If the cast->type has already been loaded AND the type we are adding
2042
* casting info to has not been loaded (it is in this module), THEN we
2043
* replace the cast->type pointer with the type pointer that has already
2045
* 2) If BOTH types (the one we are adding casting info to, and the
2046
* cast->type) are loaded, THEN the cast info has already been loaded by
2047
* the previous module so we just ignore it.
2048
* 3) Finally, if cast->type has not already been loaded, then we add that
2049
* swig_cast_info to the linked list (because the cast->type) pointer will
2051
* ----------------------------------------------------------------------------- */
2061
#define SWIGRUNTIME_DEBUG
2066
SWIG_InitializeModule(void *clientdata) {
2068
swig_module_info *module_head, *iter;
2071
/* check to see if the circular list has been setup, if not, set it up */
2072
if (swig_module.next==0) {
2073
/* Initialize the swig_module */
2074
swig_module.type_initial = swig_type_initial;
2075
swig_module.cast_initial = swig_cast_initial;
2076
swig_module.next = &swig_module;
2082
/* Try and load any already created modules */
2083
module_head = SWIG_GetModule(clientdata);
2085
/* This is the first module loaded for this interpreter */
2086
/* so set the swig module into the interpreter */
2087
SWIG_SetModule(clientdata, &swig_module);
2089
/* the interpreter has loaded a SWIG module, but has it loaded this one? */
2092
if (iter==&swig_module) {
2093
/* Our module is already in the list, so there's nothing more to do. */
2097
} while (iter!= module_head);
2099
/* otherwise we must add our module into the list */
2100
swig_module.next = module_head->next;
2101
module_head->next = &swig_module;
2104
/* When multiple interpreters are used, a module could have already been initialized in
2105
a different interpreter, but not yet have a pointer in this interpreter.
2106
In this case, we do not want to continue adding types... everything should be
2108
if (init == 0) return;
2110
/* Now work on filling in swig_module.types */
2111
#ifdef SWIGRUNTIME_DEBUG
2112
printf("SWIG_InitializeModule: size %d\n", swig_module.size);
2114
for (i = 0; i < swig_module.size; ++i) {
2115
swig_type_info *type = 0;
2116
swig_type_info *ret;
2117
swig_cast_info *cast;
2119
#ifdef SWIGRUNTIME_DEBUG
2120
printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
2123
/* if there is another module already loaded */
2124
if (swig_module.next != &swig_module) {
2125
type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
2128
/* Overwrite clientdata field */
2129
#ifdef SWIGRUNTIME_DEBUG
2130
printf("SWIG_InitializeModule: found type %s\n", type->name);
2132
if (swig_module.type_initial[i]->clientdata) {
2133
type->clientdata = swig_module.type_initial[i]->clientdata;
2134
#ifdef SWIGRUNTIME_DEBUG
2135
printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
2139
type = swig_module.type_initial[i];
2142
/* Insert casting types */
2143
cast = swig_module.cast_initial[i];
2144
while (cast->type) {
2145
/* Don't need to add information already in the list */
2147
#ifdef SWIGRUNTIME_DEBUG
2148
printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
2150
if (swig_module.next != &swig_module) {
2151
ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
2152
#ifdef SWIGRUNTIME_DEBUG
2153
if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
2157
if (type == swig_module.type_initial[i]) {
2158
#ifdef SWIGRUNTIME_DEBUG
2159
printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
2164
/* Check for casting already in the list */
2165
swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
2166
#ifdef SWIGRUNTIME_DEBUG
2167
if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
2169
if (!ocast) ret = 0;
2174
#ifdef SWIGRUNTIME_DEBUG
2175
printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
2178
type->cast->prev = cast;
2179
cast->next = type->cast;
2185
/* Set entry in modules->types array equal to the type */
2186
swig_module.types[i] = type;
2188
swig_module.types[i] = 0;
2190
#ifdef SWIGRUNTIME_DEBUG
2191
printf("**** SWIG_InitializeModule: Cast List ******\n");
2192
for (i = 0; i < swig_module.size; ++i) {
2194
swig_cast_info *cast = swig_module.cast_initial[i];
2195
printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
2196
while (cast->type) {
2197
printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
2201
printf("---- Total casts: %d\n",j);
2203
printf("**** SWIG_InitializeModule: Cast List ******\n");
2207
/* This function will propagate the clientdata field of type to
2208
* any new swig_type_info structures that have been added into the list
2209
* of equivalent types. It is like calling
2210
* SWIG_TypeClientData(type, clientdata) a second time.
2213
SWIG_PropagateClientData(void) {
2215
swig_cast_info *equiv;
2216
static int init_run = 0;
2218
if (init_run) return;
2221
for (i = 0; i < swig_module.size; i++) {
2222
if (swig_module.types[i]->clientdata) {
2223
equiv = swig_module.types[i]->cast;
2225
if (!equiv->converter) {
2226
if (equiv->type && !equiv->type->clientdata)
2227
SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
2229
equiv = equiv->next;
2245
#if defined(__cplusplus) && ! defined(XSPROTO)
2254
SWIG_InitializeModule(0);
2256
/* Install commands */
2257
for (i = 0; swig_commands[i].name; i++) {
2258
/* Casts only needed for Perl < 5.10. */
2260
newXS(const_cast<char*>(swig_commands[i].name), swig_commands[i].wrapper, const_cast<char*>(__FILE__));
2262
newXS((char*)swig_commands[i].name, swig_commands[i].wrapper, (char*)__FILE__);
2266
/* Install variables */
2267
for (i = 0; swig_variables[i].name; i++) {
2269
sv = get_sv(swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI);
2270
if (swig_variables[i].type) {
2271
SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0);
2273
sv_setiv(sv,(IV) 0);
2275
swig_create_magic(sv, swig_variables[i].name, swig_variables[i].set, swig_variables[i].get);
2278
/* Install constant */
2279
for (i = 0; swig_constants[i].type; i++) {
2281
sv = get_sv(swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI);
2282
switch(swig_constants[i].type) {
2284
sv_setiv(sv, (IV) swig_constants[i].lvalue);
2287
sv_setnv(sv, (double) swig_constants[i].dvalue);
2290
sv_setpv(sv, (const char *) swig_constants[i].pvalue);
2293
SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0);
2296
SWIG_MakePackedObj(sv, swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype));