1 /* ---------------------------------------------------------------------------- 2 * This file was automatically generated by SWIG (http://www.swig.org). 3 * Version 1.3.24 4 * 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 * ----------------------------------------------------------------------------- */ 10 11 12 #ifndef SWIG_TEMPLATE_DISAMBIGUATOR 13 # if defined(__SUNPRO_CC) 14 # define SWIG_TEMPLATE_DISAMBIGUATOR template 15 # else 16 # define SWIG_TEMPLATE_DISAMBIGUATOR 17 # endif 18 #endif 19 20 /*********************************************************************** 21 * swigrun.swg 22 * 23 * This file contains generic CAPI SWIG runtime support for pointer 24 * type checking. 25 * 26 ************************************************************************/ 27 28 /* This should only be incremented when either the layout of swig_type_info changes, 29 or for whatever reason, the runtime changes incompatibly */ 30 #define SWIG_RUNTIME_VERSION "1" 31 32 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ 33 #ifdef SWIG_TYPE_TABLE 34 #define SWIG_QUOTE_STRING(x) #x 35 #define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) 36 #define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) 37 #else 38 #define SWIG_TYPE_TABLE_NAME 39 #endif 40 41 #include <string.h> 42 43 #ifndef SWIGINLINE 44 #if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) 45 # define SWIGINLINE inline 46 #else 47 # define SWIGINLINE 48 #endif 49 #endif 50 51 /* 52 You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for 53 creating a static or dynamic library from the swig runtime code. 54 In 99.9% of the cases, swig just needs to declare them as 'static'. 55 56 But only do this if is strictly necessary, ie, if you have problems 57 with your compiler or so. 58 */ 59 #ifndef SWIGRUNTIME 60 #define SWIGRUNTIME static 61 #endif 62 #ifndef SWIGRUNTIMEINLINE 63 #define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE 64 #endif 65 66 #ifdef __cplusplus 67 extern "C" { 68 #endif 69 70 typedef void *(*swig_converter_func)(void *); 71 typedef struct swig_type_info *(*swig_dycast_func)(void **); 72 73 typedef struct swig_type_info { 74 const char *name; 75 swig_converter_func converter; 76 const char *str; 77 void *clientdata; 78 swig_dycast_func dcast; 79 struct swig_type_info *next; 80 struct swig_type_info *prev; 81 } swig_type_info; 82 83 /* 84 Compare two type names skipping the space characters, therefore 85 "char*" == "char *" and "Class<int>" == "Class<int >", etc. 86 87 Return 0 when the two name types are equivalent, as in 88 strncmp, but skipping ' '. 89 */ 90 SWIGRUNTIME int 91 SWIG_TypeNameComp(const char *f1, const char *l1, 92 const char *f2, const char *l2) { 93 for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { 94 while ((*f1 == ' ') && (f1 != l1)) ++f1; 95 while ((*f2 == ' ') && (f2 != l2)) ++f2; 96 if (*f1 != *f2) return *f1 - *f2; 97 } 98 return (l1 - f1) - (l2 - f2); 99 } 100 101 /* 102 Check type equivalence in a name list like <name1>|<name2>|... 103 */ 104 SWIGRUNTIME int 105 SWIG_TypeEquiv(const char *nb, const char *tb) { 106 int equiv = 0; 107 const char* te = tb + strlen(tb); 108 const char* ne = nb; 109 while (!equiv && *ne) { 110 for (nb = ne; *ne; ++ne) { 111 if (*ne == '|') break; 112 } 113 equiv = SWIG_TypeNameComp(nb, ne, tb, te) == 0; 114 if (*ne) ++ne; 115 } 116 return equiv; 117 } 118 119 /* 120 Register a type mapping with the type-checking 121 */ 122 SWIGRUNTIME swig_type_info * 123 SWIG_TypeRegisterTL(swig_type_info **tl, swig_type_info *ti) { 124 swig_type_info *tc, *head, *ret, *next; 125 /* Check to see if this type has already been registered */ 126 tc = *tl; 127 while (tc) { 128 /* check simple type equivalence */ 129 int typeequiv = (strcmp(tc->name, ti->name) == 0); 130 /* check full type equivalence, resolving typedefs */ 131 if (!typeequiv) { 132 /* only if tc is not a typedef (no '|' on it) */ 133 if (tc->str && ti->str && !strstr(tc->str,"|")) { 134 typeequiv = SWIG_TypeEquiv(ti->str,tc->str); 135 } 136 } 137 if (typeequiv) { 138 /* Already exists in the table. Just add additional types to the list */ 139 if (ti->clientdata) tc->clientdata = ti->clientdata; 140 head = tc; 141 next = tc->next; 142 goto l1; 143 } 144 tc = tc->prev; 145 } 146 head = ti; 147 next = 0; 148 149 /* Place in list */ 150 ti->prev = *tl; 151 *tl = ti; 152 153 /* Build linked lists */ 154 l1: 155 ret = head; 156 tc = ti + 1; 157 /* Patch up the rest of the links */ 158 while (tc->name) { 159 head->next = tc; 160 tc->prev = head; 161 head = tc; 162 tc++; 163 } 164 if (next) next->prev = head; 165 head->next = next; 166 167 return ret; 168 } 169 170 /* 171 Check the typename 172 */ 173 SWIGRUNTIME swig_type_info * 174 SWIG_TypeCheck(const char *c, swig_type_info *ty) { 175 swig_type_info *s; 176 if (!ty) return 0; /* Void pointer */ 177 s = ty->next; /* First element always just a name */ 178 do { 179 if (strcmp(s->name,c) == 0) { 180 if (s == ty->next) return s; 181 /* Move s to the top of the linked list */ 182 s->prev->next = s->next; 183 if (s->next) { 184 s->next->prev = s->prev; 185 } 186 /* Insert s as second element in the list */ 187 s->next = ty->next; 188 if (ty->next) ty->next->prev = s; 189 ty->next = s; 190 s->prev = ty; 191 return s; 192 } 193 s = s->next; 194 } while (s && (s != ty->next)); 195 return 0; 196 } 197 198 /* 199 Cast a pointer up an inheritance hierarchy 200 */ 201 SWIGRUNTIMEINLINE void * 202 SWIG_TypeCast(swig_type_info *ty, void *ptr) { 203 return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr); 204 } 205 206 /* 207 Dynamic pointer casting. Down an inheritance hierarchy 208 */ 209 SWIGRUNTIME swig_type_info * 210 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { 211 swig_type_info *lastty = ty; 212 if (!ty || !ty->dcast) return ty; 213 while (ty && (ty->dcast)) { 214 ty = (*ty->dcast)(ptr); 215 if (ty) lastty = ty; 216 } 217 return lastty; 218 } 219 220 /* 221 Return the name associated with this type 222 */ 223 SWIGRUNTIMEINLINE const char * 224 SWIG_TypeName(const swig_type_info *ty) { 225 return ty->name; 226 } 227 228 /* 229 Return the pretty name associated with this type, 230 that is an unmangled type name in a form presentable to the user. 231 */ 232 SWIGRUNTIME const char * 233 SWIG_TypePrettyName(const swig_type_info *type) { 234 /* The "str" field contains the equivalent pretty names of the 235 type, separated by vertical-bar characters. We choose 236 to print the last name, as it is often (?) the most 237 specific. */ 238 if (type->str != NULL) { 239 const char *last_name = type->str; 240 const char *s; 241 for (s = type->str; *s; s++) 242 if (*s == '|') last_name = s+1; 243 return last_name; 244 } 245 else 246 return type->name; 247 } 248 249 /* 250 Search for a swig_type_info structure 251 */ 252 SWIGRUNTIME swig_type_info * 253 SWIG_TypeQueryTL(swig_type_info *tl, const char *name) { 254 swig_type_info *ty = tl; 255 while (ty) { 256 if (ty->str && (SWIG_TypeEquiv(ty->str,name))) return ty; 257 if (ty->name && (strcmp(name,ty->name) == 0)) return ty; 258 ty = ty->prev; 259 } 260 return 0; 261 } 262 263 /* 264 Set the clientdata field for a type 265 */ 266 SWIGRUNTIME void 267 SWIG_TypeClientDataTL(swig_type_info *tl, swig_type_info *ti, void *clientdata) { 268 swig_type_info *tc, *equiv; 269 if (ti->clientdata) return; 270 /* if (ti->clientdata == clientdata) return; */ 271 ti->clientdata = clientdata; 272 equiv = ti->next; 273 while (equiv) { 274 if (!equiv->converter) { 275 tc = tl; 276 while (tc) { 277 if ((strcmp(tc->name, equiv->name) == 0)) 278 SWIG_TypeClientDataTL(tl,tc,clientdata); 279 tc = tc->prev; 280 } 281 } 282 equiv = equiv->next; 283 } 284 } 285 286 /* 287 Pack binary data into a string 288 */ 289 SWIGRUNTIME char * 290 SWIG_PackData(char *c, void *ptr, size_t sz) { 291 static char hex[17] = "0123456789abcdef"; 292 unsigned char *u = (unsigned char *) ptr; 293 const unsigned char *eu = u + sz; 294 register unsigned char uu; 295 for (; u != eu; ++u) { 296 uu = *u; 297 *(c++) = hex[(uu & 0xf0) >> 4]; 298 *(c++) = hex[uu & 0xf]; 299 } 300 return c; 301 } 302 303 /* 304 Unpack binary data from a string 305 */ 306 SWIGRUNTIME const char * 307 SWIG_UnpackData(const char *c, void *ptr, size_t sz) { 308 register unsigned char *u = (unsigned char *) ptr; 309 register const unsigned char *eu = u + sz; 310 for (; u != eu; ++u) { 311 register int d = *(c++); 312 register unsigned char uu = 0; 313 if ((d >= '0') && (d <= '9')) 314 uu = ((d - '0') << 4); 315 else if ((d >= 'a') && (d <= 'f')) 316 uu = ((d - ('a'-10)) << 4); 317 else 318 return (char *) 0; 319 d = *(c++); 320 if ((d >= '0') && (d <= '9')) 321 uu |= (d - '0'); 322 else if ((d >= 'a') && (d <= 'f')) 323 uu |= (d - ('a'-10)); 324 else 325 return (char *) 0; 326 *u = uu; 327 } 328 return c; 329 } 330 331 /* 332 This function will propagate the clientdata field of type to any new 333 swig_type_info structures that have been added into the list of 334 equivalent types. It is like calling SWIG_TypeClientData(type, 335 clientdata) a second time. 336 */ 337 SWIGRUNTIME void 338 SWIG_PropagateClientDataTL(swig_type_info *tl, swig_type_info *type) { 339 swig_type_info *equiv = type->next; 340 swig_type_info *tc; 341 if (!type->clientdata) return; 342 while (equiv) { 343 if (!equiv->converter) { 344 tc = tl; 345 while (tc) { 346 if ((strcmp(tc->name, equiv->name) == 0) && !tc->clientdata) 347 SWIG_TypeClientDataTL(tl,tc, type->clientdata); 348 tc = tc->prev; 349 } 350 } 351 equiv = equiv->next; 352 } 353 } 354 355 /* 356 Pack 'void *' into a string buffer. 357 */ 358 SWIGRUNTIME char * 359 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { 360 char *r = buff; 361 if ((2*sizeof(void *) + 2) > bsz) return 0; 362 *(r++) = '_'; 363 r = SWIG_PackData(r,&ptr,sizeof(void *)); 364 if (strlen(name) + 1 > (bsz - (r - buff))) return 0; 365 strcpy(r,name); 366 return buff; 367 } 368 369 SWIGRUNTIME const char * 370 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { 371 if (*c != '_') { 372 if (strcmp(c,"NULL") == 0) { 373 *ptr = (void *) 0; 374 return name; 375 } else { 376 return 0; 377 } 378 } 379 return SWIG_UnpackData(++c,ptr,sizeof(void *)); 380 } 381 382 SWIGRUNTIME char * 383 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { 384 char *r = buff; 385 size_t lname = (name ? strlen(name) : 0); 386 if ((2*sz + 2 + lname) > bsz) return 0; 387 *(r++) = '_'; 388 r = SWIG_PackData(r,ptr,sz); 389 if (lname) { 390 strncpy(r,name,lname+1); 391 } else { 392 *r = 0; 393 } 394 return buff; 395 } 396 397 SWIGRUNTIME const char * 398 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { 399 if (*c != '_') { 400 if (strcmp(c,"NULL") == 0) { 401 memset(ptr,0,sz); 402 return name; 403 } else { 404 return 0; 405 } 406 } 407 return SWIG_UnpackData(++c,ptr,sz); 408 } 409 410 #ifdef __cplusplus 411 } 412 #endif 413 414 /*********************************************************************** 415 * common.swg 416 * 417 * This file contains generic SWIG runtime support for pointer 418 * type checking as well as a few commonly used macros to control 419 * external linkage. 420 * 421 * Author : David Beazley (beazley (at) cs.uchicago.edu) 422 * 423 * Copyright (c) 1999-2000, The University of Chicago 424 * 425 * This file may be freely redistributed without license or fee provided 426 * this copyright message remains intact. 427 ************************************************************************/ 428 429 430 #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) 431 # if !defined(STATIC_LINKED) 432 # define SWIGEXPORT(a) __declspec(dllexport) a 433 # else 434 # define SWIGEXPORT(a) a 435 # endif 436 #else 437 # define SWIGEXPORT(a) a 438 #endif 439 440 #ifdef __cplusplus 441 extern "C" { 442 #endif 443 444 445 /*************************************************************************/ 446 447 448 /* The static type info list */ 449 450 static swig_type_info *swig_type_list = 0; 451 static swig_type_info **swig_type_list_handle = &swig_type_list; 452 453 454 /* Register a type mapping with the type-checking */ 455 static swig_type_info * 456 SWIG_TypeRegister(swig_type_info *ti) { 457 return SWIG_TypeRegisterTL(swig_type_list_handle, ti); 458 } 459 460 /* Search for a swig_type_info structure */ 461 static swig_type_info * 462 SWIG_TypeQuery(const char *name) { 463 return SWIG_TypeQueryTL(*swig_type_list_handle, name); 464 } 465 466 /* Set the clientdata field for a type */ 467 static void 468 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { 469 SWIG_TypeClientDataTL(*swig_type_list_handle, ti, clientdata); 470 } 471 472 /* This function will propagate the clientdata field of type to 473 * any new swig_type_info structures that have been added into the list 474 * of equivalent types. It is like calling 475 * SWIG_TypeClientData(type, clientdata) a second time. 476 */ 477 static void 478 SWIG_PropagateClientData(swig_type_info *type) { 479 SWIG_PropagateClientDataTL(*swig_type_list_handle, type); 480 } 481 482 #ifdef __cplusplus 483 } 484 #endif 485 486 /* ---------------------------------------------------------------------- -*- c -*- 487 * perl5.swg 488 * 489 * Perl5 runtime library 490 * $Header: /cvsroot/swig/SWIG/Lib/perl5/perlrun.swg,v 1.20 2004/11/29 23:13:57 wuzzeb Exp $ 491 * ----------------------------------------------------------------------------- */ 492 493 #define SWIGPERL 494 #define SWIGPERL5 495 #ifdef __cplusplus 496 /* Needed on some windows machines---since MS plays funny games with the header files under C++ */ 497 #include <math.h> 498 #include <stdlib.h> 499 extern "C" { 500 #endif 501 #include "EXTERN.h" 502 #include "perl.h" 503 #include "XSUB.h" 504 505 /* Get rid of free and malloc defined by perl */ 506 #undef free 507 #undef malloc 508 509 #ifndef pTHX_ 510 #define pTHX_ 511 #endif 512 513 #include <string.h> 514 #ifdef __cplusplus 515 } 516 #endif 517 518 /* Macro to call an XS function */ 519 520 #ifdef PERL_OBJECT 521 # define SWIG_CALLXS(_name) _name(cv,pPerl) 522 #else 523 # ifndef MULTIPLICITY 524 # define SWIG_CALLXS(_name) _name(cv) 525 # else 526 # define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv) 527 # endif 528 #endif 529 530 /* Contract support */ 531 532 #define SWIG_contract_assert(expr,msg) if (!(expr)) { SWIG_croak(msg); } else 533 534 /* Note: SwigMagicFuncHack is a typedef used to get the C++ compiler to just shut up already */ 535 536 #ifdef PERL_OBJECT 537 #define MAGIC_PPERL CPerlObj *pPerl = (CPerlObj *) this; 538 typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *); 539 540 #ifdef __cplusplus 541 extern "C" { 542 #endif 543 typedef int (CPerlObj::*SwigMagicFuncHack)(SV *, MAGIC *); 544 #ifdef __cplusplus 545 } 546 #endif 547 548 #define SWIG_MAGIC(a,b) (SV *a, MAGIC *b) 549 #define SWIGCLASS_STATIC 550 #else 551 #define MAGIC_PPERL 552 #define SWIGCLASS_STATIC static 553 #ifndef MULTIPLICITY 554 #define SWIG_MAGIC(a,b) (SV *a, MAGIC *b) 555 typedef int (*SwigMagicFunc)(SV *, MAGIC *); 556 557 #ifdef __cplusplus 558 extern "C" { 559 #endif 560 typedef int (*SwigMagicFuncHack)(SV *, MAGIC *); 561 #ifdef __cplusplus 562 } 563 #endif 564 565 566 #else 567 #define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b) 568 typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *); 569 #ifdef __cplusplus 570 extern "C" { 571 #endif 572 typedef int (*SwigMagicFuncHack)(struct interpreter *, SV *, MAGIC *); 573 #ifdef __cplusplus 574 } 575 #endif 576 577 #endif 578 #endif 579 580 #if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE) 581 #define PerlIO_exportFILE(fh,fl) (FILE*)(fh) 582 #endif 583 584 /* Modifications for newer Perl 5.005 releases */ 585 586 #if !defined(PERL_REVISION) || ((PERL_REVISION >= 5) && ((PERL_VERSION < 5) || ((PERL_VERSION == 5) && (PERL_SUBVERSION < 50)))) 587 # ifndef PL_sv_yes 588 # define PL_sv_yes sv_yes 589 # endif 590 # ifndef PL_sv_undef 591 # define PL_sv_undef sv_undef 592 # endif 593 # ifndef PL_na 594 # define PL_na na 595 # endif 596 #endif 597 598 #include <stdlib.h> 599 600 #ifdef __cplusplus 601 extern "C" { 602 #endif 603 604 #define SWIG_OWNER 1 605 #define SWIG_SHADOW 2 606 607 /* Common SWIG API */ 608 609 #ifdef PERL_OBJECT 610 # define SWIG_ConvertPtr(obj, pp, type, flags) \ 611 SWIG_Perl_ConvertPtr(pPerl, obj, pp, type, flags) 612 # define SWIG_NewPointerObj(p, type, flags) \ 613 SWIG_Perl_NewPointerObj(pPerl, p, type, flags) 614 # define SWIG_MakePackedObj(sv, p, s, type) \ 615 SWIG_Perl_MakePackedObj(pPerl, sv, p, s, type) 616 # define SWIG_ConvertPacked(obj, p, s, type, flags) \ 617 SWIG_Perl_ConvertPacked(pPerl, obj, p, s, type, flags) 618 619 #else 620 # define SWIG_ConvertPtr(obj, pp, type, flags) \ 621 SWIG_Perl_ConvertPtr(obj, pp, type, flags) 622 # define SWIG_NewPointerObj(p, type, flags) \ 623 SWIG_Perl_NewPointerObj(p, type, flags) 624 # define SWIG_MakePackedObj(sv, p, s, type) \ 625 SWIG_Perl_MakePackedObj(sv, p, s, type ) 626 # define SWIG_ConvertPacked(obj, p, s, type, flags) \ 627 SWIG_Perl_ConvertPacked(obj, p, s, type, flags) 628 #endif 629 630 /* Perl-specific API */ 631 #ifdef PERL_OBJECT 632 # define SWIG_MakePtr(sv, ptr, type, flags) \ 633 SWIG_Perl_MakePtr(pPerl, sv, ptr, type, flags) 634 # define SWIG_SetError(str) \ 635 SWIG_Perl_SetError(pPerl, str) 636 #else 637 # define SWIG_MakePtr(sv, ptr, type, flags) \ 638 SWIG_Perl_MakePtr(sv, ptr, type, flags) 639 # define SWIG_SetError(str) \ 640 SWIG_Perl_SetError(str) 641 # define SWIG_SetErrorSV(str) \ 642 SWIG_Perl_SetErrorSV(str) 643 #endif 644 645 #define SWIG_SetErrorf SWIG_Perl_SetErrorf 646 647 648 #ifdef PERL_OBJECT 649 # define SWIG_MAYBE_PERL_OBJECT CPerlObj *pPerl, 650 #else 651 # define SWIG_MAYBE_PERL_OBJECT 652 #endif 653 654 static swig_type_info ** 655 SWIG_Perl_GetTypeListHandle() { 656 static void *type_pointer = (void *)0; 657 SV *pointer; 658 659 /* first check if pointer already created */ 660 if (!type_pointer) { 661 pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE); 662 if (pointer && SvOK(pointer)) { 663 type_pointer = INT2PTR(swig_type_info **, SvIV(pointer)); 664 } 665 } 666 667 return (swig_type_info **) type_pointer; 668 } 669 670 /* 671 Search for a swig_type_info structure 672 */ 673 SWIGRUNTIMEINLINE swig_type_info * 674 SWIG_Perl_GetTypeList() { 675 swig_type_info **tlh = SWIG_Perl_GetTypeListHandle(); 676 return tlh ? *tlh : (swig_type_info*)0; 677 } 678 679 #define SWIG_Runtime_GetTypeList SWIG_Perl_GetTypeList 680 681 static swig_type_info * 682 SWIG_Perl_TypeCheckRV(SWIG_MAYBE_PERL_OBJECT SV *rv, swig_type_info *ty) { 683 swig_type_info *s; 684 if (!ty) return 0; /* Void pointer */ 685 s = ty->next; /* First element always just a name */ 686 do { 687 if (sv_derived_from(rv, (char *) s->name)) { 688 if (s == ty->next) return s; 689 /* Move s to the top of the linked list */ 690 s->prev->next = s->next; 691 if (s->next) { 692 s->next->prev = s->prev; 693 } 694 /* Insert s as second element in the list */ 695 s->next = ty->next; 696 if (ty->next) ty->next->prev = s; 697 ty->next = s; 698 s->prev = ty; 699 return s; 700 } 701 s = s->next; 702 } while (s && (s != ty->next)); 703 return 0; 704 } 705 706 /* Function for getting a pointer value */ 707 708 static int 709 SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) { 710 swig_type_info *tc; 711 void *voidptr = (void *)0; 712 713 /* If magical, apply more magic */ 714 if (SvGMAGICAL(sv)) 715 mg_get(sv); 716 717 /* Check to see if this is an object */ 718 if (sv_isobject(sv)) { 719 SV *tsv = (SV*) SvRV(sv); 720 IV tmp = 0; 721 if ((SvTYPE(tsv) == SVt_PVHV)) { 722 MAGIC *mg; 723 if (SvMAGICAL(tsv)) { 724 mg = mg_find(tsv,'P'); 725 if (mg) { 726 sv = mg->mg_obj; 727 if (sv_isobject(sv)) { 728 tmp = SvIV((SV*)SvRV(sv)); 729 } 730 } 731 } else { 732 return -1; 733 } 734 } else { 735 tmp = SvIV((SV*)SvRV(sv)); 736 } 737 voidptr = (void *)tmp; 738 if (!_t) { 739 *(ptr) = voidptr; 740 return 0; 741 } 742 } else if (! SvOK(sv)) { /* Check for undef */ 743 *(ptr) = (void *) 0; 744 return 0; 745 } else if (SvTYPE(sv) == SVt_RV) { /* Check for NULL pointer */ 746 *(ptr) = (void *) 0; 747 if (!SvROK(sv)) 748 return 0; 749 else 750 return -1; 751 } else { /* Don't know what it is */ 752 *(ptr) = (void *) 0; 753 return -1; 754 } 755 if (_t) { 756 /* Now see if the types match */ 757 char *_c = HvNAME(SvSTASH(SvRV(sv))); 758 tc = SWIG_TypeCheck(_c,_t); 759 if (!tc) { 760 *ptr = voidptr; 761 return -1; 762 } 763 *ptr = SWIG_TypeCast(tc,voidptr); 764 return 0; 765 } 766 *ptr = voidptr; 767 return 0; 768 } 769 770 static void 771 SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) { 772 if (ptr && (flags & SWIG_SHADOW)) { 773 SV *self; 774 SV *obj=newSV(0); 775 HV *hash=newHV(); 776 HV *stash; 777 sv_setref_pv(obj, (char *) t->name, ptr); 778 stash=SvSTASH(SvRV(obj)); 779 if (flags & SWIG_OWNER) { 780 HV *hv; 781 GV *gv=*(GV**)hv_fetch(stash, "OWNER", 5, TRUE); 782 if (!isGV(gv)) 783 gv_init(gv, stash, "OWNER", 5, FALSE); 784 hv=GvHVn(gv); 785 hv_store_ent(hv, obj, newSViv(1), 0); 786 } 787 sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0); 788 SvREFCNT_dec(obj); 789 self=newRV_noinc((SV *)hash); 790 sv_setsv(sv, self); 791 SvREFCNT_dec((SV *)self); 792 sv_bless(sv, stash); 793 } 794 else { 795 sv_setref_pv(sv, (char *) t->name, ptr); 796 } 797 } 798 799 static SWIGINLINE SV * 800 SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) { 801 SV *result = sv_newmortal(); 802 SWIG_MakePtr(result, ptr, t, flags); 803 return result; 804 } 805 806 static void 807 SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) { 808 char result[1024]; 809 char *r = result; 810 if ((2*sz + 1 + strlen(type->name)) > 1000) return; 811 *(r++) = '_'; 812 r = SWIG_PackData(r,ptr,sz); 813 strcpy(r,type->name); 814 sv_setpv(sv, result); 815 } 816 817 /* Convert a packed value value */ 818 static int 819 SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty, int flags) { 820 swig_type_info *tc; 821 const char *c = 0; 822 823 if ((!obj) || (!SvOK(obj))) return -1; 824 c = SvPV(obj, PL_na); 825 /* Pointer values must start with leading underscore */ 826 if (*c != '_') return -1; 827 c++; 828 c = SWIG_UnpackData(c,ptr,sz); 829 if (ty) { 830 tc = SWIG_TypeCheck(c,ty); 831 if (!tc) return -1; 832 } 833 return 0; 834 } 835 836 static SWIGINLINE void 837 SWIG_Perl_SetError(SWIG_MAYBE_PERL_OBJECT const char *error) { 838 if (error) sv_setpv(perl_get_sv("@", TRUE), error); 839 } 840 841 static SWIGINLINE void 842 SWIG_Perl_SetErrorSV(SWIG_MAYBE_PERL_OBJECT SV *error) { 843 if (error) sv_setsv(perl_get_sv("@", TRUE), error); 844 } 845 846 static void 847 SWIG_Perl_SetErrorf(const char *fmt, ...) { 848 va_list args; 849 va_start(args, fmt); 850 sv_vsetpvfn(perl_get_sv("@", TRUE), fmt, strlen(fmt), &args, Null(SV**), 0, Null(bool*)); 851 va_end(args); 852 } 853 854 /* Macros for low-level exception handling */ 855 #define SWIG_fail goto fail 856 #define SWIG_croak(x) { SWIG_SetError(x); goto fail; } 857 #define SWIG_croakSV(x) { SWIG_SetErrorSV(x); goto fail; } 858 /* most preprocessors do not support vararg macros :-( */ 859 /* #define SWIG_croakf(x...) { SWIG_SetErrorf(x); goto fail; } */ 860 861 862 typedef XS(SwigPerlWrapper); 863 typedef SwigPerlWrapper *SwigPerlWrapperPtr; 864 865 /* Structure for command table */ 866 typedef struct { 867 const char *name; 868 SwigPerlWrapperPtr wrapper; 869 } swig_command_info; 870 871 /* Information for constant table */ 872 873 #define SWIG_INT 1 874 #define SWIG_FLOAT 2 875 #define SWIG_STRING 3 876 #define SWIG_POINTER 4 877 #define SWIG_BINARY 5 878 879 /* Constant information structure */ 880 typedef struct swig_constant_info { 881 int type; 882 const char *name; 883 long lvalue; 884 double dvalue; 885 void *pvalue; 886 swig_type_info **ptype; 887 } swig_constant_info; 888 889 #ifdef __cplusplus 890 } 891 #endif 892 893 /* Structure for variable table */ 894 typedef struct { 895 const char *name; 896 SwigMagicFunc set; 897 SwigMagicFunc get; 898 swig_type_info **type; 899 } swig_variable_info; 900 901 /* Magic variable code */ 902 #ifndef PERL_OBJECT 903 #define swig_create_magic(s,a,b,c) _swig_create_magic(s,a,b,c) 904 #ifndef MULTIPLICITY 905 static void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *)) { 906 #else 907 static void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *)) { 908 #endif 909 #else 910 # define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c) 911 static void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *)) { 912 #endif 913 MAGIC *mg; 914 sv_magic(sv,sv,'U',(char *) name,strlen(name)); 915 mg = mg_find(sv,'U'); 916 mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL)); 917 mg->mg_virtual->svt_get = (SwigMagicFuncHack) get; 918 mg->mg_virtual->svt_set = (SwigMagicFuncHack) set; 919 mg->mg_virtual->svt_len = 0; 920 mg->mg_virtual->svt_clear = 0; 921 mg->mg_virtual->svt_free = 0; 922 } 923 924 925 926 927 928 929 #ifdef do_open 930 #undef do_open 931 #endif 932 #ifdef do_close 933 #undef do_close 934 #endif 935 #ifdef scalar 936 #undef scalar 937 #endif 938 #ifdef list 939 #undef list 940 #endif 941 #ifdef apply 942 #undef apply 943 #endif 944 #ifdef convert 945 #undef convert 946 #endif 947 #ifdef Error 948 #undef Error 949 #endif 950 #ifdef form 951 #undef form 952 #endif 953 #ifdef vform 954 #undef vform 955 #endif 956 #ifdef LABEL 957 #undef LABEL 958 #endif 959 #ifdef METHOD 960 #undef METHOD 961 #endif 962 #ifdef Move 963 #undef Move 964 #endif 965 #ifdef yylex 966 #undef yylex 967 #endif 968 #ifdef yyparse 969 #undef yyparse 970 #endif 971 #ifdef yyerror 972 #undef yyerror 973 #endif 974 #ifdef invert 975 #undef invert 976 #endif 977 #ifdef ref 978 #undef ref 979 #endif 980 #ifdef ENTER 981 #undef ENTER 982 #endif 983 984 985 /* -------- TYPES TABLE (BEGIN) -------- */ 986 987 static swig_type_info *swig_types[1]; 988 989 /* -------- TYPES TABLE (END) -------- */ 990 991 #define SWIG_init boot_DumpRenderTreeSupport 992 993 #define SWIG_name "DumpRenderTreeSupportc::boot_DumpRenderTreeSupport" 994 #define SWIG_prefix "DumpRenderTreeSupportc::" 995 996 #ifdef __cplusplus 997 extern "C" 998 #endif 999 #ifndef PERL_OBJECT 1000 #ifndef MULTIPLICITY 1001 SWIGEXPORT(void) SWIG_init (CV* cv); 1002 #else 1003 SWIGEXPORT(void) SWIG_init (pTHXo_ CV* cv); 1004 #endif 1005 #else 1006 SWIGEXPORT(void) SWIG_init (CV *cv, CPerlObj *); 1007 #endif 1008 1009 int processIsCrashing(int); 1010 #ifdef PERL_OBJECT 1011 #define MAGIC_CLASS _wrap_DumpRenderTreeSupport_var:: 1012 class _wrap_DumpRenderTreeSupport_var : public CPerlObj { 1013 public: 1014 #else 1015 #define MAGIC_CLASS 1016 #endif 1017 SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *sv, MAGIC *mg) { 1018 MAGIC_PPERL 1019 sv = sv; mg = mg; 1020 croak("Value is read-only."); 1021 return 0; 1022 } 1023 1024 1025 #ifdef PERL_OBJECT 1026 }; 1027 #endif 1028 1029 #ifdef __cplusplus 1030 extern "C" { 1031 #endif 1032 XS(_wrap_processIsCrashing) { 1033 { 1034 int arg1 ; 1035 int result; 1036 int argvi = 0; 1037 dXSARGS; 1038 1039 if ((items < 1) || (items > 1)) { 1040 SWIG_croak("Usage: processIsCrashing(pid);"); 1041 } 1042 arg1 = (int) SvIV(ST(0)); 1043 result = (int)processIsCrashing(arg1); 1044 1045 ST(argvi) = sv_newmortal(); 1046 sv_setiv(ST(argvi++), (IV) result); 1047 XSRETURN(argvi); 1048 fail: 1049 ; 1050 } 1051 croak(Nullch); 1052 } 1053 1054 1055 1056 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ 1057 1058 1059 static swig_type_info *swig_types_initial[] = { 1060 0 1061 }; 1062 1063 1064 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ 1065 1066 static swig_constant_info swig_constants[] = { 1067 {0,0,0,0,0,0} 1068 }; 1069 #ifdef __cplusplus 1070 } 1071 #endif 1072 static swig_variable_info swig_variables[] = { 1073 {0,0,0,0} 1074 }; 1075 static swig_command_info swig_commands[] = { 1076 {"DumpRenderTreeSupportc::processIsCrashing", _wrap_processIsCrashing}, 1077 {0,0} 1078 }; 1079 1080 1081 static void SWIG_Perl_SetTypeListHandle(swig_type_info **handle) { 1082 SV *pointer; 1083 1084 /* create a new pointer */ 1085 pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE); 1086 sv_setiv(pointer, PTR2IV(swig_type_list_handle)); 1087 } 1088 1089 static swig_type_info ** 1090 SWIG_Perl_LookupTypePointer(swig_type_info **type_list_handle) { 1091 swig_type_info **type_pointer; 1092 1093 /* first check if module already created */ 1094 type_pointer = SWIG_Perl_GetTypeListHandle(); 1095 if (type_pointer) { 1096 return type_pointer; 1097 } else { 1098 /* create a new module and variable */ 1099 SWIG_Perl_SetTypeListHandle(type_list_handle); 1100 return type_list_handle; 1101 } 1102 } 1103 1104 1105 #ifdef __cplusplus 1106 extern "C" 1107 #endif 1108 1109 XS(SWIG_init) { 1110 dXSARGS; 1111 int i; 1112 static int _init = 0; 1113 if (!_init) { 1114 swig_type_list_handle = SWIG_Perl_LookupTypePointer(swig_type_list_handle); 1115 for (i = 0; swig_types_initial[i]; i++) { 1116 swig_types[i] = SWIG_TypeRegister(swig_types_initial[i]); 1117 } 1118 _init = 1; 1119 } 1120 1121 /* Install commands */ 1122 for (i = 0; swig_commands[i].name; i++) { 1123 newXS((char*) swig_commands[i].name,swig_commands[i].wrapper, (char*)__FILE__); 1124 } 1125 1126 /* Install variables */ 1127 for (i = 0; swig_variables[i].name; i++) { 1128 SV *sv; 1129 sv = perl_get_sv((char*) swig_variables[i].name, TRUE | 0x2); 1130 if (swig_variables[i].type) { 1131 SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0); 1132 } else { 1133 sv_setiv(sv,(IV) 0); 1134 } 1135 swig_create_magic(sv, (char *) swig_variables[i].name, swig_variables[i].set, swig_variables[i].get); 1136 } 1137 1138 /* Install constant */ 1139 for (i = 0; swig_constants[i].type; i++) { 1140 SV *sv; 1141 sv = perl_get_sv((char*)swig_constants[i].name, TRUE | 0x2); 1142 switch(swig_constants[i].type) { 1143 case SWIG_INT: 1144 sv_setiv(sv, (IV) swig_constants[i].lvalue); 1145 break; 1146 case SWIG_FLOAT: 1147 sv_setnv(sv, (double) swig_constants[i].dvalue); 1148 break; 1149 case SWIG_STRING: 1150 sv_setpv(sv, (char *) swig_constants[i].pvalue); 1151 break; 1152 case SWIG_POINTER: 1153 SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0); 1154 break; 1155 case SWIG_BINARY: 1156 SWIG_MakePackedObj(sv, swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype)); 1157 break; 1158 default: 1159 break; 1160 } 1161 SvREADONLY_on(sv); 1162 } 1163 1164 ST(0) = &PL_sv_yes; 1165 XSRETURN(1); 1166 } 1167 1168