1/* ---------------------------------------------------------------------------- 2 * This file was automatically generated by SWIG (http://www.swig.org). 3 * Version 1.3.25 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 * 13 * This section contains generic SWIG labels for method/variable 14 * declarations/attributes, and other compiler dependent labels. 15 * 16 ************************************************************************/ 17 18/* 19 SWIGTEMPLATEDISAMBIGUATOR is needed when wrapping template calls 20 (cwrap.c:Swig_cfunction_call/Swig_cmethod_call), as in 21 22 result = nspace::template function<int >(arg1); 23 result = arg1->template method<int >(arg2); 24 25 SWIGTEMPLATEDISAMBIGUATOR is compiler dependent (common.swg), 26 - SUN Studio requires 'template', 27 - gcc-3.4 forbids the use of 'template'. 28 - gcc-3.2.3 produces internal errors if you use 'template' 29*/ 30#ifndef SWIGTEMPLATEDISAMBIGUATOR 31# if defined(__SUNPRO_CC) 32# define SWIGTEMPLATEDISAMBIGUATOR template 33# else 34# define SWIGTEMPLATEDISAMBIGUATOR 35# endif 36#endif 37 38/* inline attribute */ 39#ifndef SWIGINLINE 40# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) 41# define SWIGINLINE inline 42# else 43# define SWIGINLINE 44# endif 45#endif 46 47/* attritbute passed for some compilers to avoid 'unused' warnings */ 48#ifndef SWIGUNUSED 49# if defined(__GNUC__) || defined(__ICC) 50# define SWIGUNUSED __attribute__ ((unused)) 51# else 52# define SWIGUNUSED 53# endif 54#endif 55 56/* internal SWIG method */ 57#ifndef SWIGINTERN 58# define SWIGINTERN static SWIGUNUSED 59#endif 60 61/* internal inline SWIG method */ 62#ifndef SWIGINTERNINLINE 63# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE 64#endif 65 66/* how we export a method such that it can go in to a shared or dll library */ 67#ifndef SWIGEXPORT 68# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) 69# if defined(_MSC_VER) || defined(__GNUC__) 70# if defined(STATIC_LINKED) 71# define SWIGEXPORT(a) a 72# else 73# define SWIGEXPORT(a) __declspec(dllexport) a 74# endif 75# else 76# if defined(__BORLANDC__) 77# define SWIGEXPORT(a) a _export 78# else 79# define SWIGEXPORT(a) a 80# endif 81# endif 82# else 83# define SWIGEXPORT(a) a 84# endif 85#endif 86 87/*********************************************************************** 88 * swigrun.swg 89 * 90 * This file contains generic CAPI SWIG runtime support for pointer 91 * type checking. 92 * 93 ************************************************************************/ 94 95/* This should only be incremented when either the layout of swig_type_info changes, 96 or for whatever reason, the runtime changes incompatibly */ 97#define SWIG_RUNTIME_VERSION "2" 98 99/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ 100#ifdef SWIG_TYPE_TABLE 101# define SWIG_QUOTE_STRING(x) #x 102# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) 103# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) 104#else 105# define SWIG_TYPE_TABLE_NAME 106#endif 107 108/* 109 You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for 110 creating a static or dynamic library from the swig runtime code. 111 In 99.9% of the cases, swig just needs to declare them as 'static'. 112 113 But only do this if is strictly necessary, ie, if you have problems 114 with your compiler or so. 115*/ 116 117#ifndef SWIGRUNTIME 118# define SWIGRUNTIME SWIGINTERN 119#endif 120 121#ifndef SWIGRUNTIMEINLINE 122# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE 123#endif 124 125#include <string.h> 126 127#ifdef __cplusplus 128extern "C" { 129#endif 130 131typedef void *(*swig_converter_func)(void *); 132typedef struct swig_type_info *(*swig_dycast_func)(void **); 133 134/* Structure to store inforomation on one type */ 135typedef struct swig_type_info { 136 const char *name; /* mangled name of this type */ 137 const char *str; /* human readable name of this type */ 138 swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ 139 struct swig_cast_info *cast; /* linked list of types that can cast into this type */ 140 void *clientdata; /* language specific type data */ 141} swig_type_info; 142 143/* Structure to store a type and conversion function used for casting */ 144typedef struct swig_cast_info { 145 swig_type_info *type; /* pointer to type that is equivalent to this type */ 146 swig_converter_func converter; /* function to cast the void pointers */ 147 struct swig_cast_info *next; /* pointer to next cast in linked list */ 148 struct swig_cast_info *prev; /* pointer to the previous cast */ 149} swig_cast_info; 150 151/* Structure used to store module information 152 * Each module generates one structure like this, and the runtime collects 153 * all of these structures and stores them in a circularly linked list.*/ 154typedef struct swig_module_info { 155 swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ 156 size_t size; /* Number of types in this module */ 157 struct swig_module_info *next; /* Pointer to next element in circularly linked list */ 158 swig_type_info **type_initial; /* Array of initially generated type structures */ 159 swig_cast_info **cast_initial; /* Array of initially generated casting structures */ 160 void *clientdata; /* Language specific module data */ 161} swig_module_info; 162 163 164/* 165 Compare two type names skipping the space characters, therefore 166 "char*" == "char *" and "Class<int>" == "Class<int >", etc. 167 168 Return 0 when the two name types are equivalent, as in 169 strncmp, but skipping ' '. 170*/ 171SWIGRUNTIME int 172SWIG_TypeNameComp(const char *f1, const char *l1, 173 const char *f2, const char *l2) { 174 for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { 175 while ((*f1 == ' ') && (f1 != l1)) ++f1; 176 while ((*f2 == ' ') && (f2 != l2)) ++f2; 177 if (*f1 != *f2) return (int)(*f1 - *f2); 178 } 179 return (l1 - f1) - (l2 - f2); 180} 181 182/* 183 Check type equivalence in a name list like <name1>|<name2>|... 184 Return 0 if not equal, 1 if equal 185*/ 186SWIGRUNTIME int 187SWIG_TypeEquiv(const char *nb, const char *tb) { 188 int equiv = 0; 189 const char* te = tb + strlen(tb); 190 const char* ne = nb; 191 while (!equiv && *ne) { 192 for (nb = ne; *ne; ++ne) { 193 if (*ne == '|') break; 194 } 195 equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; 196 if (*ne) ++ne; 197 } 198 return equiv; 199} 200 201/* 202 Check type equivalence in a name list like <name1>|<name2>|... 203 Return 0 if equal, -1 if nb < tb, 1 if nb > tb 204*/ 205SWIGRUNTIME int 206SWIG_TypeCompare(const char *nb, const char *tb) { 207 int equiv = 0; 208 const char* te = tb + strlen(tb); 209 const char* ne = nb; 210 while (!equiv && *ne) { 211 for (nb = ne; *ne; ++ne) { 212 if (*ne == '|') break; 213 } 214 equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; 215 if (*ne) ++ne; 216 } 217 return equiv; 218} 219 220 221/* think of this as a c++ template<> or a scheme macro */ 222#define SWIG_TypeCheck_Template(comparison, ty) \ 223 if (ty) { \ 224 swig_cast_info *iter = ty->cast; \ 225 while (iter) { \ 226 if (comparison) { \ 227 if (iter == ty->cast) return iter; \ 228 /* Move iter to the top of the linked list */ \ 229 iter->prev->next = iter->next; \ 230 if (iter->next) \ 231 iter->next->prev = iter->prev; \ 232 iter->next = ty->cast; \ 233 iter->prev = 0; \ 234 if (ty->cast) ty->cast->prev = iter; \ 235 ty->cast = iter; \ 236 return iter; \ 237 } \ 238 iter = iter->next; \ 239 } \ 240 } \ 241 return 0 242 243/* 244 Check the typename 245*/ 246SWIGRUNTIME swig_cast_info * 247SWIG_TypeCheck(const char *c, swig_type_info *ty) { 248 SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty); 249} 250 251/* Same as previous function, except strcmp is replaced with a pointer comparison */ 252SWIGRUNTIME swig_cast_info * 253SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { 254 SWIG_TypeCheck_Template(iter->type == from, into); 255} 256 257/* 258 Cast a pointer up an inheritance hierarchy 259*/ 260SWIGRUNTIMEINLINE void * 261SWIG_TypeCast(swig_cast_info *ty, void *ptr) { 262 return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr); 263} 264 265/* 266 Dynamic pointer casting. Down an inheritance hierarchy 267*/ 268SWIGRUNTIME swig_type_info * 269SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { 270 swig_type_info *lastty = ty; 271 if (!ty || !ty->dcast) return ty; 272 while (ty && (ty->dcast)) { 273 ty = (*ty->dcast)(ptr); 274 if (ty) lastty = ty; 275 } 276 return lastty; 277} 278 279/* 280 Return the name associated with this type 281*/ 282SWIGRUNTIMEINLINE const char * 283SWIG_TypeName(const swig_type_info *ty) { 284 return ty->name; 285} 286 287/* 288 Return the pretty name associated with this type, 289 that is an unmangled type name in a form presentable to the user. 290*/ 291SWIGRUNTIME const char * 292SWIG_TypePrettyName(const swig_type_info *type) { 293 /* The "str" field contains the equivalent pretty names of the 294 type, separated by vertical-bar characters. We choose 295 to print the last name, as it is often (?) the most 296 specific. */ 297 if (type->str != NULL) { 298 const char *last_name = type->str; 299 const char *s; 300 for (s = type->str; *s; s++) 301 if (*s == '|') last_name = s+1; 302 return last_name; 303 } 304 else 305 return type->name; 306} 307 308/* 309 Set the clientdata field for a type 310*/ 311SWIGRUNTIME void 312SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { 313 if (!ti->clientdata) { 314 swig_cast_info *cast = ti->cast; 315 /* if (ti->clientdata == clientdata) return; */ 316 ti->clientdata = clientdata; 317 318 while (cast) { 319 if (!cast->converter) 320 SWIG_TypeClientData(cast->type, clientdata); 321 cast = cast->next; 322 } 323 } 324} 325 326/* 327 Search for a swig_type_info structure only by mangled name 328 Search is a O(log #types) 329 330 We start searching at module start, and finish searching when start == end. 331 Note: if start == end at the beginning of the function, we go all the way around 332 the circular list. 333*/ 334SWIGRUNTIME swig_type_info * 335SWIG_MangledTypeQueryModule(swig_module_info *start, 336 swig_module_info *end, 337 const char *name) { 338 swig_module_info *iter = start; 339 do { 340 if (iter->size) { 341 register size_t l = 0; 342 register size_t r = iter->size - 1; 343 do { 344 /* since l+r >= 0, we can (>> 1) instead (/ 2) */ 345 register size_t i = (l + r) >> 1; 346 const char *iname = iter->types[i]->name; 347 if (iname) { 348 register int compare = strcmp(name, iname); 349 if (compare == 0) { 350 return iter->types[i]; 351 } else if (compare < 0) { 352 if (i) { 353 r = i - 1; 354 } else { 355 break; 356 } 357 } else if (compare > 0) { 358 l = i + 1; 359 } 360 } else { 361 break; /* should never happen */ 362 } 363 } while (l <= r); 364 } 365 iter = iter->next; 366 } while (iter != end); 367 return 0; 368} 369 370/* 371 Search for a swig_type_info structure for either a mangled name or a human readable name. 372 It first searches the mangled names of the types, which is a O(log #types) 373 If a type is not found it then searches the human readable names, which is O(#types). 374 375 We start searching at module start, and finish searching when start == end. 376 Note: if start == end at the beginning of the function, we go all the way around 377 the circular list. 378*/ 379SWIGRUNTIME swig_type_info * 380SWIG_TypeQueryModule(swig_module_info *start, 381 swig_module_info *end, 382 const char *name) { 383 /* STEP 1: Search the name field using binary search */ 384 swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); 385 if (ret) { 386 return ret; 387 } else { 388 /* STEP 2: If the type hasn't been found, do a complete search 389 of the str field (the human readable name) */ 390 swig_module_info *iter = start; 391 do { 392 register size_t i = 0; 393 for (; i < iter->size; ++i) { 394 if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) 395 return iter->types[i]; 396 } 397 iter = iter->next; 398 } while (iter != end); 399 } 400 401 /* neither found a match */ 402 return 0; 403} 404 405 406/* 407 Pack binary data into a string 408*/ 409SWIGRUNTIME char * 410SWIG_PackData(char *c, void *ptr, size_t sz) { 411 static const char hex[17] = "0123456789abcdef"; 412 register const unsigned char *u = (unsigned char *) ptr; 413 register const unsigned char *eu = u + sz; 414 for (; u != eu; ++u) { 415 register unsigned char uu = *u; 416 *(c++) = hex[(uu & 0xf0) >> 4]; 417 *(c++) = hex[uu & 0xf]; 418 } 419 return c; 420} 421 422/* 423 Unpack binary data from a string 424*/ 425SWIGRUNTIME const char * 426SWIG_UnpackData(const char *c, void *ptr, size_t sz) { 427 register unsigned char *u = (unsigned char *) ptr; 428 register const unsigned char *eu = u + sz; 429 for (; u != eu; ++u) { 430 register char d = *(c++); 431 register unsigned char uu = 0; 432 if ((d >= '0') && (d <= '9')) 433 uu = ((d - '0') << 4); 434 else if ((d >= 'a') && (d <= 'f')) 435 uu = ((d - ('a'-10)) << 4); 436 else 437 return (char *) 0; 438 d = *(c++); 439 if ((d >= '0') && (d <= '9')) 440 uu |= (d - '0'); 441 else if ((d >= 'a') && (d <= 'f')) 442 uu |= (d - ('a'-10)); 443 else 444 return (char *) 0; 445 *u = uu; 446 } 447 return c; 448} 449 450/* 451 Pack 'void *' into a string buffer. 452*/ 453SWIGRUNTIME char * 454SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { 455 char *r = buff; 456 if ((2*sizeof(void *) + 2) > bsz) return 0; 457 *(r++) = '_'; 458 r = SWIG_PackData(r,&ptr,sizeof(void *)); 459 if (strlen(name) + 1 > (bsz - (r - buff))) return 0; 460 strcpy(r,name); 461 return buff; 462} 463 464SWIGRUNTIME const char * 465SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { 466 if (*c != '_') { 467 if (strcmp(c,"NULL") == 0) { 468 *ptr = (void *) 0; 469 return name; 470 } else { 471 return 0; 472 } 473 } 474 return SWIG_UnpackData(++c,ptr,sizeof(void *)); 475} 476 477SWIGRUNTIME char * 478SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { 479 char *r = buff; 480 size_t lname = (name ? strlen(name) : 0); 481 if ((2*sz + 2 + lname) > bsz) return 0; 482 *(r++) = '_'; 483 r = SWIG_PackData(r,ptr,sz); 484 if (lname) { 485 strncpy(r,name,lname+1); 486 } else { 487 *r = 0; 488 } 489 return buff; 490} 491 492SWIGRUNTIME const char * 493SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { 494 if (*c != '_') { 495 if (strcmp(c,"NULL") == 0) { 496 memset(ptr,0,sz); 497 return name; 498 } else { 499 return 0; 500 } 501 } 502 return SWIG_UnpackData(++c,ptr,sz); 503} 504 505#ifdef __cplusplus 506} 507#endif 508 509/* 510 * $Header: /cvsroot/swig/SWIG/Lib/tcl/swigtcl8.swg,v 1.25 2005/02/01 00:08:20 wuzzeb Exp $ 511 * 512 * swigtcl8.swg 513 */ 514 515#include <tcl.h> 516#include <stdlib.h> 517#include <stdarg.h> 518#include <ctype.h> 519 520#ifdef __cplusplus 521extern "C" { 522#endif 523 524/* Constant table */ 525 526#define SWIG_TCL_INT 1 527#define SWIG_TCL_FLOAT 2 528#define SWIG_TCL_STRING 3 529#define SWIG_TCL_POINTER 4 530#define SWIG_TCL_BINARY 5 531 532/* Flags for pointer conversion */ 533#define SWIG_POINTER_EXCEPTION 0x1 534#define SWIG_POINTER_DISOWN 0x2 535 536/* Swig fail macro */ 537 538#define SWIG_fail goto fail 539 540/* Constant information structure */ 541typedef struct swig_const_info { 542 int type; 543 char *name; 544 long lvalue; 545 double dvalue; 546 void *pvalue; 547 swig_type_info **ptype; 548} swig_const_info; 549 550typedef int (*swig_wrapper)(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []); 551typedef int (*swig_wrapper_func)(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []); 552typedef char *(*swig_variable_func)(ClientData, Tcl_Interp *, char *, char *, int); 553typedef void (*swig_delete_func)(ClientData); 554 555typedef struct swig_method { 556 const char *name; 557 swig_wrapper method; 558} swig_method; 559 560typedef struct swig_attribute { 561 const char *name; 562 swig_wrapper getmethod; 563 swig_wrapper setmethod; 564} swig_attribute; 565 566typedef struct swig_class { 567 const char *name; 568 swig_type_info **type; 569 swig_wrapper constructor; 570 void (*destructor)(void *); 571 swig_method *methods; 572 swig_attribute *attributes; 573 struct swig_class **bases; 574 char **base_names; 575 swig_module_info *module; 576} swig_class; 577 578typedef struct swig_instance { 579 Tcl_Obj *thisptr; 580 void *thisvalue; 581 swig_class *classptr; 582 int destroy; 583 Tcl_Command cmdtok; 584} swig_instance; 585 586#define SWIG_NewPointerObj(ptr, type, flags) \ 587 SWIG_Tcl_NewPointerObj(ptr, type, flags) 588#define SWIG_ConvertPtr(oc, ptr, ty, flags) \ 589 SWIG_Tcl_ConvertPtr(interp, oc, ptr, ty, flags) 590#define SWIG_ConvertPtrFromString(c, ptr, ty, flags) \ 591 SWIG_Tcl_ConvertPtrFromString(interp, c, ptr, ty, flags) 592#define SWIG_ConvertPacked(obj, ptr, sz, ty, flags) \ 593 SWIG_Tcl_ConvertPacked(interp, obj, ptr, sz, ty, flags) 594#define SWIG_MakePtr(c, ptr, ty, flags) \ 595 SWIG_Tcl_MakePtr(c, ptr, ty, flags) 596#define SWIG_NewPackedObj(ptr, sz, type, flags) \ 597 SWIG_Tcl_NewPackedObj(ptr, sz, type, flags) 598#define SWIG_GetArgs SWIG_Tcl_GetArgs 599#define SWIG_PointerTypeFromString(c) \ 600 SWIG_Tcl_PointerTypeFromString(c) 601#define SWIG_Acquire(ptr) \ 602 SWIG_Tcl_Acquire(ptr) 603#define SWIG_Disown(ptr) \ 604 SWIG_Tcl_Disown(ptr) 605#define SWIG_Thisown(ptr) \ 606 SWIG_Tcl_Thisown(ptr) 607#define SWIG_InstallConstants(interp, constants) \ 608 SWIG_Tcl_InstallConstants(interp, constants) 609#define SWIG_GetConstant(key) \ 610 SWIG_Tcl_GetConstant(key) 611#define SWIG_NewInstanceObj(thisvalue, type, flags) \ 612 SWIG_Tcl_NewInstanceObj(interp, thisvalue, type, flags) 613#define SWIG_ObjectConstructor SWIG_Tcl_ObjectConstructor 614#define SWIG_MethodCommand SWIG_Tcl_MethodCommand 615#define SWIG_ObjectDelete SWIG_Tcl_ObjectDelete 616 617/* Runtime API */ 618#define SWIG_GetModule(clientdata) SWIG_Tcl_GetModule((Tcl_Interp *) (clientdata)) 619#define SWIG_SetModule(clientdata, pointer) SWIG_Tcl_SetModule((Tcl_Interp *) (clientdata), pointer) 620#define SWIG_MODULE_CLIENTDATA_TYPE Tcl_Interp * 621 622/* Object support */ 623static Tcl_HashTable swigobjectTable; 624static int swigobjectTableinit = 0; 625 626/* Acquire ownership of a pointer */ 627static void 628SWIG_Tcl_Acquire(void *ptr) { 629 Tcl_HashEntry *entryPtr; 630 int newobj; 631 if (!swigobjectTableinit) { 632 Tcl_InitHashTable(&swigobjectTable, TCL_ONE_WORD_KEYS); 633 swigobjectTableinit = 1; 634 } 635 entryPtr = Tcl_CreateHashEntry(&swigobjectTable, (char *) ptr, &newobj); 636} 637 638/* Disown a pointer. Returns 1 if we owned it to begin with */ 639static int 640SWIG_Tcl_Disown(void *ptr) { 641 Tcl_HashEntry *entryPtr; 642 if (!swigobjectTableinit) return 0; 643 entryPtr = Tcl_FindHashEntry(&swigobjectTable, (char *) ptr); 644 if (entryPtr) { 645 Tcl_DeleteHashEntry(entryPtr); 646 return 1; 647 } 648 return 0; 649} 650 651static int 652SWIG_Tcl_Thisown(void *ptr) { 653 if (!swigobjectTableinit) return 0; 654 if (Tcl_FindHashEntry(&swigobjectTable, (char *) ptr)) { 655 return 1; 656 } 657 return 0; 658} 659 660/* Convert a pointer value */ 661static int 662SWIG_Tcl_ConvertPtrFromString(Tcl_Interp *interp, const char *c, void **ptr, swig_type_info *ty, int flags) { 663 swig_cast_info *tc; 664 /* Pointer values must start with leading underscore */ 665 while (*c != '_') { 666 *ptr = (void *) 0; 667 if (strcmp(c,"NULL") == 0) return TCL_OK; 668 /* Hmmm. It could be an object name. */ 669 if (Tcl_VarEval(interp,c," cget -this", (char *) NULL) == TCL_OK) { 670 Tcl_Obj *result = Tcl_GetObjResult(interp); 671 c = Tcl_GetStringFromObj(result, NULL); 672 continue; 673 } 674 Tcl_ResetResult(interp); 675 if (flags & SWIG_POINTER_EXCEPTION) 676 Tcl_SetResult(interp, (char *) "Type error. Expected a pointer", TCL_STATIC); 677 return TCL_ERROR; 678 } 679 c++; 680 c = SWIG_UnpackData(c,ptr,sizeof(void *)); 681 if (ty) { 682 tc = SWIG_TypeCheck(c,ty); 683 if ((!tc) && (flags & SWIG_POINTER_EXCEPTION)) { 684 Tcl_SetResult(interp, (char *) "Type error. Expected ", TCL_STATIC); 685 Tcl_AppendElement(interp, (char *) ty->name); 686 return TCL_ERROR; 687 } else if (!tc) { 688 Tcl_ResetResult(interp); 689 return TCL_ERROR; 690 } 691 if (flags & SWIG_POINTER_DISOWN) { 692 SWIG_Disown((void *) *ptr); 693 } 694 *ptr = SWIG_TypeCast(tc,(void *) *ptr); 695 } 696 return TCL_OK; 697} 698 699/* Convert a pointer value */ 700static SWIGINLINE int 701SWIG_Tcl_ConvertPtr(Tcl_Interp *interp, Tcl_Obj *oc, void **ptr, swig_type_info *ty, int flags) { 702 return SWIG_Tcl_ConvertPtrFromString(interp, Tcl_GetStringFromObj(oc,NULL), ptr, ty, flags); 703} 704 705/* Convert a pointer value */ 706static char * 707SWIG_Tcl_PointerTypeFromString(char *c) { 708 char d; 709 /* Pointer values must start with leading underscore. NULL has no type */ 710 if (*c != '_') { 711 return 0; 712 } 713 c++; 714 /* Extract hex value from pointer */ 715 while ((d = *c)) { 716 if (!(((d >= '0') && (d <= '9')) || ((d >= 'a') && (d <= 'f')))) break; 717 c++; 718 } 719 return c; 720} 721 722/* Convert a packed value value */ 723static int 724SWIG_Tcl_ConvertPacked(Tcl_Interp *interp, Tcl_Obj *obj, void *ptr, int sz, swig_type_info *ty, int flags) { 725 swig_cast_info *tc; 726 const char *c; 727 728 if (!obj) goto type_error; 729 c = Tcl_GetStringFromObj(obj,NULL); 730 /* Pointer values must start with leading underscore */ 731 if (*c != '_') goto type_error; 732 c++; 733 c = SWIG_UnpackData(c,ptr,sz); 734 if (ty) { 735 tc = SWIG_TypeCheck(c,ty); 736 if (!tc) goto type_error; 737 } 738 return TCL_OK; 739 740type_error: 741 742 if (flags) { 743 if (ty) { 744 Tcl_SetResult(interp, (char *) "Type error. Expected ", TCL_STATIC); 745 Tcl_AppendElement(interp, (char *) ty->name); 746 return TCL_ERROR; 747 } else { 748 Tcl_SetResult(interp, (char *) "Expected packed data.", TCL_STATIC); 749 return TCL_ERROR; 750 } 751 } 752 return TCL_ERROR; 753} 754 755 756/* Take a pointer and convert it to a string */ 757static void 758SWIG_Tcl_MakePtr(char *c, void *ptr, swig_type_info *ty, int flags) { 759 if (ptr) { 760 *(c++) = '_'; 761 c = SWIG_PackData(c,&ptr,sizeof(void *)); 762 strcpy(c,ty->name); 763 } else { 764 strcpy(c,(char *)"NULL"); 765 } 766 flags = 0; 767} 768 769/* Create a new pointer object */ 770static SWIGINLINE Tcl_Obj * 771SWIG_Tcl_NewPointerObj(void *ptr, swig_type_info *type, int flags) { 772 Tcl_Obj *robj; 773 char result[512]; 774 SWIG_MakePtr(result,ptr,type,flags); 775 robj = Tcl_NewStringObj(result,-1); 776 return robj; 777} 778 779static Tcl_Obj * 780SWIG_Tcl_NewPackedObj(void *ptr, int sz, swig_type_info *type, int flags) { 781 char result[1024]; 782 char *r = result; 783 if ((2*sz + 1 + strlen(type->name)) > 1000) return 0; 784 *(r++) = '_'; 785 r = SWIG_PackData(r,ptr,sz); 786 strcpy(r,type->name); 787 flags = 0; 788 return Tcl_NewStringObj(result,-1); 789} 790 791static Tcl_HashTable swigconstTable; 792static int swigconstTableinit = 0; 793 794/* Install Constants */ 795static void 796SWIG_Tcl_InstallConstants(Tcl_Interp *interp, swig_const_info constants[]) { 797 int i; 798 Tcl_Obj *obj; 799 Tcl_HashEntry *entryPtr; 800 int newobj; 801 802 if (!swigconstTableinit) { 803 Tcl_InitHashTable(&swigconstTable, TCL_STRING_KEYS); 804 swigconstTableinit = 1; 805 } 806 for (i = 0; constants[i].type; i++) { 807 switch(constants[i].type) { 808 case SWIG_TCL_INT: 809 obj = Tcl_NewIntObj(constants[i].lvalue); 810 break; 811 case SWIG_TCL_FLOAT: 812 obj = Tcl_NewDoubleObj(constants[i].dvalue); 813 break; 814 case SWIG_TCL_STRING: 815 obj = Tcl_NewStringObj((char *) constants[i].pvalue,-1); 816 break; 817 case SWIG_TCL_POINTER: 818 obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); 819 break; 820 case SWIG_TCL_BINARY: 821 obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype),0); 822 break; 823 default: 824 obj = 0; 825 break; 826 } 827 if (obj) { 828 Tcl_ObjSetVar2(interp,Tcl_NewStringObj(constants[i].name,-1), NULL, obj, TCL_GLOBAL_ONLY); 829 entryPtr = Tcl_CreateHashEntry(&swigconstTable, constants[i].name, &newobj); 830 Tcl_SetHashValue(entryPtr, (ClientData) obj); 831 } 832 } 833} 834 835static Tcl_Obj * 836SWIG_Tcl_GetConstant(const char *key) { 837 Tcl_HashEntry *entryPtr; 838 if (!swigconstTableinit) return 0; 839 entryPtr = Tcl_FindHashEntry(&swigconstTable, key); 840 if (entryPtr) { 841 return (Tcl_Obj *) Tcl_GetHashValue(entryPtr); 842 } 843 printf("Searching %s\n", key); 844 return 0; 845} 846 847/* Get arguments */ 848static int 849SWIG_Tcl_GetArgs(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], const char *fmt, ...) { 850 int argno = 0, opt = 0; 851 long tempi; 852 double tempd; 853 const char *c; 854 va_list ap; 855 void *vptr; 856 Tcl_Obj *obj = 0; 857 swig_type_info *ty; 858 859 va_start(ap,fmt); 860 for (c = fmt; (*c && (*c != ':') && (*c != ';')); c++,argno++) { 861 if (*c == '|') { 862 opt = 1; 863 c++; 864 } 865 if (argno >= (objc-1)) { 866 if (!opt) { 867 Tcl_SetResult(interp, (char *) "Wrong # args. ", TCL_STATIC); 868 goto argerror; 869 } else { 870 va_end(ap); 871 return TCL_OK; 872 } 873 } 874 875 vptr = va_arg(ap,void *); 876 if (vptr) { 877 if (isupper(*c)) { 878 obj = SWIG_GetConstant(Tcl_GetStringFromObj(objv[argno+1],0)); 879 if (!obj) obj = objv[argno+1]; 880 } else { 881 obj = objv[argno+1]; 882 } 883 switch(*c) { 884 case 'i': case 'I': 885 case 'l': case 'L': 886 case 'h': case 'H': 887 case 'b': case 'B': 888 if (Tcl_GetLongFromObj(interp,obj,&tempi) != TCL_OK) goto argerror; 889 if ((*c == 'i') || (*c == 'I')) *((int *)vptr) = (int)tempi; 890 else if ((*c == 'l') || (*c == 'L')) *((long *)vptr) = (long)tempi; 891 else if ((*c == 'h') || (*c == 'H')) *((short*)vptr) = (short)tempi; 892 else if ((*c == 'b') || (*c == 'B')) *((unsigned char *)vptr) = (unsigned char)tempi; 893 break; 894 case 'f': case 'F': 895 case 'd': case 'D': 896 if (Tcl_GetDoubleFromObj(interp,obj,&tempd) != TCL_OK) goto argerror; 897 if ((*c == 'f') || (*c == 'F')) *((float *) vptr) = (float)tempd; 898 else if ((*c == 'd') || (*c == 'D')) *((double*) vptr) = tempd; 899 break; 900 case 's': case 'S': 901 if (*(c+1) == '#') { 902 int *vlptr = (int *) va_arg(ap, void *); 903 *((char **) vptr) = Tcl_GetStringFromObj(obj, vlptr); 904 c++; 905 } else { 906 *((char **)vptr) = Tcl_GetStringFromObj(obj,NULL); 907 } 908 break; 909 case 'c': case 'C': 910 *((char *)vptr) = *(Tcl_GetStringFromObj(obj,NULL)); 911 break; 912 case 'p': case 'P': 913 ty = (swig_type_info *) va_arg(ap, void *); 914 if (SWIG_Tcl_ConvertPtr(interp, obj, (void **) vptr, ty, SWIG_POINTER_EXCEPTION) == TCL_ERROR) goto argerror; 915 break; 916 case 'o': case 'O': 917 *((Tcl_Obj **)vptr) = objv[argno+1]; 918 break; 919 default: 920 break; 921 } 922 } 923 } 924 925 if ((*c != ';') && ((objc-1) > argno)) { 926 Tcl_SetResult(interp, (char *) "Wrong # args.", TCL_STATIC); 927 goto argerror; 928 } 929 va_end(ap); 930 return TCL_OK; 931 932 argerror: 933 { 934 char temp[32]; 935 sprintf(temp,"%d", argno+1); 936 c = strchr(fmt,':'); 937 if (!c) c = strchr(fmt,';'); 938 if (!c) c = (char *)""; 939 Tcl_AppendResult(interp,c," argument ", temp, NULL); 940 va_end(ap); 941 return TCL_ERROR; 942 } 943} 944 945static void 946SWIG_Tcl_ObjectDelete(ClientData clientData) { 947 swig_instance *si = (swig_instance *) clientData; 948 if ((si) && (si->destroy) && (SWIG_Disown(si->thisvalue))) { 949 if (si->classptr->destructor) { 950 (si->classptr->destructor)(si->thisvalue); 951 } 952 } 953 Tcl_DecrRefCount(si->thisptr); 954 free(si); 955} 956 957/* Function to invoke object methods given an instance */ 958static int 959SWIG_Tcl_MethodCommand(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST _objv[]) { 960 char *method, *attrname; 961 swig_instance *inst = (swig_instance *) clientData; 962 swig_method *meth; 963 swig_attribute *attr; 964 Tcl_Obj *oldarg; 965 Tcl_Obj **objv; 966 int rcode; 967 swig_class *cls; 968 swig_class *cls_stack[64]; 969 int cls_stack_bi[64]; 970 int cls_stack_top = 0; 971 int numconf = 2; 972 int bi; 973 974 objv = (Tcl_Obj **) _objv; 975 if (objc < 2) { 976 Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC); 977 return TCL_ERROR; 978 } 979 method = Tcl_GetStringFromObj(objv[1],NULL); 980 if (strcmp(method,"-acquire") == 0) { 981 inst->destroy = 1; 982 SWIG_Acquire(inst->thisvalue); 983 return TCL_OK; 984 } 985 if (strcmp(method,"-disown") == 0) { 986 if (inst->destroy) { 987 SWIG_Disown(inst->thisvalue); 988 } 989 inst->destroy = 0; 990 return TCL_OK; 991 } 992 if (strcmp(method,"-delete") == 0) { 993 Tcl_DeleteCommandFromToken(interp,inst->cmdtok); 994 return TCL_OK; 995 } 996 cls_stack[cls_stack_top] = inst->classptr; 997 cls_stack_bi[cls_stack_top] = -1; 998 cls = inst->classptr; 999 while (1) { 1000 bi = cls_stack_bi[cls_stack_top]; 1001 cls = cls_stack[cls_stack_top]; 1002 if (bi != -1) { 1003 if (!cls->bases[bi] && cls->base_names[bi]) { 1004 /* lookup and cache the base class */ 1005 swig_type_info *info = SWIG_TypeQueryModule(cls->module, cls->module, cls->base_names[bi]); 1006 if (info) cls->bases[bi] = (swig_class *) info->clientdata; 1007 } 1008 cls = cls->bases[bi]; 1009 if (cls) { 1010 cls_stack_bi[cls_stack_top]++; 1011 cls_stack_top++; 1012 cls_stack[cls_stack_top] = cls; 1013 cls_stack_bi[cls_stack_top] = -1; 1014 continue; 1015 } 1016 } 1017 if (!cls) { 1018 cls_stack_top--; 1019 if (cls_stack_top < 0) break; 1020 else continue; 1021 } 1022 cls_stack_bi[cls_stack_top]++; 1023 1024 meth = cls->methods; 1025 /* Check for methods */ 1026 while (meth && meth->name) { 1027 if (strcmp(meth->name,method) == 0) { 1028 oldarg = objv[1]; 1029 objv[1] = inst->thisptr; 1030 Tcl_IncrRefCount(inst->thisptr); 1031 rcode = (*meth->method)(clientData,interp,objc,objv); 1032 objv[1] = oldarg; 1033 Tcl_DecrRefCount(inst->thisptr); 1034 return rcode; 1035 } 1036 meth++; 1037 } 1038 /* Check class methods for a match */ 1039 if (strcmp(method,"cget") == 0) { 1040 if (objc < 3) { 1041 Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC); 1042 return TCL_ERROR; 1043 } 1044 attrname = Tcl_GetStringFromObj(objv[2],NULL); 1045 attr = cls->attributes; 1046 while (attr && attr->name) { 1047 if ((strcmp(attr->name, attrname) == 0) && (attr->getmethod)) { 1048 oldarg = objv[1]; 1049 objv[1] = inst->thisptr; 1050 Tcl_IncrRefCount(inst->thisptr); 1051 rcode = (*attr->getmethod)(clientData,interp,2, objv); 1052 objv[1] = oldarg; 1053 Tcl_DecrRefCount(inst->thisptr); 1054 return rcode; 1055 } 1056 attr++; 1057 } 1058 if (strcmp(attrname, "-this") == 0) { 1059 Tcl_SetObjResult(interp, Tcl_DuplicateObj(inst->thisptr)); 1060 return TCL_OK; 1061 } 1062 if (strcmp(attrname, "-thisown") == 0) { 1063 if (SWIG_Thisown(inst->thisvalue)) { 1064 Tcl_SetResult(interp,(char*)"1",TCL_STATIC); 1065 } else { 1066 Tcl_SetResult(interp,(char*)"0",TCL_STATIC); 1067 } 1068 return TCL_OK; 1069 } 1070 } else if (strcmp(method, "configure") == 0) { 1071 int i; 1072 if (objc < 4) { 1073 Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC); 1074 return TCL_ERROR; 1075 } 1076 i = 2; 1077 while (i < objc) { 1078 attrname = Tcl_GetStringFromObj(objv[i],NULL); 1079 attr = cls->attributes; 1080 while (attr && attr->name) { 1081 if ((strcmp(attr->name, attrname) == 0) && (attr->setmethod)) { 1082 oldarg = objv[i]; 1083 objv[i] = inst->thisptr; 1084 Tcl_IncrRefCount(inst->thisptr); 1085 rcode = (*attr->setmethod)(clientData,interp,3, &objv[i-1]); 1086 objv[i] = oldarg; 1087 Tcl_DecrRefCount(inst->thisptr); 1088 if (rcode != TCL_OK) return rcode; 1089 numconf += 2; 1090 } 1091 attr++; 1092 } 1093 i+=2; 1094 } 1095 } 1096 } 1097 if (strcmp(method,"configure") == 0) { 1098 if (numconf >= objc) { 1099 return TCL_OK; 1100 } else { 1101 Tcl_SetResult(interp,(char *) "Invalid attribute name.", TCL_STATIC); 1102 return TCL_ERROR; 1103 } 1104 } 1105 if (strcmp(method,"cget") == 0) { 1106 Tcl_SetResult(interp,(char *) "Invalid attribute name.", TCL_STATIC); 1107 return TCL_ERROR; 1108 } 1109 1110 Tcl_SetResult(interp, (char *) "Invalid method. Must be one of: configure cget -acquire -disown -delete", TCL_STATIC); 1111 cls = inst->classptr; 1112 bi = 0; 1113 while (cls) { 1114 meth = cls->methods; 1115 while (meth && meth->name) { 1116 char *cr = (char *) Tcl_GetStringResult(interp); 1117 if (!strstr(strchr(cr,':'), meth->name)) 1118 Tcl_AppendElement(interp, (char *) meth->name); 1119 meth++; 1120 } 1121 cls = inst->classptr->bases[bi++]; 1122 } 1123 return TCL_ERROR; 1124} 1125 1126/* Function to create objects */ 1127static int 1128SWIG_Tcl_ObjectConstructor(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1129 Tcl_Obj *newObj = 0; 1130 void *thisvalue = 0; 1131 swig_instance *newinst = 0; 1132 swig_class *classptr = (swig_class *) clientData; 1133 swig_wrapper cons = 0; 1134 char *name = 0; 1135 int firstarg = 0; 1136 int thisarg = 0; 1137 int destroy = 1; 1138 1139 if (!classptr) { 1140 Tcl_SetResult(interp, (char *) "swig: internal runtime error. No class object defined.", TCL_STATIC); 1141 return TCL_ERROR; 1142 } 1143 cons = classptr->constructor; 1144 if (objc > 1) { 1145 char *s = Tcl_GetStringFromObj(objv[1],NULL); 1146 if (strcmp(s,"-this") == 0) { 1147 thisarg = 2; 1148 cons = 0; 1149 } else if (strcmp(s,"-args") == 0) { 1150 firstarg = 1; 1151 } else if (objc == 2) { 1152 firstarg = 1; 1153 name = s; 1154 } else if (objc >= 3) { 1155 char *s1; 1156 name = s; 1157 s1 = Tcl_GetStringFromObj(objv[2],NULL); 1158 if (strcmp(s1,"-this") == 0) { 1159 thisarg = 3; 1160 cons = 0; 1161 } else { 1162 firstarg = 1; 1163 } 1164 } 1165 } 1166 if (cons) { 1167 int result; 1168 result = (*cons)(0, interp, objc-firstarg, &objv[firstarg]); 1169 if (result != TCL_OK) { 1170 return result; 1171 } 1172 newObj = Tcl_DuplicateObj(Tcl_GetObjResult(interp)); 1173 if (!name) name = Tcl_GetStringFromObj(newObj,NULL); 1174 } else if (thisarg > 0) { 1175 if (thisarg < objc) { 1176 destroy = 0; 1177 newObj = Tcl_DuplicateObj(objv[thisarg]); 1178 if (!name) name = Tcl_GetStringFromObj(newObj,NULL); 1179 } else { 1180 Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC); 1181 return TCL_ERROR; 1182 } 1183 } else { 1184 Tcl_SetResult(interp, (char *) "No constructor available.", TCL_STATIC); 1185 return TCL_ERROR; 1186 } 1187 if (SWIG_Tcl_ConvertPtr(interp,newObj, (void **) &thisvalue, *(classptr->type), SWIG_POINTER_EXCEPTION) == TCL_ERROR) { 1188 Tcl_DecrRefCount(newObj); 1189 return TCL_ERROR; 1190 } 1191 newinst = (swig_instance *) malloc(sizeof(swig_instance)); 1192 newinst->thisptr = newObj; 1193 Tcl_IncrRefCount(newObj); 1194 newinst->thisvalue = thisvalue; 1195 newinst->classptr = classptr; 1196 newinst->destroy = destroy; 1197 if (destroy) { 1198 SWIG_Acquire(thisvalue); 1199 } 1200 newinst->cmdtok = Tcl_CreateObjCommand(interp,name, (swig_wrapper) SWIG_MethodCommand, (ClientData) newinst, (swig_delete_func) SWIG_ObjectDelete); 1201 return TCL_OK; 1202} 1203 1204 1205/* This function takes the current result and turns it into an object command */ 1206static Tcl_Obj * 1207SWIG_Tcl_NewInstanceObj(Tcl_Interp *interp, void *thisvalue, swig_type_info *type, int flags) { 1208 Tcl_Obj *robj = SWIG_NewPointerObj(thisvalue, type,0); 1209 /* Check to see if this pointer belongs to a class or not */ 1210 if ((type->clientdata) && (interp)) { 1211 Tcl_CmdInfo ci; 1212 char *name; 1213 name = Tcl_GetStringFromObj(robj,NULL); 1214 if (!Tcl_GetCommandInfo(interp,name, &ci) || (flags)) { 1215 swig_instance *newinst = (swig_instance *) malloc(sizeof(swig_instance)); 1216 newinst->thisptr = Tcl_DuplicateObj(robj); 1217 Tcl_IncrRefCount(newinst->thisptr); 1218 newinst->thisvalue = thisvalue; 1219 newinst->classptr = (swig_class *) type->clientdata; 1220 newinst->destroy = flags; 1221 newinst->cmdtok = Tcl_CreateObjCommand(interp, Tcl_GetStringFromObj(robj,NULL), (swig_wrapper_func) SWIG_MethodCommand, (ClientData) newinst, (swig_delete_func) SWIG_ObjectDelete); 1222 if (flags) { 1223 SWIG_Acquire(thisvalue); 1224 } 1225 } 1226 } 1227 return robj; 1228} 1229 1230/* Structure for command table */ 1231typedef struct { 1232 const char *name; 1233 int (*wrapper)(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []); 1234 ClientData clientdata; 1235} swig_command_info; 1236 1237/* Structure for variable linking table */ 1238typedef struct { 1239 const char *name; 1240 void *addr; 1241 char * (*get)(ClientData, Tcl_Interp *, char *, char *, int); 1242 char * (*set)(ClientData, Tcl_Interp *, char *, char *, int); 1243} swig_var_info; 1244 1245 1246/* Contract support */ 1247 1248#define SWIG_contract_assert(expr, msg) if (!(expr)) { Tcl_SetResult(interp, (char *) msg, TCL_STATIC ); goto fail; } else 1249 1250static swig_module_info * 1251SWIG_Tcl_GetModule(Tcl_Interp *interp) { 1252 char *data; 1253 swig_module_info *ret = 0; 1254 1255 /* first check if pointer already created */ 1256 data = (char *) Tcl_GetVar(interp, "swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TCL_GLOBAL_ONLY); 1257 if (data) { 1258 SWIG_UnpackData(data, &ret, sizeof(swig_type_info **)); 1259 } 1260 1261 return ret; 1262} 1263 1264static void 1265SWIG_Tcl_SetModule(Tcl_Interp *interp, swig_module_info *module) { 1266 char buf[512]; 1267 char *data; 1268 1269 /* create a new pointer */ 1270 data = SWIG_PackData(buf, &module, sizeof(swig_type_info **)); 1271 *data = 0; 1272 Tcl_SetVar(interp, "swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, buf, 0); 1273} 1274 1275#ifdef __cplusplus 1276} 1277#endif 1278 1279 1280 1281 1282 1283 1284/* -------- TYPES TABLE (BEGIN) -------- */ 1285 1286#define SWIGTYPE_ptrdiff_t swig_types[0] 1287#define SWIGTYPE_size_t swig_types[1] 1288static swig_type_info *swig_types[2]; 1289static swig_module_info swig_module = {swig_types, 2, 0, 0, 0, 0}; 1290#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) 1291#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) 1292 1293/* -------- TYPES TABLE (END) -------- */ 1294 1295#define SWIG_init Mathswig_Init 1296#define SWIG_name "mathswig" 1297#define SWIG_prefix "" 1298#define SWIG_version "0.5" 1299 1300 1301#ifdef __cplusplus 1302extern "C" { 1303#endif 1304#ifdef MAC_TCL 1305#pragma export on 1306#endif 1307SWIGEXPORT(int) SWIG_init(Tcl_Interp *); 1308#ifdef MAC_TCL 1309#pragma export off 1310#endif 1311#ifdef __cplusplus 1312} 1313#endif 1314 1315 1316 1317#include <math.h> 1318 1319#ifdef __cplusplus 1320extern "C" { 1321#endif 1322static int 1323_wrap_acos(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1324 double arg1 ; 1325 double result; 1326 1327 if (SWIG_GetArgs(interp, objc, objv,"d:acos double ",&arg1) == TCL_ERROR) SWIG_fail; 1328 result = (double)acos(arg1); 1329 1330 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1331 return TCL_OK; 1332 fail: 1333 return TCL_ERROR; 1334} 1335 1336 1337static int 1338_wrap_asin(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1339 double arg1 ; 1340 double result; 1341 1342 if (SWIG_GetArgs(interp, objc, objv,"d:asin double ",&arg1) == TCL_ERROR) SWIG_fail; 1343 result = (double)asin(arg1); 1344 1345 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1346 return TCL_OK; 1347 fail: 1348 return TCL_ERROR; 1349} 1350 1351 1352static int 1353_wrap_atan(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1354 double arg1 ; 1355 double result; 1356 1357 if (SWIG_GetArgs(interp, objc, objv,"d:atan double ",&arg1) == TCL_ERROR) SWIG_fail; 1358 result = (double)atan(arg1); 1359 1360 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1361 return TCL_OK; 1362 fail: 1363 return TCL_ERROR; 1364} 1365 1366 1367static int 1368_wrap_atan2(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1369 double arg1 ; 1370 double arg2 ; 1371 double result; 1372 1373 if (SWIG_GetArgs(interp, objc, objv,"dd:atan2 double double ",&arg1,&arg2) == TCL_ERROR) SWIG_fail; 1374 result = (double)atan2(arg1,arg2); 1375 1376 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1377 return TCL_OK; 1378 fail: 1379 return TCL_ERROR; 1380} 1381 1382 1383static int 1384_wrap_cos(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1385 double arg1 ; 1386 double result; 1387 1388 if (SWIG_GetArgs(interp, objc, objv,"d:cos double ",&arg1) == TCL_ERROR) SWIG_fail; 1389 result = (double)cos(arg1); 1390 1391 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1392 return TCL_OK; 1393 fail: 1394 return TCL_ERROR; 1395} 1396 1397 1398static int 1399_wrap_sin(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1400 double arg1 ; 1401 double result; 1402 1403 if (SWIG_GetArgs(interp, objc, objv,"d:sin double ",&arg1) == TCL_ERROR) SWIG_fail; 1404 result = (double)sin(arg1); 1405 1406 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1407 return TCL_OK; 1408 fail: 1409 return TCL_ERROR; 1410} 1411 1412 1413static int 1414_wrap_tan(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1415 double arg1 ; 1416 double result; 1417 1418 if (SWIG_GetArgs(interp, objc, objv,"d:tan double ",&arg1) == TCL_ERROR) SWIG_fail; 1419 result = (double)tan(arg1); 1420 1421 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1422 return TCL_OK; 1423 fail: 1424 return TCL_ERROR; 1425} 1426 1427 1428static int 1429_wrap_cosh(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1430 double arg1 ; 1431 double result; 1432 1433 if (SWIG_GetArgs(interp, objc, objv,"d:cosh double ",&arg1) == TCL_ERROR) SWIG_fail; 1434 result = (double)cosh(arg1); 1435 1436 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1437 return TCL_OK; 1438 fail: 1439 return TCL_ERROR; 1440} 1441 1442 1443static int 1444_wrap_sinh(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1445 double arg1 ; 1446 double result; 1447 1448 if (SWIG_GetArgs(interp, objc, objv,"d:sinh double ",&arg1) == TCL_ERROR) SWIG_fail; 1449 result = (double)sinh(arg1); 1450 1451 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1452 return TCL_OK; 1453 fail: 1454 return TCL_ERROR; 1455} 1456 1457 1458static int 1459_wrap_tanh(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1460 double arg1 ; 1461 double result; 1462 1463 if (SWIG_GetArgs(interp, objc, objv,"d:tanh double ",&arg1) == TCL_ERROR) SWIG_fail; 1464 result = (double)tanh(arg1); 1465 1466 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1467 return TCL_OK; 1468 fail: 1469 return TCL_ERROR; 1470} 1471 1472 1473static int 1474_wrap_acosh(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1475 double arg1 ; 1476 double result; 1477 1478 if (SWIG_GetArgs(interp, objc, objv,"d:acosh double ",&arg1) == TCL_ERROR) SWIG_fail; 1479 result = (double)acosh(arg1); 1480 1481 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1482 return TCL_OK; 1483 fail: 1484 return TCL_ERROR; 1485} 1486 1487 1488static int 1489_wrap_asinh(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1490 double arg1 ; 1491 double result; 1492 1493 if (SWIG_GetArgs(interp, objc, objv,"d:asinh double ",&arg1) == TCL_ERROR) SWIG_fail; 1494 result = (double)asinh(arg1); 1495 1496 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1497 return TCL_OK; 1498 fail: 1499 return TCL_ERROR; 1500} 1501 1502 1503static int 1504_wrap_atanh(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1505 double arg1 ; 1506 double result; 1507 1508 if (SWIG_GetArgs(interp, objc, objv,"d:atanh double ",&arg1) == TCL_ERROR) SWIG_fail; 1509 result = (double)atanh(arg1); 1510 1511 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1512 return TCL_OK; 1513 fail: 1514 return TCL_ERROR; 1515} 1516 1517 1518static int 1519_wrap_exp(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1520 double arg1 ; 1521 double result; 1522 1523 if (SWIG_GetArgs(interp, objc, objv,"d:exp double ",&arg1) == TCL_ERROR) SWIG_fail; 1524 result = (double)exp(arg1); 1525 1526 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1527 return TCL_OK; 1528 fail: 1529 return TCL_ERROR; 1530} 1531 1532 1533static int 1534_wrap_ldexp(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1535 double arg1 ; 1536 int arg2 ; 1537 double result; 1538 1539 if (SWIG_GetArgs(interp, objc, objv,"di:ldexp double int ",&arg1,&arg2) == TCL_ERROR) SWIG_fail; 1540 result = (double)ldexp(arg1,arg2); 1541 1542 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1543 return TCL_OK; 1544 fail: 1545 return TCL_ERROR; 1546} 1547 1548 1549static int 1550_wrap_log(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1551 double arg1 ; 1552 double result; 1553 1554 if (SWIG_GetArgs(interp, objc, objv,"d:log double ",&arg1) == TCL_ERROR) SWIG_fail; 1555 result = (double)log(arg1); 1556 1557 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1558 return TCL_OK; 1559 fail: 1560 return TCL_ERROR; 1561} 1562 1563 1564static int 1565_wrap_log10(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1566 double arg1 ; 1567 double result; 1568 1569 if (SWIG_GetArgs(interp, objc, objv,"d:log10 double ",&arg1) == TCL_ERROR) SWIG_fail; 1570 result = (double)log10(arg1); 1571 1572 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1573 return TCL_OK; 1574 fail: 1575 return TCL_ERROR; 1576} 1577 1578 1579static int 1580_wrap_expm1(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1581 double arg1 ; 1582 double result; 1583 1584 if (SWIG_GetArgs(interp, objc, objv,"d:expm1 double ",&arg1) == TCL_ERROR) SWIG_fail; 1585 result = (double)expm1(arg1); 1586 1587 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1588 return TCL_OK; 1589 fail: 1590 return TCL_ERROR; 1591} 1592 1593 1594static int 1595_wrap_log1p(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1596 double arg1 ; 1597 double result; 1598 1599 if (SWIG_GetArgs(interp, objc, objv,"d:log1p double ",&arg1) == TCL_ERROR) SWIG_fail; 1600 result = (double)log1p(arg1); 1601 1602 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1603 return TCL_OK; 1604 fail: 1605 return TCL_ERROR; 1606} 1607 1608 1609static int 1610_wrap_logb(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1611 double arg1 ; 1612 double result; 1613 1614 if (SWIG_GetArgs(interp, objc, objv,"d:logb double ",&arg1) == TCL_ERROR) SWIG_fail; 1615 result = (double)logb(arg1); 1616 1617 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1618 return TCL_OK; 1619 fail: 1620 return TCL_ERROR; 1621} 1622 1623 1624static int 1625_wrap_pow(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1626 double arg1 ; 1627 double arg2 ; 1628 double result; 1629 1630 if (SWIG_GetArgs(interp, objc, objv,"dd:pow double double ",&arg1,&arg2) == TCL_ERROR) SWIG_fail; 1631 result = (double)pow(arg1,arg2); 1632 1633 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1634 return TCL_OK; 1635 fail: 1636 return TCL_ERROR; 1637} 1638 1639 1640static int 1641_wrap_sqrt(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1642 double arg1 ; 1643 double result; 1644 1645 if (SWIG_GetArgs(interp, objc, objv,"d:sqrt double ",&arg1) == TCL_ERROR) SWIG_fail; 1646 result = (double)sqrt(arg1); 1647 1648 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1649 return TCL_OK; 1650 fail: 1651 return TCL_ERROR; 1652} 1653 1654 1655static int 1656_wrap_cbrt(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1657 double arg1 ; 1658 double result; 1659 1660 if (SWIG_GetArgs(interp, objc, objv,"d:cbrt double ",&arg1) == TCL_ERROR) SWIG_fail; 1661 result = (double)cbrt(arg1); 1662 1663 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1664 return TCL_OK; 1665 fail: 1666 return TCL_ERROR; 1667} 1668 1669 1670static int 1671_wrap_ceil(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1672 double arg1 ; 1673 double result; 1674 1675 if (SWIG_GetArgs(interp, objc, objv,"d:ceil double ",&arg1) == TCL_ERROR) SWIG_fail; 1676 result = (double)ceil(arg1); 1677 1678 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1679 return TCL_OK; 1680 fail: 1681 return TCL_ERROR; 1682} 1683 1684 1685static int 1686_wrap_fabs(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1687 double arg1 ; 1688 double result; 1689 1690 if (SWIG_GetArgs(interp, objc, objv,"d:fabs double ",&arg1) == TCL_ERROR) SWIG_fail; 1691 result = (double)fabs(arg1); 1692 1693 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1694 return TCL_OK; 1695 fail: 1696 return TCL_ERROR; 1697} 1698 1699 1700static int 1701_wrap_floor(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1702 double arg1 ; 1703 double result; 1704 1705 if (SWIG_GetArgs(interp, objc, objv,"d:floor double ",&arg1) == TCL_ERROR) SWIG_fail; 1706 result = (double)floor(arg1); 1707 1708 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1709 return TCL_OK; 1710 fail: 1711 return TCL_ERROR; 1712} 1713 1714 1715static int 1716_wrap_fmod(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1717 double arg1 ; 1718 double arg2 ; 1719 double result; 1720 1721 if (SWIG_GetArgs(interp, objc, objv,"dd:fmod double double ",&arg1,&arg2) == TCL_ERROR) SWIG_fail; 1722 result = (double)fmod(arg1,arg2); 1723 1724 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1725 return TCL_OK; 1726 fail: 1727 return TCL_ERROR; 1728} 1729 1730 1731static int 1732_wrap_isinf(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1733 double arg1 ; 1734 int result; 1735 1736 if (SWIG_GetArgs(interp, objc, objv,"d:isinf double ",&arg1) == TCL_ERROR) SWIG_fail; 1737 result = (int)isinf(arg1); 1738 1739 Tcl_SetObjResult(interp,Tcl_NewIntObj((long) result)); 1740 return TCL_OK; 1741 fail: 1742 return TCL_ERROR; 1743} 1744 1745 1746static int 1747_wrap_finite(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1748 double arg1 ; 1749 int result; 1750 1751 if (SWIG_GetArgs(interp, objc, objv,"d:finite double ",&arg1) == TCL_ERROR) SWIG_fail; 1752 result = (int)finite(arg1); 1753 1754 Tcl_SetObjResult(interp,Tcl_NewIntObj((long) result)); 1755 return TCL_OK; 1756 fail: 1757 return TCL_ERROR; 1758} 1759 1760 1761static int 1762_wrap_copysign(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1763 double arg1 ; 1764 double arg2 ; 1765 double result; 1766 1767 if (SWIG_GetArgs(interp, objc, objv,"dd:copysign double double ",&arg1,&arg2) == TCL_ERROR) SWIG_fail; 1768 result = (double)copysign(arg1,arg2); 1769 1770 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1771 return TCL_OK; 1772 fail: 1773 return TCL_ERROR; 1774} 1775 1776 1777static int 1778_wrap_scalbn(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1779 double arg1 ; 1780 int arg2 ; 1781 double result; 1782 1783 if (SWIG_GetArgs(interp, objc, objv,"di:scalbn double int ",&arg1,&arg2) == TCL_ERROR) SWIG_fail; 1784 result = (double)scalbn(arg1,arg2); 1785 1786 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1787 return TCL_OK; 1788 fail: 1789 return TCL_ERROR; 1790} 1791 1792 1793static int 1794_wrap_drem(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1795 double arg1 ; 1796 double arg2 ; 1797 double result; 1798 1799 if (SWIG_GetArgs(interp, objc, objv,"dd:drem double double ",&arg1,&arg2) == TCL_ERROR) SWIG_fail; 1800 result = (double)drem(arg1,arg2); 1801 1802 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1803 return TCL_OK; 1804 fail: 1805 return TCL_ERROR; 1806} 1807 1808 1809static int 1810_wrap_significand(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1811 double arg1 ; 1812 double result; 1813 1814 if (SWIG_GetArgs(interp, objc, objv,"d:significand double ",&arg1) == TCL_ERROR) SWIG_fail; 1815 result = (double)significand(arg1); 1816 1817 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1818 return TCL_OK; 1819 fail: 1820 return TCL_ERROR; 1821} 1822 1823 1824static int 1825_wrap_isnan(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1826 double arg1 ; 1827 int result; 1828 1829 if (SWIG_GetArgs(interp, objc, objv,"d:isnan double ",&arg1) == TCL_ERROR) SWIG_fail; 1830 result = (int)isnan(arg1); 1831 1832 Tcl_SetObjResult(interp,Tcl_NewIntObj((long) result)); 1833 return TCL_OK; 1834 fail: 1835 return TCL_ERROR; 1836} 1837 1838 1839static int 1840_wrap_ilogb(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1841 double arg1 ; 1842 int result; 1843 1844 if (SWIG_GetArgs(interp, objc, objv,"d:ilogb double ",&arg1) == TCL_ERROR) SWIG_fail; 1845 result = (int)ilogb(arg1); 1846 1847 Tcl_SetObjResult(interp,Tcl_NewIntObj((long) result)); 1848 return TCL_OK; 1849 fail: 1850 return TCL_ERROR; 1851} 1852 1853 1854static int 1855_wrap_hypot(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1856 double arg1 ; 1857 double arg2 ; 1858 double result; 1859 1860 if (SWIG_GetArgs(interp, objc, objv,"dd:hypot double double ",&arg1,&arg2) == TCL_ERROR) SWIG_fail; 1861 result = (double)hypot(arg1,arg2); 1862 1863 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1864 return TCL_OK; 1865 fail: 1866 return TCL_ERROR; 1867} 1868 1869 1870static int 1871_wrap_erf(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1872 double arg1 ; 1873 double result; 1874 1875 if (SWIG_GetArgs(interp, objc, objv,"d:erf double ",&arg1) == TCL_ERROR) SWIG_fail; 1876 result = (double)erf(arg1); 1877 1878 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1879 return TCL_OK; 1880 fail: 1881 return TCL_ERROR; 1882} 1883 1884 1885static int 1886_wrap_erfc(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1887 double arg1 ; 1888 double result; 1889 1890 if (SWIG_GetArgs(interp, objc, objv,"d:erfc double ",&arg1) == TCL_ERROR) SWIG_fail; 1891 result = (double)erfc(arg1); 1892 1893 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1894 return TCL_OK; 1895 fail: 1896 return TCL_ERROR; 1897} 1898 1899 1900static int 1901_wrap_gamma(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1902 double arg1 ; 1903 double result; 1904 1905 if (SWIG_GetArgs(interp, objc, objv,"d:gamma double ",&arg1) == TCL_ERROR) SWIG_fail; 1906 result = (double)gamma(arg1); 1907 1908 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1909 return TCL_OK; 1910 fail: 1911 return TCL_ERROR; 1912} 1913 1914 1915static int 1916_wrap_j0(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1917 double arg1 ; 1918 double result; 1919 1920 if (SWIG_GetArgs(interp, objc, objv,"d:j0 double ",&arg1) == TCL_ERROR) SWIG_fail; 1921 result = (double)j0(arg1); 1922 1923 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1924 return TCL_OK; 1925 fail: 1926 return TCL_ERROR; 1927} 1928 1929 1930static int 1931_wrap_j1(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1932 double arg1 ; 1933 double result; 1934 1935 if (SWIG_GetArgs(interp, objc, objv,"d:j1 double ",&arg1) == TCL_ERROR) SWIG_fail; 1936 result = (double)j1(arg1); 1937 1938 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1939 return TCL_OK; 1940 fail: 1941 return TCL_ERROR; 1942} 1943 1944 1945static int 1946_wrap_jn(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1947 int arg1 ; 1948 double arg2 ; 1949 double result; 1950 1951 if (SWIG_GetArgs(interp, objc, objv,"id:jn int double ",&arg1,&arg2) == TCL_ERROR) SWIG_fail; 1952 result = (double)jn(arg1,arg2); 1953 1954 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1955 return TCL_OK; 1956 fail: 1957 return TCL_ERROR; 1958} 1959 1960 1961static int 1962_wrap_lgamma(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1963 double arg1 ; 1964 double result; 1965 1966 if (SWIG_GetArgs(interp, objc, objv,"d:lgamma double ",&arg1) == TCL_ERROR) SWIG_fail; 1967 result = (double)lgamma(arg1); 1968 1969 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1970 return TCL_OK; 1971 fail: 1972 return TCL_ERROR; 1973} 1974 1975 1976static int 1977_wrap_y0(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1978 double arg1 ; 1979 double result; 1980 1981 if (SWIG_GetArgs(interp, objc, objv,"d:y0 double ",&arg1) == TCL_ERROR) SWIG_fail; 1982 result = (double)y0(arg1); 1983 1984 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 1985 return TCL_OK; 1986 fail: 1987 return TCL_ERROR; 1988} 1989 1990 1991static int 1992_wrap_y1(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 1993 double arg1 ; 1994 double result; 1995 1996 if (SWIG_GetArgs(interp, objc, objv,"d:y1 double ",&arg1) == TCL_ERROR) SWIG_fail; 1997 result = (double)y1(arg1); 1998 1999 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 2000 return TCL_OK; 2001 fail: 2002 return TCL_ERROR; 2003} 2004 2005 2006static int 2007_wrap_yn(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 2008 int arg1 ; 2009 double arg2 ; 2010 double result; 2011 2012 if (SWIG_GetArgs(interp, objc, objv,"id:yn int double ",&arg1,&arg2) == TCL_ERROR) SWIG_fail; 2013 result = (double)yn(arg1,arg2); 2014 2015 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 2016 return TCL_OK; 2017 fail: 2018 return TCL_ERROR; 2019} 2020 2021 2022static int 2023_wrap_rint(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 2024 double arg1 ; 2025 double result; 2026 2027 if (SWIG_GetArgs(interp, objc, objv,"d:rint double ",&arg1) == TCL_ERROR) SWIG_fail; 2028 result = (double)rint(arg1); 2029 2030 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 2031 return TCL_OK; 2032 fail: 2033 return TCL_ERROR; 2034} 2035 2036 2037static int 2038_wrap_scalb(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 2039 double arg1 ; 2040 double arg2 ; 2041 double result; 2042 2043 if (SWIG_GetArgs(interp, objc, objv,"dd:scalb double double ",&arg1,&arg2) == TCL_ERROR) SWIG_fail; 2044 result = (double)scalb(arg1,arg2); 2045 2046 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 2047 return TCL_OK; 2048 fail: 2049 return TCL_ERROR; 2050} 2051 2052 2053static int 2054_wrap_nextafter(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 2055 double arg1 ; 2056 double arg2 ; 2057 double result; 2058 2059 if (SWIG_GetArgs(interp, objc, objv,"dd:nextafter double double ",&arg1,&arg2) == TCL_ERROR) SWIG_fail; 2060 result = (double)nextafter(arg1,arg2); 2061 2062 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 2063 return TCL_OK; 2064 fail: 2065 return TCL_ERROR; 2066} 2067 2068 2069static int 2070_wrap_remainder(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 2071 double arg1 ; 2072 double arg2 ; 2073 double result; 2074 2075 if (SWIG_GetArgs(interp, objc, objv,"dd:remainder double double ",&arg1,&arg2) == TCL_ERROR) SWIG_fail; 2076 result = (double)remainder(arg1,arg2); 2077 2078 Tcl_SetObjResult(interp,Tcl_NewDoubleObj((double) result)); 2079 return TCL_OK; 2080 fail: 2081 return TCL_ERROR; 2082} 2083 2084 2085 2086static swig_command_info swig_commands[] = { 2087 { SWIG_prefix "acos", (swig_wrapper_func) _wrap_acos, NULL}, 2088 { SWIG_prefix "asin", (swig_wrapper_func) _wrap_asin, NULL}, 2089 { SWIG_prefix "atan", (swig_wrapper_func) _wrap_atan, NULL}, 2090 { SWIG_prefix "atan2", (swig_wrapper_func) _wrap_atan2, NULL}, 2091 { SWIG_prefix "cos", (swig_wrapper_func) _wrap_cos, NULL}, 2092 { SWIG_prefix "sin", (swig_wrapper_func) _wrap_sin, NULL}, 2093 { SWIG_prefix "tan", (swig_wrapper_func) _wrap_tan, NULL}, 2094 { SWIG_prefix "cosh", (swig_wrapper_func) _wrap_cosh, NULL}, 2095 { SWIG_prefix "sinh", (swig_wrapper_func) _wrap_sinh, NULL}, 2096 { SWIG_prefix "tanh", (swig_wrapper_func) _wrap_tanh, NULL}, 2097 { SWIG_prefix "acosh", (swig_wrapper_func) _wrap_acosh, NULL}, 2098 { SWIG_prefix "asinh", (swig_wrapper_func) _wrap_asinh, NULL}, 2099 { SWIG_prefix "atanh", (swig_wrapper_func) _wrap_atanh, NULL}, 2100 { SWIG_prefix "exp", (swig_wrapper_func) _wrap_exp, NULL}, 2101 { SWIG_prefix "ldexp", (swig_wrapper_func) _wrap_ldexp, NULL}, 2102 { SWIG_prefix "log", (swig_wrapper_func) _wrap_log, NULL}, 2103 { SWIG_prefix "log10", (swig_wrapper_func) _wrap_log10, NULL}, 2104 { SWIG_prefix "expm1", (swig_wrapper_func) _wrap_expm1, NULL}, 2105 { SWIG_prefix "log1p", (swig_wrapper_func) _wrap_log1p, NULL}, 2106 { SWIG_prefix "logb", (swig_wrapper_func) _wrap_logb, NULL}, 2107 { SWIG_prefix "pow", (swig_wrapper_func) _wrap_pow, NULL}, 2108 { SWIG_prefix "sqrt", (swig_wrapper_func) _wrap_sqrt, NULL}, 2109 { SWIG_prefix "cbrt", (swig_wrapper_func) _wrap_cbrt, NULL}, 2110 { SWIG_prefix "ceil", (swig_wrapper_func) _wrap_ceil, NULL}, 2111 { SWIG_prefix "fabs", (swig_wrapper_func) _wrap_fabs, NULL}, 2112 { SWIG_prefix "floor", (swig_wrapper_func) _wrap_floor, NULL}, 2113 { SWIG_prefix "fmod", (swig_wrapper_func) _wrap_fmod, NULL}, 2114 { SWIG_prefix "isinf", (swig_wrapper_func) _wrap_isinf, NULL}, 2115 { SWIG_prefix "finite", (swig_wrapper_func) _wrap_finite, NULL}, 2116 { SWIG_prefix "copysign", (swig_wrapper_func) _wrap_copysign, NULL}, 2117 { SWIG_prefix "scalbn", (swig_wrapper_func) _wrap_scalbn, NULL}, 2118 { SWIG_prefix "drem", (swig_wrapper_func) _wrap_drem, NULL}, 2119 { SWIG_prefix "significand", (swig_wrapper_func) _wrap_significand, NULL}, 2120 { SWIG_prefix "isnan", (swig_wrapper_func) _wrap_isnan, NULL}, 2121 { SWIG_prefix "ilogb", (swig_wrapper_func) _wrap_ilogb, NULL}, 2122 { SWIG_prefix "hypot", (swig_wrapper_func) _wrap_hypot, NULL}, 2123 { SWIG_prefix "erf", (swig_wrapper_func) _wrap_erf, NULL}, 2124 { SWIG_prefix "erfc", (swig_wrapper_func) _wrap_erfc, NULL}, 2125 { SWIG_prefix "gamma", (swig_wrapper_func) _wrap_gamma, NULL}, 2126 { SWIG_prefix "j0", (swig_wrapper_func) _wrap_j0, NULL}, 2127 { SWIG_prefix "j1", (swig_wrapper_func) _wrap_j1, NULL}, 2128 { SWIG_prefix "jn", (swig_wrapper_func) _wrap_jn, NULL}, 2129 { SWIG_prefix "lgamma", (swig_wrapper_func) _wrap_lgamma, NULL}, 2130 { SWIG_prefix "y0", (swig_wrapper_func) _wrap_y0, NULL}, 2131 { SWIG_prefix "y1", (swig_wrapper_func) _wrap_y1, NULL}, 2132 { SWIG_prefix "yn", (swig_wrapper_func) _wrap_yn, NULL}, 2133 { SWIG_prefix "rint", (swig_wrapper_func) _wrap_rint, NULL}, 2134 { SWIG_prefix "scalb", (swig_wrapper_func) _wrap_scalb, NULL}, 2135 { SWIG_prefix "nextafter", (swig_wrapper_func) _wrap_nextafter, NULL}, 2136 { SWIG_prefix "remainder", (swig_wrapper_func) _wrap_remainder, NULL}, 2137 {0, 0, 0} 2138}; 2139 2140static swig_var_info swig_variables[] = { 2141 {0,0,0,0} 2142}; 2143 2144static swig_const_info swig_constants[] = { 2145 {0,0,0,0,0,0} 2146}; 2147 2148/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ 2149 2150static swig_type_info _swigt__ptrdiff_t = {"_ptrdiff_t", "ptrdiff_t", 0, 0, 0}; 2151static swig_type_info _swigt__size_t = {"_size_t", "size_t", 0, 0, 0}; 2152 2153static swig_type_info *swig_type_initial[] = { 2154 &_swigt__ptrdiff_t, 2155 &_swigt__size_t, 2156}; 2157 2158static swig_cast_info _swigc__ptrdiff_t[] = { {&_swigt__ptrdiff_t, 0, 0, 0},{0, 0, 0, 0}}; 2159static swig_cast_info _swigc__size_t[] = { {&_swigt__size_t, 0, 0, 0},{0, 0, 0, 0}}; 2160 2161static swig_cast_info *swig_cast_initial[] = { 2162 _swigc__ptrdiff_t, 2163 _swigc__size_t, 2164}; 2165 2166 2167/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ 2168 2169#ifdef __cplusplus 2170} 2171#endif 2172/************************************************************************* 2173 * Type initialization: 2174 * This problem is tough by the requirement that no dynamic 2175 * memory is used. Also, since swig_type_info structures store pointers to 2176 * swig_cast_info structures and swig_cast_info structures store pointers back 2177 * to swig_type_info structures, we need some lookup code at initialization. 2178 * The idea is that swig generates all the structures that are needed. 2179 * The runtime then collects these partially filled structures. 2180 * The SWIG_InitializeModule function takes these initial arrays out of 2181 * swig_module, and does all the lookup, filling in the swig_module.types 2182 * array with the correct data and linking the correct swig_cast_info 2183 * structures together. 2184 2185 * The generated swig_type_info structures are assigned staticly to an initial 2186 * array. We just loop though that array, and handle each type individually. 2187 * First we lookup if this type has been already loaded, and if so, use the 2188 * loaded structure instead of the generated one. Then we have to fill in the 2189 * cast linked list. The cast data is initially stored in something like a 2190 * two-dimensional array. Each row corresponds to a type (there are the same 2191 * number of rows as there are in the swig_type_initial array). Each entry in 2192 * a column is one of the swig_cast_info structures for that type. 2193 * The cast_initial array is actually an array of arrays, because each row has 2194 * a variable number of columns. So to actually build the cast linked list, 2195 * we find the array of casts associated with the type, and loop through it 2196 * adding the casts to the list. The one last trick we need to do is making 2197 * sure the type pointer in the swig_cast_info struct is correct. 2198 2199 * First off, we lookup the cast->type name to see if it is already loaded. 2200 * There are three cases to handle: 2201 * 1) If the cast->type has already been loaded AND the type we are adding 2202 * casting info to has not been loaded (it is in this module), THEN we 2203 * replace the cast->type pointer with the type pointer that has already 2204 * been loaded. 2205 * 2) If BOTH types (the one we are adding casting info to, and the 2206 * cast->type) are loaded, THEN the cast info has already been loaded by 2207 * the previous module so we just ignore it. 2208 * 3) Finally, if cast->type has not already been loaded, then we add that 2209 * swig_cast_info to the linked list (because the cast->type) pointer will 2210 * be correct. 2211**/ 2212 2213#ifdef __cplusplus 2214extern "C" { 2215#endif 2216 2217 SWIGRUNTIME void 2218 SWIG_InitializeModule(void *clientdata) { 2219 swig_type_info *type, *ret; 2220 swig_cast_info *cast; 2221 size_t i; 2222 swig_module_info *module_head; 2223 static int init_run = 0; 2224 2225 clientdata = clientdata; 2226 2227 if (init_run) return; 2228 init_run = 1; 2229 2230 /* Initialize the swig_module */ 2231 swig_module.type_initial = swig_type_initial; 2232 swig_module.cast_initial = swig_cast_initial; 2233 2234 /* Try and load any already created modules */ 2235 module_head = SWIG_GetModule(clientdata); 2236 if (module_head) { 2237 swig_module.next = module_head->next; 2238 module_head->next = &swig_module; 2239 } else { 2240 /* This is the first module loaded */ 2241 swig_module.next = &swig_module; 2242 SWIG_SetModule(clientdata, &swig_module); 2243 } 2244 2245 /* Now work on filling in swig_module.types */ 2246 for (i = 0; i < swig_module.size; ++i) { 2247 type = 0; 2248 2249 /* if there is another module already loaded */ 2250 if (swig_module.next != &swig_module) { 2251 type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); 2252 } 2253 if (type) { 2254 /* Overwrite clientdata field */ 2255 if (swig_module.type_initial[i]->clientdata) type->clientdata = swig_module.type_initial[i]->clientdata; 2256 } else { 2257 type = swig_module.type_initial[i]; 2258 } 2259 2260 /* Insert casting types */ 2261 cast = swig_module.cast_initial[i]; 2262 while (cast->type) { 2263 /* Don't need to add information already in the list */ 2264 ret = 0; 2265 if (swig_module.next != &swig_module) { 2266 ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); 2267 } 2268 if (ret && type == swig_module.type_initial[i]) { 2269 cast->type = ret; 2270 ret = 0; 2271 } 2272 2273 if (!ret) { 2274 if (type->cast) { 2275 type->cast->prev = cast; 2276 cast->next = type->cast; 2277 } 2278 type->cast = cast; 2279 } 2280 2281 cast++; 2282 } 2283 2284 /* Set entry in modules->types array equal to the type */ 2285 swig_module.types[i] = type; 2286 } 2287 } 2288 2289 /* This function will propagate the clientdata field of type to 2290 * any new swig_type_info structures that have been added into the list 2291 * of equivalent types. It is like calling 2292 * SWIG_TypeClientData(type, clientdata) a second time. 2293 */ 2294 SWIGRUNTIME void 2295 SWIG_PropagateClientData(void) { 2296 size_t i; 2297 swig_cast_info *equiv; 2298 static int init_run = 0; 2299 2300 if (init_run) return; 2301 init_run = 1; 2302 2303 for (i = 0; i < swig_module.size; i++) { 2304 if (swig_module.types[i]->clientdata) { 2305 equiv = swig_module.types[i]->cast; 2306 while (equiv) { 2307 if (!equiv->converter) { 2308 if (equiv->type && !equiv->type->clientdata) 2309 SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); 2310 } 2311 equiv = equiv->next; 2312 } 2313 } 2314 } 2315 } 2316 2317#ifdef __cplusplus 2318} 2319#endif 2320 2321 2322SWIGEXPORT(int) SWIG_init(Tcl_Interp *interp) { 2323 int i; 2324 if (interp == 0) return TCL_ERROR; 2325#ifdef USE_TCL_STUBS 2326 if (Tcl_InitStubs(interp, (char*)"8.1", 0) == NULL) { 2327 return TCL_ERROR; 2328 } 2329#endif 2330 2331 Tcl_PkgProvide(interp, (char*)SWIG_name, (char*)SWIG_version); 2332 2333#ifdef SWIG_namespace 2334 Tcl_Eval(interp, "namespace eval " SWIG_namespace " { }"); 2335#endif 2336 2337 SWIG_InitializeModule((void *) interp); 2338 SWIG_PropagateClientData(); 2339 2340 for (i = 0; swig_commands[i].name; i++) { 2341 Tcl_CreateObjCommand(interp, (char *) swig_commands[i].name, (swig_wrapper_func) swig_commands[i].wrapper, swig_commands[i].clientdata, NULL); 2342 } 2343 for (i = 0; swig_variables[i].name; i++) { 2344 Tcl_SetVar(interp, (char *) swig_variables[i].name, (char *) "", TCL_GLOBAL_ONLY); 2345 Tcl_TraceVar(interp, (char *) swig_variables[i].name, TCL_TRACE_READS | TCL_GLOBAL_ONLY, (Tcl_VarTraceProc *) swig_variables[i].get, (ClientData) swig_variables[i].addr); 2346 Tcl_TraceVar(interp, (char *) swig_variables[i].name, TCL_TRACE_WRITES | TCL_GLOBAL_ONLY, (Tcl_VarTraceProc *) swig_variables[i].set, (ClientData) swig_variables[i].addr); 2347 } 2348 SWIG_InstallConstants(interp, swig_constants); 2349 2350 2351 2352 return TCL_OK; 2353} 2354SWIGEXPORT(int) Mathswig_SafeInit(Tcl_Interp *interp) { 2355 return SWIG_init(interp); 2356} 2357 2358