1 /* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (http://www.swig.org).
5 * This file is not intended to be easily readable and contains a number of
6 * coding conventions designed to improve portability and efficiency. Do not make
7 * changes to this file unless you know what you are doing--modify the SWIG
8 * interface file instead.
9 * ----------------------------------------------------------------------------- */
12 #define SWIG_CASTRANK_MODE
13 /* -----------------------------------------------------------------------------
14 * This section contains generic SWIG labels for method/variable
15 * declarations/attributes, and other compiler dependent labels.
16 * ----------------------------------------------------------------------------- */
18 /* template workaround for compilers that cannot correctly implement the C++ standard */
19 #ifndef SWIGTEMPLATEDISAMBIGUATOR
20 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
21 # define SWIGTEMPLATEDISAMBIGUATOR template
22 # elif defined(__HP_aCC)
23 /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
24 /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
25 # define SWIGTEMPLATEDISAMBIGUATOR template
27 # define SWIGTEMPLATEDISAMBIGUATOR
31 /* inline attribute */
33 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
34 # define SWIGINLINE inline
40 /* attribute recognised by some compilers to avoid 'unused' warnings */
42 # if defined(__GNUC__)
43 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
44 # define SWIGUNUSED __attribute__ ((__unused__))
49 # define SWIGUNUSED __attribute__ ((__unused__))
55 #ifndef SWIGUNUSEDPARM
57 # define SWIGUNUSEDPARM(p)
59 # define SWIGUNUSEDPARM(p) p SWIGUNUSED
63 /* internal SWIG method */
65 # define SWIGINTERN static SWIGUNUSED
68 /* internal inline SWIG method */
69 #ifndef SWIGINTERNINLINE
70 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
73 /* exporting methods */
74 #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
75 # ifndef GCC_HASCLASSVISIBILITY
76 # define GCC_HASCLASSVISIBILITY
81 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
82 # if defined(STATIC_LINKED)
85 # define SWIGEXPORT __declspec(dllexport)
88 # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
89 # define SWIGEXPORT __attribute__ ((visibility("default")))
96 /* calling conventions for Windows */
98 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
99 # define SWIGSTDCALL __stdcall
105 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
106 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
107 # define _CRT_SECURE_NO_DEPRECATE
110 /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
111 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
112 # define _SCL_SECURE_NO_DEPRECATE
116 /* -----------------------------------------------------------------------------
119 * This file contains generic CAPI SWIG runtime support for pointer
121 * ----------------------------------------------------------------------------- */
123 /* This should only be incremented when either the layout of swig_type_info changes,
124 or for whatever reason, the runtime changes incompatibly */
125 #define SWIG_RUNTIME_VERSION "4"
127 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
128 #ifdef SWIG_TYPE_TABLE
129 # define SWIG_QUOTE_STRING(x) #x
130 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
131 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
133 # define SWIG_TYPE_TABLE_NAME
137 You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
138 creating a static or dynamic library from the swig runtime code.
139 In 99.9% of the cases, swig just needs to declare them as 'static'.
141 But only do this if is strictly necessary, ie, if you have problems
142 with your compiler or so.
146 # define SWIGRUNTIME SWIGINTERN
149 #ifndef SWIGRUNTIMEINLINE
150 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
153 /* Generic buffer size */
154 #ifndef SWIG_BUFFER_SIZE
155 # define SWIG_BUFFER_SIZE 1024
158 /* Flags for pointer conversions */
159 #define SWIG_POINTER_DISOWN 0x1
160 #define SWIG_CAST_NEW_MEMORY 0x2
162 /* Flags for new pointer objects */
163 #define SWIG_POINTER_OWN 0x1
167 Flags/methods for returning states.
169 The swig conversion methods, as ConvertPtr, return and integer
170 that tells if the conversion was successful or not. And if not,
171 an error code can be returned (see swigerrors.swg for the codes).
173 Use the following macros/flags to set or process the returning
176 In old swig versions, you usually write code as:
178 if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
184 Now you can be more explicit as:
186 int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
187 if (SWIG_IsOK(res)) {
193 that seems to be the same, but now you can also do
196 int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
197 if (SWIG_IsOK(res)) {
199 if (SWIG_IsNewObj(res) {
209 I.e., now SWIG_ConvertPtr can return new objects and you can
210 identify the case and take care of the deallocation. Of course that
211 requires also to SWIG_ConvertPtr to return new result values, as
213 int SWIG_ConvertPtr(obj, ptr,...) {
215 if (<need new object>) {
216 *ptr = <ptr to new allocated object>;
219 *ptr = <ptr to old object>;
227 Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
228 more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
231 Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
232 allows to return the 'cast rank', for example, if you have this
239 food(1) // cast rank '1' (1 -> 1.0)
240 fooi(1) // cast rank '0'
242 just use the SWIG_AddCast()/SWIG_CheckState()
247 #define SWIG_ERROR (-1)
248 #define SWIG_IsOK(r) (r >= 0)
249 #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
251 /* The CastRankLimit says how many bits are used for the cast rank */
252 #define SWIG_CASTRANKLIMIT (1 << 8)
253 /* The NewMask denotes the object was created (using new/malloc) */
254 #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
255 /* The TmpMask is for in/out typemaps that use temporal objects */
256 #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
257 /* Simple returning values */
258 #define SWIG_BADOBJ (SWIG_ERROR)
259 #define SWIG_OLDOBJ (SWIG_OK)
260 #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
261 #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
262 /* Check, add and del mask methods */
263 #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
264 #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
265 #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
266 #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
267 #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
268 #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
272 #if defined(SWIG_CASTRANK_MODE)
273 # ifndef SWIG_TypeRank
274 # define SWIG_TypeRank unsigned long
276 # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
277 # define SWIG_MAXCASTRANK (2)
279 # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
280 # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
281 SWIGINTERNINLINE int SWIG_AddCast(int r) {
282 return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
284 SWIGINTERNINLINE int SWIG_CheckState(int r) {
285 return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
287 #else /* no cast-rank mode */
288 # define SWIG_AddCast
289 # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
301 typedef void *(*swig_converter_func)(void *, int *);
302 typedef struct swig_type_info *(*swig_dycast_func)(void **);
304 /* Structure to store information on one type */
305 typedef struct swig_type_info {
306 const char *name; /* mangled name of this type */
307 const char *str; /* human readable name of this type */
308 swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
309 struct swig_cast_info *cast; /* linked list of types that can cast into this type */
310 void *clientdata; /* language specific type data */
311 int owndata; /* flag if the structure owns the clientdata */
314 /* Structure to store a type and conversion function used for casting */
315 typedef struct swig_cast_info {
316 swig_type_info *type; /* pointer to type that is equivalent to this type */
317 swig_converter_func converter; /* function to cast the void pointers */
318 struct swig_cast_info *next; /* pointer to next cast in linked list */
319 struct swig_cast_info *prev; /* pointer to the previous cast */
322 /* Structure used to store module information
323 * Each module generates one structure like this, and the runtime collects
324 * all of these structures and stores them in a circularly linked list.*/
325 typedef struct swig_module_info {
326 swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
327 size_t size; /* Number of types in this module */
328 struct swig_module_info *next; /* Pointer to next element in circularly linked list */
329 swig_type_info **type_initial; /* Array of initially generated type structures */
330 swig_cast_info **cast_initial; /* Array of initially generated casting structures */
331 void *clientdata; /* Language specific module data */
335 Compare two type names skipping the space characters, therefore
336 "char*" == "char *" and "Class<int>" == "Class<int >", etc.
338 Return 0 when the two name types are equivalent, as in
339 strncmp, but skipping ' '.
342 SWIG_TypeNameComp(const char *f1, const char *l1,
343 const char *f2, const char *l2) {
344 for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
345 while ((*f1 == ' ') && (f1 != l1)) ++f1;
346 while ((*f2 == ' ') && (f2 != l2)) ++f2;
347 if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
349 return (int)((l1 - f1) - (l2 - f2));
353 Check type equivalence in a name list like <name1>|<name2>|...
354 Return 0 if not equal, 1 if equal
357 SWIG_TypeEquiv(const char *nb, const char *tb) {
359 const char* te = tb + strlen(tb);
361 while (!equiv && *ne) {
362 for (nb = ne; *ne; ++ne) {
363 if (*ne == '|') break;
365 equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
372 Check type equivalence in a name list like <name1>|<name2>|...
373 Return 0 if equal, -1 if nb < tb, 1 if nb > tb
376 SWIG_TypeCompare(const char *nb, const char *tb) {
378 const char* te = tb + strlen(tb);
380 while (!equiv && *ne) {
381 for (nb = ne; *ne; ++ne) {
382 if (*ne == '|') break;
384 equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
391 /* think of this as a c++ template<> or a scheme macro */
392 #define SWIG_TypeCheck_Template(comparison, ty) \
394 swig_cast_info *iter = ty->cast; \
397 if (iter == ty->cast) return iter; \
398 /* Move iter to the top of the linked list */ \
399 iter->prev->next = iter->next; \
401 iter->next->prev = iter->prev; \
402 iter->next = ty->cast; \
404 if (ty->cast) ty->cast->prev = iter; \
416 SWIGRUNTIME swig_cast_info *
417 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
418 SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
421 /* Same as previous function, except strcmp is replaced with a pointer comparison */
422 SWIGRUNTIME swig_cast_info *
423 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
424 SWIG_TypeCheck_Template(iter->type == from, into);
428 Cast a pointer up an inheritance hierarchy
430 SWIGRUNTIMEINLINE void *
431 SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
432 return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
436 Dynamic pointer casting. Down an inheritance hierarchy
438 SWIGRUNTIME swig_type_info *
439 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
440 swig_type_info *lastty = ty;
441 if (!ty || !ty->dcast) return ty;
442 while (ty && (ty->dcast)) {
443 ty = (*ty->dcast)(ptr);
450 Return the name associated with this type
452 SWIGRUNTIMEINLINE const char *
453 SWIG_TypeName(const swig_type_info *ty) {
458 Return the pretty name associated with this type,
459 that is an unmangled type name in a form presentable to the user.
461 SWIGRUNTIME const char *
462 SWIG_TypePrettyName(const swig_type_info *type) {
463 /* The "str" field contains the equivalent pretty names of the
464 type, separated by vertical-bar characters. We choose
465 to print the last name, as it is often (?) the most
467 if (!type) return NULL;
468 if (type->str != NULL) {
469 const char *last_name = type->str;
471 for (s = type->str; *s; s++)
472 if (*s == '|') last_name = s+1;
480 Set the clientdata field for a type
483 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
484 swig_cast_info *cast = ti->cast;
485 /* if (ti->clientdata == clientdata) return; */
486 ti->clientdata = clientdata;
489 if (!cast->converter) {
490 swig_type_info *tc = cast->type;
491 if (!tc->clientdata) {
492 SWIG_TypeClientData(tc, clientdata);
499 SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
500 SWIG_TypeClientData(ti, clientdata);
505 Search for a swig_type_info structure only by mangled name
506 Search is a O(log #types)
508 We start searching at module start, and finish searching when start == end.
509 Note: if start == end at the beginning of the function, we go all the way around
512 SWIGRUNTIME swig_type_info *
513 SWIG_MangledTypeQueryModule(swig_module_info *start,
514 swig_module_info *end,
516 swig_module_info *iter = start;
519 register size_t l = 0;
520 register size_t r = iter->size - 1;
522 /* since l+r >= 0, we can (>> 1) instead (/ 2) */
523 register size_t i = (l + r) >> 1;
524 const char *iname = iter->types[i]->name;
526 register int compare = strcmp(name, iname);
528 return iter->types[i];
529 } else if (compare < 0) {
535 } else if (compare > 0) {
539 break; /* should never happen */
544 } while (iter != end);
549 Search for a swig_type_info structure for either a mangled name or a human readable name.
550 It first searches the mangled names of the types, which is a O(log #types)
551 If a type is not found it then searches the human readable names, which is O(#types).
553 We start searching at module start, and finish searching when start == end.
554 Note: if start == end at the beginning of the function, we go all the way around
557 SWIGRUNTIME swig_type_info *
558 SWIG_TypeQueryModule(swig_module_info *start,
559 swig_module_info *end,
561 /* STEP 1: Search the name field using binary search */
562 swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
566 /* STEP 2: If the type hasn't been found, do a complete search
567 of the str field (the human readable name) */
568 swig_module_info *iter = start;
570 register size_t i = 0;
571 for (; i < iter->size; ++i) {
572 if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
573 return iter->types[i];
576 } while (iter != end);
579 /* neither found a match */
584 Pack binary data into a string
587 SWIG_PackData(char *c, void *ptr, size_t sz) {
588 static const char hex[17] = "0123456789abcdef";
589 register const unsigned char *u = (unsigned char *) ptr;
590 register const unsigned char *eu = u + sz;
591 for (; u != eu; ++u) {
592 register unsigned char uu = *u;
593 *(c++) = hex[(uu & 0xf0) >> 4];
594 *(c++) = hex[uu & 0xf];
600 Unpack binary data from a string
602 SWIGRUNTIME const char *
603 SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
604 register unsigned char *u = (unsigned char *) ptr;
605 register const unsigned char *eu = u + sz;
606 for (; u != eu; ++u) {
607 register char d = *(c++);
608 register unsigned char uu;
609 if ((d >= '0') && (d <= '9'))
610 uu = ((d - '0') << 4);
611 else if ((d >= 'a') && (d <= 'f'))
612 uu = ((d - ('a'-10)) << 4);
616 if ((d >= '0') && (d <= '9'))
618 else if ((d >= 'a') && (d <= 'f'))
619 uu |= (d - ('a'-10));
628 Pack 'void *' into a string buffer.
631 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
633 if ((2*sizeof(void *) + 2) > bsz) return 0;
635 r = SWIG_PackData(r,&ptr,sizeof(void *));
636 if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
641 SWIGRUNTIME const char *
642 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
644 if (strcmp(c,"NULL") == 0) {
651 return SWIG_UnpackData(++c,ptr,sizeof(void *));
655 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
657 size_t lname = (name ? strlen(name) : 0);
658 if ((2*sz + 2 + lname) > bsz) return 0;
660 r = SWIG_PackData(r,ptr,sz);
662 strncpy(r,name,lname+1);
669 SWIGRUNTIME const char *
670 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
672 if (strcmp(c,"NULL") == 0) {
679 return SWIG_UnpackData(++c,ptr,sz);
687 #define SWIG_UnknownError -1
688 #define SWIG_IOError -2
689 #define SWIG_RuntimeError -3
690 #define SWIG_IndexError -4
691 #define SWIG_TypeError -5
692 #define SWIG_DivisionByZero -6
693 #define SWIG_OverflowError -7
694 #define SWIG_SyntaxError -8
695 #define SWIG_ValueError -9
696 #define SWIG_SystemError -10
697 #define SWIG_AttributeError -11
698 #define SWIG_MemoryError -12
699 #define SWIG_NullReferenceError -13
704 /* Needed on some windows machines---since MS plays funny games with the header files under C++ */
713 /* Add in functionality missing in older versions of Perl. Much of this is based on Devel-PPPort on cpan. */
715 /* Add PERL_REVISION, PERL_VERSION, PERL_SUBVERSION if missing */
716 #ifndef PERL_REVISION
717 # if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
718 # define PERL_PATCHLEVEL_H_IMPLICIT
719 # include <patchlevel.h>
721 # if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
722 # include <could_not_find_Perl_patchlevel.h>
724 # ifndef PERL_REVISION
725 # define PERL_REVISION (5)
726 # define PERL_VERSION PATCHLEVEL
727 # define PERL_SUBVERSION SUBVERSION
731 #if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE)
732 #define PerlIO_exportFILE(fh,fl) (FILE*)(fh)
736 # define SvIOK_UV(sv) (SvIOK(sv) && (SvUVX(sv) == SvIVX(sv)))
740 # define SvUOK(sv) SvIOK_UV(sv)
743 #if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5)))
744 # define PL_sv_undef sv_undef
746 # define PL_errgv errgv
747 # define PL_sv_no sv_no
748 # define PL_sv_yes sv_yes
749 # define PL_markstack_ptr markstack_ptr
754 # define IVSIZE LONGSIZE
756 # define IVSIZE 4 /* A bold guess, but the best we can make. */
761 # if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
763 # define INT2PTR(any,d) (any)(d)
765 # if PTRSIZE == LONGSIZE
766 # define PTRV unsigned long
768 # define PTRV unsigned
770 # define INT2PTR(any,d) (any)(PTRV)(d)
773 # define NUM2PTR(any,d) (any)(PTRV)(d)
774 # define PTR2IV(p) INT2PTR(IV,p)
775 # define PTR2UV(p) INT2PTR(UV,p)
776 # define PTR2NV(p) NUM2PTR(NV,p)
778 # if PTRSIZE == LONGSIZE
779 # define PTR2ul(p) (unsigned long)(p)
781 # define PTR2ul(p) INT2PTR(unsigned long,p)
783 #endif /* !INT2PTR */
786 # define SvPV_nolen(x) SvPV(x,PL_na)
790 # define get_sv perl_get_sv
794 # define ERRSV get_sv("@",FALSE)
806 /* -----------------------------------------------------------------------------
808 * ----------------------------------------------------------------------------- */
810 SWIGINTERN const char*
811 SWIG_Perl_ErrorType(int code) {
812 const char* type = 0;
814 case SWIG_MemoryError:
815 type = "MemoryError";
820 case SWIG_RuntimeError:
821 type = "RuntimeError";
823 case SWIG_IndexError:
829 case SWIG_DivisionByZero:
830 type = "ZeroDivisionError";
832 case SWIG_OverflowError:
833 type = "OverflowError";
835 case SWIG_SyntaxError:
836 type = "SyntaxError";
838 case SWIG_ValueError:
841 case SWIG_SystemError:
842 type = "SystemError";
844 case SWIG_AttributeError:
845 type = "AttributeError";
848 type = "RuntimeError";
856 /* -----------------------------------------------------------------------------
859 * This file contains the runtime support for Perl modules
860 * and includes code for managing global variables and pointer
862 * ----------------------------------------------------------------------------- */
865 #define SWIG_PERL_OBJECT_DECL CPerlObj *SWIGUNUSEDPARM(pPerl),
866 #define SWIG_PERL_OBJECT_CALL pPerl,
868 #define SWIG_PERL_OBJECT_DECL
869 #define SWIG_PERL_OBJECT_CALL
872 /* Common SWIG API */
874 /* for raw pointers */
875 #define SWIG_ConvertPtr(obj, pp, type, flags) SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags)
876 #define SWIG_NewPointerObj(p, type, flags) SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags)
878 /* for raw packed data */
879 #define SWIG_ConvertPacked(obj, p, s, type) SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type)
880 #define SWIG_NewPackedObj(p, s, type) SWIG_Perl_NewPackedObj(SWIG_PERL_OBJECT_CALL p, s, type)
882 /* for class or struct pointers */
883 #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
884 #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
886 /* for C or C++ function pointers */
887 #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0)
888 #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0)
890 /* for C++ member pointers, ie, member methods */
891 #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_ConvertPacked(obj, ptr, sz, ty)
892 #define SWIG_NewMemberObj(ptr, sz, type) SWIG_NewPackedObj(ptr, sz, type)
897 #define SWIG_GetModule(clientdata) SWIG_Perl_GetModule()
898 #define SWIG_SetModule(clientdata, pointer) SWIG_Perl_SetModule(pointer)
901 /* Error manipulation */
903 #define SWIG_ErrorType(code) SWIG_Perl_ErrorType(code)
904 #define SWIG_Error(code, msg) sv_setpvf(GvSV(PL_errgv),"%s %s\n", SWIG_ErrorType(code), msg)
905 #define SWIG_fail goto fail
907 /* Perl-specific SWIG API */
909 #define SWIG_MakePtr(sv, ptr, type, flags) SWIG_Perl_MakePtr(SWIG_PERL_OBJECT_CALL sv, ptr, type, flags)
910 #define SWIG_MakePackedObj(sv, p, s, type) SWIG_Perl_MakePackedObj(SWIG_PERL_OBJECT_CALL sv, p, s, type)
911 #define SWIG_SetError(str) SWIG_Error(SWIG_RuntimeError, str)
914 #define SWIG_PERL_DECL_ARGS_1(arg1) (SWIG_PERL_OBJECT_DECL arg1)
915 #define SWIG_PERL_CALL_ARGS_1(arg1) (SWIG_PERL_OBJECT_CALL arg1)
916 #define SWIG_PERL_DECL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_DECL arg1, arg2)
917 #define SWIG_PERL_CALL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_CALL arg1, arg2)
919 /* -----------------------------------------------------------------------------
920 * pointers/data manipulation
921 * ----------------------------------------------------------------------------- */
923 /* For backward compatibility only */
924 #define SWIG_POINTER_EXCEPTION 0
930 #define SWIG_OWNER SWIG_POINTER_OWN
931 #define SWIG_SHADOW SWIG_OWNER << 1
933 #define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL
935 /* SWIG Perl macros */
937 /* Macro to declare an XS function */
939 # define XSPROTO(name) void name(pTHX_ CV* cv)
942 /* Macro to call an XS function */
944 # define SWIG_CALLXS(_name) _name(cv,pPerl)
946 # ifndef MULTIPLICITY
947 # define SWIG_CALLXS(_name) _name(cv)
949 # define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv)
954 #define MAGIC_PPERL CPerlObj *pPerl = (CPerlObj *) this;
959 typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *);
964 #define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
965 #define SWIGCLASS_STATIC
967 #else /* PERL_OBJECT */
970 #define SWIGCLASS_STATIC static SWIGUNUSED
973 #define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
978 typedef int (*SwigMagicFunc)(SV *, MAGIC *);
983 #else /* MULTIPLICITY */
985 #define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b)
990 typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *);
995 #endif /* MULTIPLICITY */
996 #endif /* PERL_OBJECT */
998 /* Workaround for bug in perl 5.6.x croak and earlier */
999 #if (PERL_VERSION < 8)
1001 # define SWIG_croak_null() SWIG_Perl_croak_null(pPerl)
1002 static void SWIG_Perl_croak_null(CPerlObj *pPerl)
1004 static void SWIG_croak_null()
1008 # if (PERL_VERSION < 6)
1011 if (SvOK(err) && !SvROK(err)) croak("%_", err);
1016 # define SWIG_croak_null() croak(Nullch)
1021 Define how strict is the cast between strings and integers/doubles
1022 when overloading between these types occurs.
1024 The default is making it as strict as possible by using SWIG_AddCast
1027 You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to
1028 disable the SWIG_AddCast, making the casting between string and
1029 numbers less strict.
1031 In the end, we try to solve the overloading between strings and
1032 numerical types in the more natural way, but if you can avoid it,
1033 well, avoid it using %rename, for example.
1035 #ifndef SWIG_PERL_NO_STRICT_STR2NUM
1036 # ifndef SWIG_PERL_STRICT_STR2NUM
1037 # define SWIG_PERL_STRICT_STR2NUM
1040 #ifdef SWIG_PERL_STRICT_STR2NUM
1041 /* string takes precedence */
1042 #define SWIG_Str2NumCast(x) SWIG_AddCast(x)
1044 /* number takes precedence */
1045 #define SWIG_Str2NumCast(x) x
1052 SWIGRUNTIME const char *
1053 SWIG_Perl_TypeProxyName(const swig_type_info *type) {
1054 if (!type) return NULL;
1055 if (type->clientdata != NULL) {
1056 return (const char*) type->clientdata;
1063 SWIGRUNTIME swig_cast_info *
1064 SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) {
1065 SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp(iter->type->name, c) == 0))
1066 || (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0))), ty);
1070 /* Function for getting a pointer value */
1073 SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) {
1075 void *voidptr = (void *)0;
1077 /* If magical, apply more magic */
1081 /* Check to see if this is an object */
1082 if (sv_isobject(sv)) {
1084 tsv = (SV*) SvRV(sv);
1085 if ((SvTYPE(tsv) == SVt_PVHV)) {
1087 if (SvMAGICAL(tsv)) {
1088 mg = mg_find(tsv,'P');
1091 if (sv_isobject(sv)) {
1092 tsv = (SV*)SvRV(sv);
1102 voidptr = INT2PTR(void *,tmp);
1103 } else if (! SvOK(sv)) { /* Check for undef */
1104 *(ptr) = (void *) 0;
1106 } else if (SvTYPE(sv) == SVt_RV) { /* Check for NULL pointer */
1108 *(ptr) = (void *) 0;
1113 } else { /* Don't know what it is */
1117 /* Now see if the types match */
1118 char *_c = HvNAME(SvSTASH(SvRV(sv)));
1119 tc = SWIG_TypeProxyCheck(_c,_t);
1125 *ptr = SWIG_TypeCast(tc,voidptr,&newmemory);
1126 assert(!newmemory); /* newmemory handling not yet implemented */
1133 * DISOWN implementation: we need a perl guru to check this one.
1135 if (tsv && (flags & SWIG_POINTER_DISOWN)) {
1137 * almost copy paste code from below SWIG_POINTER_OWN setting
1140 HV *stash = SvSTASH(SvRV(obj));
1141 GV *gv = *(GV**) hv_fetch(stash, "OWNER", 5, TRUE);
1145 * To set ownership (see below), a newSViv(1) entry is added.
1146 * Hence, to remove ownership, we delete the entry.
1148 if (hv_exists_ent(hv, obj, 0)) {
1149 hv_delete_ent(hv, obj, 0, 0);
1157 SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) {
1158 if (ptr && (flags & SWIG_SHADOW)) {
1163 sv_setref_pv(obj, (char *) SWIG_Perl_TypeProxyName(t), ptr);
1164 stash=SvSTASH(SvRV(obj));
1165 if (flags & SWIG_POINTER_OWN) {
1167 GV *gv=*(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
1169 gv_init(gv, stash, "OWNER", 5, FALSE);
1171 hv_store_ent(hv, obj, newSViv(1), 0);
1173 sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0);
1175 self=newRV_noinc((SV *)hash);
1177 SvREFCNT_dec((SV *)self);
1178 sv_bless(sv, stash);
1181 sv_setref_pv(sv, (char *) SWIG_Perl_TypeProxyName(t), ptr);
1185 SWIGRUNTIMEINLINE SV *
1186 SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) {
1187 SV *result = sv_newmortal();
1188 SWIG_MakePtr(result, ptr, t, flags);
1193 SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) {
1196 if ((2*sz + 1 + strlen(SWIG_Perl_TypeProxyName(type))) > 1000) return;
1198 r = SWIG_PackData(r,ptr,sz);
1199 strcpy(r,SWIG_Perl_TypeProxyName(type));
1200 sv_setpv(sv, result);
1204 SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info *type) {
1205 SV *result = sv_newmortal();
1206 SWIG_Perl_MakePackedObj(result, ptr, sz, type);
1210 /* Convert a packed value value */
1212 SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) {
1216 if ((!obj) || (!SvOK(obj))) return SWIG_ERROR;
1217 c = SvPV_nolen(obj);
1218 /* Pointer values must start with leading underscore */
1219 if (*c != '_') return SWIG_ERROR;
1221 c = SWIG_UnpackData(c,ptr,sz);
1223 tc = SWIG_TypeCheck(c,ty);
1224 if (!tc) return SWIG_ERROR;
1230 /* Macros for low-level exception handling */
1231 #define SWIG_croak(x) { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; }
1234 typedef XSPROTO(SwigPerlWrapper);
1235 typedef SwigPerlWrapper *SwigPerlWrapperPtr;
1237 /* Structure for command table */
1240 SwigPerlWrapperPtr wrapper;
1241 } swig_command_info;
1243 /* Information for constant table */
1246 #define SWIG_FLOAT 2
1247 #define SWIG_STRING 3
1248 #define SWIG_POINTER 4
1249 #define SWIG_BINARY 5
1251 /* Constant information structure */
1252 typedef struct swig_constant_info {
1258 swig_type_info **ptype;
1259 } swig_constant_info;
1262 /* Structure for variable table */
1267 swig_type_info **type;
1268 } swig_variable_info;
1270 /* Magic variable code */
1272 #define swig_create_magic(s,a,b,c) _swig_create_magic(s,a,b,c)
1273 #ifndef MULTIPLICITY
1274 SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *))
1276 SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *))
1279 # define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c)
1280 SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *))
1284 sv_magic(sv,sv,'U',(char *) name,strlen(name));
1285 mg = mg_find(sv,'U');
1286 mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
1287 mg->mg_virtual->svt_get = (SwigMagicFunc) get;
1288 mg->mg_virtual->svt_set = (SwigMagicFunc) set;
1289 mg->mg_virtual->svt_len = 0;
1290 mg->mg_virtual->svt_clear = 0;
1291 mg->mg_virtual->svt_free = 0;
1295 SWIGRUNTIME swig_module_info *
1296 SWIG_Perl_GetModule(void) {
1297 static void *type_pointer = (void *)0;
1300 /* first check if pointer already created */
1301 if (!type_pointer) {
1302 pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE | GV_ADDMULTI);
1303 if (pointer && SvOK(pointer)) {
1304 type_pointer = INT2PTR(swig_type_info **, SvIV(pointer));
1308 return (swig_module_info *) type_pointer;
1312 SWIG_Perl_SetModule(swig_module_info *module) {
1315 /* create a new pointer */
1316 pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE | GV_ADDMULTI);
1317 sv_setiv(pointer, PTR2IV(module));
1324 /* Workaround perl5 global namespace pollution. Note that undefining library
1325 * functions like fopen will not solve the problem on all platforms as fopen
1326 * might be a macro on Windows but not necessarily on other operating systems. */
1420 #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
1422 #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
1426 #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0)
1429 /* -------- TYPES TABLE (BEGIN) -------- */
1431 #define SWIGTYPE_p_a_STRMAX__char swig_types[0]
1432 #define SWIGTYPE_p_char swig_types[1]
1433 #define SWIGTYPE_p_double swig_types[2]
1434 #define SWIGTYPE_p_float swig_types[3]
1435 #define SWIGTYPE_p_gint16 swig_types[4]
1436 #define SWIGTYPE_p_gint32 swig_types[5]
1437 #define SWIGTYPE_p_gint64 swig_types[6]
1438 #define SWIGTYPE_p_gint8 swig_types[7]
1439 #define SWIGTYPE_p_guint16 swig_types[8]
1440 #define SWIGTYPE_p_guint32 swig_types[9]
1441 #define SWIGTYPE_p_guint64 swig_types[10]
1442 #define SWIGTYPE_p_guint8 swig_types[11]
1443 #define SWIGTYPE_p_int swig_types[12]
1444 #define SWIGTYPE_p_unsigned_char swig_types[13]
1445 static swig_type_info *swig_types[15];
1446 static swig_module_info swig_module = {swig_types, 14, 0, 0, 0, 0};
1447 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1448 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1450 /* -------- TYPES TABLE (END) -------- */
1452 #define SWIG_init boot_Amanda__Tests
1454 #define SWIG_name "Amanda::Testsc::boot_Amanda__Tests"
1455 #define SWIG_prefix "Amanda::Testsc::"
1457 #define SWIGVERSION 0x010335
1458 #define SWIG_VERSION SWIGVERSION
1461 #define SWIG_as_voidptr(a) (void *)((const void *)(a))
1462 #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a))
1469 #ifndef MULTIPLICITY
1470 SWIGEXPORT void SWIG_init (CV* cv);
1472 SWIGEXPORT void SWIG_init (pTHXo_ CV* cv);
1475 SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *);
1488 #include "simpleprng.h"
1493 * exercise bigint.c / integer.swg
1496 char *take_guint64(guint64 input) {
1497 if (input == G_MAXUINT64) return "MAX";
1498 if (input == 0) return "ZERO";
1502 char *take_gint64(gint64 input) {
1503 if (input == G_MAXINT64) return "MAX";
1504 if (input == G_MININT64) return "MIN";
1505 if (input == 0) return "ZERO";
1509 char *take_guint32(guint32 input) {
1510 if (input == G_MAXUINT32) return "MAX";
1511 if (input == 0) return "ZERO";
1515 char *take_gint32(gint32 input) {
1516 if (input == G_MAXINT32) return "MAX";
1517 if (input == G_MININT32) return "MIN";
1518 if (input == 0) return "ZERO";
1522 char *take_guint16(guint16 input) {
1523 if (input == G_MAXUINT16) return "MAX";
1524 if (input == 0) return "ZERO";
1528 char *take_gint16(gint16 input) {
1529 if (input == G_MAXINT16) return "MAX";
1530 if (input == G_MININT16) return "MIN";
1531 if (input == 0) return "ZERO";
1535 char *take_guint8(guint8 input) {
1536 if (input == G_MAXUINT8) return "MAX";
1537 if (input == 0) return "ZERO";
1541 char *take_gint8(gint8 input) {
1542 if (input == G_MAXINT8) return "MAX";
1543 if (input == G_MININT8) return "MIN";
1544 if (input == 0) return "ZERO";
1549 guint64 give_guint64(char *input) {
1550 if (input[0] == '+') return G_MAXUINT64;
1554 gint64 give_gint64(char *input) {
1555 if (input[0] == '-') return G_MININT64;
1556 if (input[0] == '+') return G_MAXINT64;
1560 guint32 give_guint32(char *input) {
1561 if (input[0] == '+') return G_MAXUINT32;
1565 gint32 give_gint32(char *input) {
1566 if (input[0] == '-') return G_MININT32;
1567 if (input[0] == '+') return G_MAXINT32;
1571 guint16 give_guint16(char *input) {
1572 if (input[0] == '+') return G_MAXUINT16;
1576 gint16 give_gint16(char *input) {
1577 if (input[0] == '-') return G_MININT16;
1578 if (input[0] == '+') return G_MAXINT16;
1582 guint8 give_guint8(char *input) {
1583 if (input[0] == '+') return G_MAXUINT8;
1587 gint8 give_gint8(char *input) {
1588 if (input[0] == '-') return G_MININT8;
1589 if (input[0] == '+') return G_MAXINT8;
1594 SWIGINTERNINLINE SV *
1595 SWIG_FromCharPtrAndSize(const char* carray, size_t size)
1597 SV *obj = sv_newmortal();
1599 sv_setpvn(obj, carray, size);
1601 sv_setsv(obj, &PL_sv_undef);
1607 SWIGINTERNINLINE SV *
1608 SWIG_FromCharPtr(const char *cptr)
1610 return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
1614 SWIGINTERN swig_type_info*
1615 SWIG_pchar_descriptor(void)
1617 static int init = 0;
1618 static swig_type_info* info = 0;
1620 info = SWIG_TypeQuery("_p_char");
1628 SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
1632 char *cstr = SvPV(obj, len);
1633 size_t size = len + 1;
1636 if (*alloc == SWIG_NEWOBJ) {
1637 *cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size));
1640 *alloc = SWIG_OLDOBJ;
1644 if (psize) *psize = size;
1647 swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
1648 if (pchar_descriptor) {
1650 if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) {
1651 if (cptr) *cptr = vptr;
1652 if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
1653 if (alloc) *alloc = SWIG_OLDOBJ;
1658 return SWIG_TypeError;
1666 int sizeof_size_t(void) {
1667 return sizeof(size_t);
1673 /* write LENGTH bytes of random data to FILENAME, seeded with SEED */
1675 write_random_file(guint32 seed, size_t length, char *filename) {
1676 simpleprng_state_t prng;
1680 simpleprng_seed(&prng, seed);
1682 fd = open(filename, O_CREAT|O_WRONLY|O_TRUNC, 0666);
1684 g_critical(_("Could not open test file '%s': %s"), filename, strerror(errno));
1687 size_t to_write = min(sizeof(buf), length);
1690 simpleprng_fill_buffer(&prng, buf, to_write);
1692 written = full_write(fd, buf, to_write);
1693 if (written < to_write)
1694 g_critical(_("Error writing test file: %s"), strerror(errno));
1702 /* read LENGTH bytes of random data from FILENAME verifying it against
1703 * a PRNG seeded with SEED. Sends any error messages to stderr.
1705 * If check_eof is true, then check that the file is exactly LENGTH bytes long;
1706 * otherwise, trailing bytes (such as zero padding from a Device) are ignored.
1709 verify_random_file(guint32 seed, size_t length, char *filename, gboolean check_eof) {
1710 simpleprng_state_t prng;
1714 simpleprng_seed(&prng, seed);
1716 fd = open(filename, O_RDONLY, 0666);
1718 g_critical(_("Could not open test file '%s': %s"), filename, strerror(errno));
1721 size_t to_read = min(sizeof(buf), length);
1724 bytes_read = full_read(fd, buf, to_read);
1725 if (bytes_read < to_read) {
1727 g_critical(_("Error reading test file: %s"), strerror(errno));
1729 g_fprintf(stderr, _("Verify of '%s' failed: early EOF with %zd bytes left\n"),
1730 filename, length - bytes_read);
1735 if (!simpleprng_verify_buffer(&prng, buf, bytes_read))
1738 length -= bytes_read;
1741 /* verify that the file contains no extra bytes */
1743 if (read(fd, buf, 1)) {
1744 g_fprintf(stderr, _("Verify of '%s' failed: file is too long\n"), filename);
1760 SWIG_AsVal_double SWIG_PERL_DECL_ARGS_2(SV *obj, double *val)
1763 if (val) *val = SvNV(obj);
1765 } else if (SvIOK(obj)) {
1766 if (val) *val = (double) SvIV(obj);
1767 return SWIG_AddCast(SWIG_OK);
1769 const char *nptr = SvPV_nolen(obj);
1772 double v = strtod(nptr, &endptr);
1773 if (errno == ERANGE) {
1775 return SWIG_OverflowError;
1777 if (*endptr == '\0') {
1779 return SWIG_Str2NumCast(SWIG_OK);
1784 return SWIG_TypeError;
1794 SWIGINTERNINLINE int
1795 SWIG_CanCastAsInteger(double *d, double min, double max) {
1797 if ((min <= x && x <= max)) {
1798 double fx = floor(x);
1799 double cx = ceil(x);
1800 double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */
1801 if ((errno == EDOM) || (errno == ERANGE)) {
1804 double summ, reps, diff;
1807 } else if (rd > x) {
1814 if (reps < 8*DBL_EPSILON) {
1825 SWIG_AsVal_unsigned_SS_long SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long *val)
1828 if (val) *val = SvUV(obj);
1830 } else if (SvIOK(obj)) {
1836 return SWIG_OverflowError;
1840 const char *nptr = SvPV_nolen(obj);
1845 v = strtoul(nptr, &endptr,0);
1846 if (errno == ERANGE) {
1848 return SWIG_OverflowError;
1850 if (*endptr == '\0') {
1852 return SWIG_Str2NumCast(SWIG_OK);
1858 int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
1859 if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
1860 if (val) *val = (unsigned long)(d);
1865 return SWIG_TypeError;
1869 SWIGINTERNINLINE int
1870 SWIG_AsVal_size_t SWIG_PERL_DECL_ARGS_2(SV * obj, size_t *val)
1873 int res = SWIG_AsVal_unsigned_SS_long SWIG_PERL_CALL_ARGS_2(obj, val ? &v : 0);
1874 if (SWIG_IsOK(res) && val) *val = (size_t)(v);
1880 #if !defined(SWIG_NO_LLONG_MAX)
1881 # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
1882 # define LLONG_MAX __LONG_LONG_MAX__
1883 # define LLONG_MIN (-LLONG_MAX - 1LL)
1884 # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
1890 SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val)
1893 if (val) *val = SvIV(obj);
1897 const char *nptr = SvPV_nolen(obj);
1902 v = strtol(nptr, &endptr,0);
1903 if (errno == ERANGE) {
1905 return SWIG_OverflowError;
1907 if (*endptr == '\0') {
1909 return SWIG_Str2NumCast(SWIG_OK);
1915 int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
1916 if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
1917 if (val) *val = (long)(d);
1922 return SWIG_TypeError;
1927 SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val)
1930 int res = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(obj, &v);
1931 if (SWIG_IsOK(res)) {
1932 if ((v < INT_MIN || v > INT_MAX)) {
1933 return SWIG_OverflowError;
1935 if (val) *val = (int)(v);
1946 #define MAGIC_CLASS _wrap_Amanda::Tests_var::
1947 class _wrap_Amanda::Tests_var : public CPerlObj {
1952 SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *SWIGUNUSEDPARM(sv), MAGIC *SWIGUNUSEDPARM(mg)) {
1954 croak("Value is read-only.");
1970 XS(_wrap_take_guint64) {
1977 if ((items < 1) || (items > 1)) {
1978 SWIG_croak("Usage: take_guint64(input);");
1981 arg1 = amglue_SvU64(ST(0));
1983 result = (char *)take_guint64(arg1);
1984 ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
1992 XS(_wrap_take_gint64) {
1999 if ((items < 1) || (items > 1)) {
2000 SWIG_croak("Usage: take_gint64(input);");
2003 arg1 = amglue_SvI64(ST(0));
2005 result = (char *)take_gint64(arg1);
2006 ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
2014 XS(_wrap_take_guint32) {
2021 if ((items < 1) || (items > 1)) {
2022 SWIG_croak("Usage: take_guint32(input);");
2025 arg1 = amglue_SvU32(ST(0));
2027 result = (char *)take_guint32(arg1);
2028 ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
2036 XS(_wrap_take_gint32) {
2043 if ((items < 1) || (items > 1)) {
2044 SWIG_croak("Usage: take_gint32(input);");
2047 arg1 = amglue_SvI32(ST(0));
2049 result = (char *)take_gint32(arg1);
2050 ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
2058 XS(_wrap_take_guint16) {
2065 if ((items < 1) || (items > 1)) {
2066 SWIG_croak("Usage: take_guint16(input);");
2069 arg1 = amglue_SvU16(ST(0));
2071 result = (char *)take_guint16(arg1);
2072 ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
2080 XS(_wrap_take_gint16) {
2087 if ((items < 1) || (items > 1)) {
2088 SWIG_croak("Usage: take_gint16(input);");
2091 arg1 = amglue_SvI16(ST(0));
2093 result = (char *)take_gint16(arg1);
2094 ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
2102 XS(_wrap_take_guint8) {
2109 if ((items < 1) || (items > 1)) {
2110 SWIG_croak("Usage: take_guint8(input);");
2113 arg1 = amglue_SvU8(ST(0));
2115 result = (char *)take_guint8(arg1);
2116 ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
2124 XS(_wrap_take_gint8) {
2131 if ((items < 1) || (items > 1)) {
2132 SWIG_croak("Usage: take_gint8(input);");
2135 arg1 = amglue_SvI8(ST(0));
2137 result = (char *)take_gint8(arg1);
2138 ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
2146 XS(_wrap_give_guint64) {
2148 char *arg1 = (char *) 0 ;
2156 if ((items < 1) || (items > 1)) {
2157 SWIG_croak("Usage: give_guint64(input);");
2159 res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
2160 if (!SWIG_IsOK(res1)) {
2161 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "give_guint64" "', argument " "1"" of type '" "char *""'");
2163 arg1 = (char *)(buf1);
2164 result = give_guint64(arg1);
2166 ST(argvi) = sv_2mortal(amglue_newSVu64(result));
2169 if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2172 if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2178 XS(_wrap_give_gint64) {
2180 char *arg1 = (char *) 0 ;
2188 if ((items < 1) || (items > 1)) {
2189 SWIG_croak("Usage: give_gint64(input);");
2191 res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
2192 if (!SWIG_IsOK(res1)) {
2193 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "give_gint64" "', argument " "1"" of type '" "char *""'");
2195 arg1 = (char *)(buf1);
2196 result = give_gint64(arg1);
2198 ST(argvi) = sv_2mortal(amglue_newSVi64(result));
2201 if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2204 if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2210 XS(_wrap_give_guint32) {
2212 char *arg1 = (char *) 0 ;
2220 if ((items < 1) || (items > 1)) {
2221 SWIG_croak("Usage: give_guint32(input);");
2223 res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
2224 if (!SWIG_IsOK(res1)) {
2225 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "give_guint32" "', argument " "1"" of type '" "char *""'");
2227 arg1 = (char *)(buf1);
2228 result = give_guint32(arg1);
2230 ST(argvi) = sv_2mortal(amglue_newSVu64(result));
2233 if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2236 if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2242 XS(_wrap_give_gint32) {
2244 char *arg1 = (char *) 0 ;
2252 if ((items < 1) || (items > 1)) {
2253 SWIG_croak("Usage: give_gint32(input);");
2255 res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
2256 if (!SWIG_IsOK(res1)) {
2257 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "give_gint32" "', argument " "1"" of type '" "char *""'");
2259 arg1 = (char *)(buf1);
2260 result = give_gint32(arg1);
2262 ST(argvi) = sv_2mortal(amglue_newSVi64(result));
2265 if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2268 if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2274 XS(_wrap_give_guint16) {
2276 char *arg1 = (char *) 0 ;
2284 if ((items < 1) || (items > 1)) {
2285 SWIG_croak("Usage: give_guint16(input);");
2287 res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
2288 if (!SWIG_IsOK(res1)) {
2289 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "give_guint16" "', argument " "1"" of type '" "char *""'");
2291 arg1 = (char *)(buf1);
2292 result = give_guint16(arg1);
2294 ST(argvi) = sv_2mortal(amglue_newSVu64(result));
2297 if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2300 if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2306 XS(_wrap_give_gint16) {
2308 char *arg1 = (char *) 0 ;
2316 if ((items < 1) || (items > 1)) {
2317 SWIG_croak("Usage: give_gint16(input);");
2319 res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
2320 if (!SWIG_IsOK(res1)) {
2321 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "give_gint16" "', argument " "1"" of type '" "char *""'");
2323 arg1 = (char *)(buf1);
2324 result = give_gint16(arg1);
2326 ST(argvi) = sv_2mortal(amglue_newSVi64(result));
2329 if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2332 if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2338 XS(_wrap_give_guint8) {
2340 char *arg1 = (char *) 0 ;
2348 if ((items < 1) || (items > 1)) {
2349 SWIG_croak("Usage: give_guint8(input);");
2351 res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
2352 if (!SWIG_IsOK(res1)) {
2353 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "give_guint8" "', argument " "1"" of type '" "char *""'");
2355 arg1 = (char *)(buf1);
2356 result = give_guint8(arg1);
2358 ST(argvi) = sv_2mortal(amglue_newSVu64(result));
2361 if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2364 if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2370 XS(_wrap_give_gint8) {
2372 char *arg1 = (char *) 0 ;
2380 if ((items < 1) || (items > 1)) {
2381 SWIG_croak("Usage: give_gint8(input);");
2383 res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
2384 if (!SWIG_IsOK(res1)) {
2385 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "give_gint8" "', argument " "1"" of type '" "char *""'");
2387 arg1 = (char *)(buf1);
2388 result = give_gint8(arg1);
2390 ST(argvi) = sv_2mortal(amglue_newSVi64(result));
2393 if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2396 if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2402 XS(_wrap_sizeof_size_t) {
2408 if ((items < 0) || (items > 0)) {
2409 SWIG_croak("Usage: sizeof_size_t();");
2411 result = (int)sizeof_size_t();
2413 ST(argvi) = sv_2mortal(amglue_newSVi64(result));
2423 XS(_wrap_write_random_file) {
2427 char *arg3 = (char *) 0 ;
2434 if ((items < 3) || (items > 3)) {
2435 SWIG_croak("Usage: write_random_file(seed,length,filename);");
2438 arg1 = amglue_SvU32(ST(0));
2441 if (sizeof(size_t) == 1) {
2442 arg2 = amglue_SvU8(ST(1));
2443 } else if (sizeof(size_t) == 2) {
2444 arg2 = amglue_SvU16(ST(1));
2445 } else if (sizeof(size_t) == 4) {
2446 arg2 = amglue_SvU32(ST(1));
2447 } else if (sizeof(size_t) == 8) {
2448 arg2 = amglue_SvU64(ST(1));
2450 croak("Unexpected size_t >64 bits?"); /* should be optimized out unless sizeof(size_t) > 8 */
2453 res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
2454 if (!SWIG_IsOK(res3)) {
2455 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "write_random_file" "', argument " "3"" of type '" "char *""'");
2457 arg3 = (char *)(buf3);
2458 write_random_file(arg1,arg2,arg3);
2461 if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
2465 if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
2471 XS(_wrap_verify_random_file) {
2475 char *arg3 = (char *) 0 ;
2484 if ((items < 4) || (items > 4)) {
2485 SWIG_croak("Usage: verify_random_file(seed,length,filename,check_eof);");
2488 arg1 = amglue_SvU32(ST(0));
2491 if (sizeof(size_t) == 1) {
2492 arg2 = amglue_SvU8(ST(1));
2493 } else if (sizeof(size_t) == 2) {
2494 arg2 = amglue_SvU16(ST(1));
2495 } else if (sizeof(size_t) == 4) {
2496 arg2 = amglue_SvU32(ST(1));
2497 } else if (sizeof(size_t) == 8) {
2498 arg2 = amglue_SvU64(ST(1));
2500 croak("Unexpected size_t >64 bits?"); /* should be optimized out unless sizeof(size_t) > 8 */
2503 res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
2504 if (!SWIG_IsOK(res3)) {
2505 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "verify_random_file" "', argument " "3"" of type '" "char *""'");
2507 arg3 = (char *)(buf3);
2509 if (sizeof(signed int) == 1) {
2510 arg4 = amglue_SvI8(ST(3));
2511 } else if (sizeof(signed int) == 2) {
2512 arg4 = amglue_SvI16(ST(3));
2513 } else if (sizeof(signed int) == 4) {
2514 arg4 = amglue_SvI32(ST(3));
2515 } else if (sizeof(signed int) == 8) {
2516 arg4 = amglue_SvI64(ST(3));
2518 g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
2521 result = (gboolean)verify_random_file(arg1,arg2,arg3,arg4);
2523 ST(argvi) = sv_2mortal(amglue_newSVi64(result));
2527 if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
2532 if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
2540 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
2542 static swig_type_info _swigt__p_a_STRMAX__char = {"_p_a_STRMAX__char", "char (*)[STRMAX]|string_t *", 0, 0, (void*)0, 0};
2543 static swig_type_info _swigt__p_char = {"_p_char", "gchar *|char *", 0, 0, (void*)0, 0};
2544 static swig_type_info _swigt__p_double = {"_p_double", "double *|gdouble *", 0, 0, (void*)0, 0};
2545 static swig_type_info _swigt__p_float = {"_p_float", "float *|gfloat *", 0, 0, (void*)0, 0};
2546 static swig_type_info _swigt__p_gint16 = {"_p_gint16", "gint16 *", 0, 0, (void*)0, 0};
2547 static swig_type_info _swigt__p_gint32 = {"_p_gint32", "gint32 *", 0, 0, (void*)0, 0};
2548 static swig_type_info _swigt__p_gint64 = {"_p_gint64", "gint64 *", 0, 0, (void*)0, 0};
2549 static swig_type_info _swigt__p_gint8 = {"_p_gint8", "gint8 *", 0, 0, (void*)0, 0};
2550 static swig_type_info _swigt__p_guint16 = {"_p_guint16", "guint16 *", 0, 0, (void*)0, 0};
2551 static swig_type_info _swigt__p_guint32 = {"_p_guint32", "guint32 *", 0, 0, (void*)0, 0};
2552 static swig_type_info _swigt__p_guint64 = {"_p_guint64", "guint64 *", 0, 0, (void*)0, 0};
2553 static swig_type_info _swigt__p_guint8 = {"_p_guint8", "guint8 *", 0, 0, (void*)0, 0};
2554 static swig_type_info _swigt__p_int = {"_p_int", "int *|filetype_t *|gboolean *", 0, 0, (void*)0, 0};
2555 static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "guchar *|unsigned char *", 0, 0, (void*)0, 0};
2557 static swig_type_info *swig_type_initial[] = {
2558 &_swigt__p_a_STRMAX__char,
2571 &_swigt__p_unsigned_char,
2574 static swig_cast_info _swigc__p_a_STRMAX__char[] = { {&_swigt__p_a_STRMAX__char, 0, 0, 0},{0, 0, 0, 0}};
2575 static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
2576 static swig_cast_info _swigc__p_double[] = { {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
2577 static swig_cast_info _swigc__p_float[] = { {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}};
2578 static swig_cast_info _swigc__p_gint16[] = { {&_swigt__p_gint16, 0, 0, 0},{0, 0, 0, 0}};
2579 static swig_cast_info _swigc__p_gint32[] = { {&_swigt__p_gint32, 0, 0, 0},{0, 0, 0, 0}};
2580 static swig_cast_info _swigc__p_gint64[] = { {&_swigt__p_gint64, 0, 0, 0},{0, 0, 0, 0}};
2581 static swig_cast_info _swigc__p_gint8[] = { {&_swigt__p_gint8, 0, 0, 0},{0, 0, 0, 0}};
2582 static swig_cast_info _swigc__p_guint16[] = { {&_swigt__p_guint16, 0, 0, 0},{0, 0, 0, 0}};
2583 static swig_cast_info _swigc__p_guint32[] = { {&_swigt__p_guint32, 0, 0, 0},{0, 0, 0, 0}};
2584 static swig_cast_info _swigc__p_guint64[] = { {&_swigt__p_guint64, 0, 0, 0},{0, 0, 0, 0}};
2585 static swig_cast_info _swigc__p_guint8[] = { {&_swigt__p_guint8, 0, 0, 0},{0, 0, 0, 0}};
2586 static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
2587 static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
2589 static swig_cast_info *swig_cast_initial[] = {
2590 _swigc__p_a_STRMAX__char,
2603 _swigc__p_unsigned_char,
2607 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
2609 static swig_constant_info swig_constants[] = {
2615 static swig_variable_info swig_variables[] = {
2618 static swig_command_info swig_commands[] = {
2619 {"Amanda::Testsc::take_guint64", _wrap_take_guint64},
2620 {"Amanda::Testsc::take_gint64", _wrap_take_gint64},
2621 {"Amanda::Testsc::take_guint32", _wrap_take_guint32},
2622 {"Amanda::Testsc::take_gint32", _wrap_take_gint32},
2623 {"Amanda::Testsc::take_guint16", _wrap_take_guint16},
2624 {"Amanda::Testsc::take_gint16", _wrap_take_gint16},
2625 {"Amanda::Testsc::take_guint8", _wrap_take_guint8},
2626 {"Amanda::Testsc::take_gint8", _wrap_take_gint8},
2627 {"Amanda::Testsc::give_guint64", _wrap_give_guint64},
2628 {"Amanda::Testsc::give_gint64", _wrap_give_gint64},
2629 {"Amanda::Testsc::give_guint32", _wrap_give_guint32},
2630 {"Amanda::Testsc::give_gint32", _wrap_give_gint32},
2631 {"Amanda::Testsc::give_guint16", _wrap_give_guint16},
2632 {"Amanda::Testsc::give_gint16", _wrap_give_gint16},
2633 {"Amanda::Testsc::give_guint8", _wrap_give_guint8},
2634 {"Amanda::Testsc::give_gint8", _wrap_give_gint8},
2635 {"Amanda::Testsc::sizeof_size_t", _wrap_sizeof_size_t},
2636 {"Amanda::Testsc::write_random_file", _wrap_write_random_file},
2637 {"Amanda::Testsc::verify_random_file", _wrap_verify_random_file},
2640 /* -----------------------------------------------------------------------------
2641 * Type initialization:
2642 * This problem is tough by the requirement that no dynamic
2643 * memory is used. Also, since swig_type_info structures store pointers to
2644 * swig_cast_info structures and swig_cast_info structures store pointers back
2645 * to swig_type_info structures, we need some lookup code at initialization.
2646 * The idea is that swig generates all the structures that are needed.
2647 * The runtime then collects these partially filled structures.
2648 * The SWIG_InitializeModule function takes these initial arrays out of
2649 * swig_module, and does all the lookup, filling in the swig_module.types
2650 * array with the correct data and linking the correct swig_cast_info
2651 * structures together.
2653 * The generated swig_type_info structures are assigned staticly to an initial
2654 * array. We just loop through that array, and handle each type individually.
2655 * First we lookup if this type has been already loaded, and if so, use the
2656 * loaded structure instead of the generated one. Then we have to fill in the
2657 * cast linked list. The cast data is initially stored in something like a
2658 * two-dimensional array. Each row corresponds to a type (there are the same
2659 * number of rows as there are in the swig_type_initial array). Each entry in
2660 * a column is one of the swig_cast_info structures for that type.
2661 * The cast_initial array is actually an array of arrays, because each row has
2662 * a variable number of columns. So to actually build the cast linked list,
2663 * we find the array of casts associated with the type, and loop through it
2664 * adding the casts to the list. The one last trick we need to do is making
2665 * sure the type pointer in the swig_cast_info struct is correct.
2667 * First off, we lookup the cast->type name to see if it is already loaded.
2668 * There are three cases to handle:
2669 * 1) If the cast->type has already been loaded AND the type we are adding
2670 * casting info to has not been loaded (it is in this module), THEN we
2671 * replace the cast->type pointer with the type pointer that has already
2673 * 2) If BOTH types (the one we are adding casting info to, and the
2674 * cast->type) are loaded, THEN the cast info has already been loaded by
2675 * the previous module so we just ignore it.
2676 * 3) Finally, if cast->type has not already been loaded, then we add that
2677 * swig_cast_info to the linked list (because the cast->type) pointer will
2679 * ----------------------------------------------------------------------------- */
2689 #define SWIGRUNTIME_DEBUG
2694 SWIG_InitializeModule(void *clientdata) {
2696 swig_module_info *module_head, *iter;
2699 clientdata = clientdata;
2701 /* check to see if the circular list has been setup, if not, set it up */
2702 if (swig_module.next==0) {
2703 /* Initialize the swig_module */
2704 swig_module.type_initial = swig_type_initial;
2705 swig_module.cast_initial = swig_cast_initial;
2706 swig_module.next = &swig_module;
2712 /* Try and load any already created modules */
2713 module_head = SWIG_GetModule(clientdata);
2715 /* This is the first module loaded for this interpreter */
2716 /* so set the swig module into the interpreter */
2717 SWIG_SetModule(clientdata, &swig_module);
2718 module_head = &swig_module;
2720 /* the interpreter has loaded a SWIG module, but has it loaded this one? */
2724 if (iter==&swig_module) {
2729 } while (iter!= module_head);
2731 /* if the is found in the list, then all is done and we may leave */
2733 /* otherwise we must add out module into the list */
2734 swig_module.next = module_head->next;
2735 module_head->next = &swig_module;
2738 /* When multiple interpeters are used, a module could have already been initialized in
2739 a different interpreter, but not yet have a pointer in this interpreter.
2740 In this case, we do not want to continue adding types... everything should be
2742 if (init == 0) return;
2744 /* Now work on filling in swig_module.types */
2745 #ifdef SWIGRUNTIME_DEBUG
2746 printf("SWIG_InitializeModule: size %d\n", swig_module.size);
2748 for (i = 0; i < swig_module.size; ++i) {
2749 swig_type_info *type = 0;
2750 swig_type_info *ret;
2751 swig_cast_info *cast;
2753 #ifdef SWIGRUNTIME_DEBUG
2754 printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
2757 /* if there is another module already loaded */
2758 if (swig_module.next != &swig_module) {
2759 type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
2762 /* Overwrite clientdata field */
2763 #ifdef SWIGRUNTIME_DEBUG
2764 printf("SWIG_InitializeModule: found type %s\n", type->name);
2766 if (swig_module.type_initial[i]->clientdata) {
2767 type->clientdata = swig_module.type_initial[i]->clientdata;
2768 #ifdef SWIGRUNTIME_DEBUG
2769 printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
2773 type = swig_module.type_initial[i];
2776 /* Insert casting types */
2777 cast = swig_module.cast_initial[i];
2778 while (cast->type) {
2779 /* Don't need to add information already in the list */
2781 #ifdef SWIGRUNTIME_DEBUG
2782 printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
2784 if (swig_module.next != &swig_module) {
2785 ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
2786 #ifdef SWIGRUNTIME_DEBUG
2787 if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
2791 if (type == swig_module.type_initial[i]) {
2792 #ifdef SWIGRUNTIME_DEBUG
2793 printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
2798 /* Check for casting already in the list */
2799 swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
2800 #ifdef SWIGRUNTIME_DEBUG
2801 if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
2803 if (!ocast) ret = 0;
2808 #ifdef SWIGRUNTIME_DEBUG
2809 printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
2812 type->cast->prev = cast;
2813 cast->next = type->cast;
2819 /* Set entry in modules->types array equal to the type */
2820 swig_module.types[i] = type;
2822 swig_module.types[i] = 0;
2824 #ifdef SWIGRUNTIME_DEBUG
2825 printf("**** SWIG_InitializeModule: Cast List ******\n");
2826 for (i = 0; i < swig_module.size; ++i) {
2828 swig_cast_info *cast = swig_module.cast_initial[i];
2829 printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
2830 while (cast->type) {
2831 printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
2835 printf("---- Total casts: %d\n",j);
2837 printf("**** SWIG_InitializeModule: Cast List ******\n");
2841 /* This function will propagate the clientdata field of type to
2842 * any new swig_type_info structures that have been added into the list
2843 * of equivalent types. It is like calling
2844 * SWIG_TypeClientData(type, clientdata) a second time.
2847 SWIG_PropagateClientData(void) {
2849 swig_cast_info *equiv;
2850 static int init_run = 0;
2852 if (init_run) return;
2855 for (i = 0; i < swig_module.size; i++) {
2856 if (swig_module.types[i]->clientdata) {
2857 equiv = swig_module.types[i]->cast;
2859 if (!equiv->converter) {
2860 if (equiv->type && !equiv->type->clientdata)
2861 SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
2863 equiv = equiv->next;
2887 SWIG_InitializeModule(0);
2889 /* Install commands */
2890 for (i = 0; swig_commands[i].name; i++) {
2891 newXS((char*) swig_commands[i].name,swig_commands[i].wrapper, (char*)__FILE__);
2894 /* Install variables */
2895 for (i = 0; swig_variables[i].name; i++) {
2897 sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI);
2898 if (swig_variables[i].type) {
2899 SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0);
2901 sv_setiv(sv,(IV) 0);
2903 swig_create_magic(sv, (char *) swig_variables[i].name, swig_variables[i].set, swig_variables[i].get);
2906 /* Install constant */
2907 for (i = 0; swig_constants[i].type; i++) {
2909 sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI);
2910 switch(swig_constants[i].type) {
2912 sv_setiv(sv, (IV) swig_constants[i].lvalue);
2915 sv_setnv(sv, (double) swig_constants[i].dvalue);
2918 sv_setpv(sv, (char *) swig_constants[i].pvalue);
2921 SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0);
2924 SWIG_MakePackedObj(sv, swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype));