00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef SWIGTEMPLATEDISAMBIGUATOR
00018 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
00019 # define SWIGTEMPLATEDISAMBIGUATOR template
00020 # elif defined(__HP_aCC)
00021
00022
00023 # define SWIGTEMPLATEDISAMBIGUATOR template
00024 # else
00025 # define SWIGTEMPLATEDISAMBIGUATOR
00026 # endif
00027 #endif
00028
00029
00030 #ifndef SWIGINLINE
00031 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
00032 # define SWIGINLINE inline
00033 # else
00034 # define SWIGINLINE
00035 # endif
00036 #endif
00037
00038
00039 #ifndef SWIGUNUSED
00040 # if defined(__GNUC__)
00041 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
00042 # define SWIGUNUSED __attribute__ ((__unused__))
00043 # else
00044 # define SWIGUNUSED
00045 # endif
00046 # elif defined(__ICC)
00047 # define SWIGUNUSED __attribute__ ((__unused__))
00048 # else
00049 # define SWIGUNUSED
00050 # endif
00051 #endif
00052
00053 #ifndef SWIG_MSC_UNSUPPRESS_4505
00054 # if defined(_MSC_VER)
00055 # pragma warning(disable : 4505)
00056 # endif
00057 #endif
00058
00059 #ifndef SWIGUNUSEDPARM
00060 # ifdef __cplusplus
00061 # define SWIGUNUSEDPARM(p)
00062 # else
00063 # define SWIGUNUSEDPARM(p) p SWIGUNUSED
00064 # endif
00065 #endif
00066
00067
00068 #ifndef SWIGINTERN
00069 # define SWIGINTERN static SWIGUNUSED
00070 #endif
00071
00072
00073 #ifndef SWIGINTERNINLINE
00074 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
00075 #endif
00076
00077
00078 #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
00079 # ifndef GCC_HASCLASSVISIBILITY
00080 # define GCC_HASCLASSVISIBILITY
00081 # endif
00082 #endif
00083
00084 #ifndef SWIGEXPORT
00085 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
00086 # if defined(STATIC_LINKED)
00087 # define SWIGEXPORT
00088 # else
00089 # define SWIGEXPORT __declspec(dllexport)
00090 # endif
00091 # else
00092 # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
00093 # define SWIGEXPORT __attribute__ ((visibility("default")))
00094 # else
00095 # define SWIGEXPORT
00096 # endif
00097 # endif
00098 #endif
00099
00100
00101 #ifndef SWIGSTDCALL
00102 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
00103 # define SWIGSTDCALL __stdcall
00104 # else
00105 # define SWIGSTDCALL
00106 # endif
00107 #endif
00108
00109
00110 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
00111 # define _CRT_SECURE_NO_DEPRECATE
00112 #endif
00113
00114
00115 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
00116 # define _SCL_SECURE_NO_DEPRECATE
00117 #endif
00118
00119
00120 #define SWIG_UnknownError -1
00121 #define SWIG_IOError -2
00122 #define SWIG_RuntimeError -3
00123 #define SWIG_IndexError -4
00124 #define SWIG_TypeError -5
00125 #define SWIG_DivisionByZero -6
00126 #define SWIG_OverflowError -7
00127 #define SWIG_SyntaxError -8
00128 #define SWIG_ValueError -9
00129 #define SWIG_SystemError -10
00130 #define SWIG_AttributeError -11
00131 #define SWIG_MemoryError -12
00132 #define SWIG_NullReferenceError -13
00133
00134
00135
00136 #define SWIG_UnknownError -1
00137 #define SWIG_IOError -2
00138 #define SWIG_RuntimeError -3
00139 #define SWIG_IndexError -4
00140 #define SWIG_TypeError -5
00141 #define SWIG_DivisionByZero -6
00142 #define SWIG_OverflowError -7
00143 #define SWIG_SyntaxError -8
00144 #define SWIG_ValueError -9
00145 #define SWIG_SystemError -10
00146 #define SWIG_AttributeError -11
00147 #define SWIG_MemoryError -12
00148 #define SWIG_NullReferenceError -13
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160 #define SWIG_RUNTIME_VERSION "4"
00161
00162
00163 #ifdef SWIG_TYPE_TABLE
00164 # define SWIG_QUOTE_STRING(x) #x
00165 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
00166 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
00167 #else
00168 # define SWIG_TYPE_TABLE_NAME
00169 #endif
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180 #ifndef SWIGRUNTIME
00181 # define SWIGRUNTIME SWIGINTERN
00182 #endif
00183
00184 #ifndef SWIGRUNTIMEINLINE
00185 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
00186 #endif
00187
00188
00189 #ifndef SWIG_BUFFER_SIZE
00190 # define SWIG_BUFFER_SIZE 1024
00191 #endif
00192
00193
00194 #define SWIG_POINTER_DISOWN 0x1
00195 #define SWIG_CAST_NEW_MEMORY 0x2
00196
00197
00198 #define SWIG_POINTER_OWN 0x1
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280 #define SWIG_OK (0)
00281 #define SWIG_ERROR (-1)
00282 #define SWIG_IsOK(r) (r >= 0)
00283 #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
00284
00285
00286 #define SWIG_CASTRANKLIMIT (1 << 8)
00287
00288 #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
00289
00290 #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
00291
00292 #define SWIG_BADOBJ (SWIG_ERROR)
00293 #define SWIG_OLDOBJ (SWIG_OK)
00294 #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
00295 #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
00296
00297 #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
00298 #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
00299 #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
00300 #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
00301 #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
00302 #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
00303
00304
00305 #if defined(SWIG_CASTRANK_MODE)
00306 # ifndef SWIG_TypeRank
00307 # define SWIG_TypeRank unsigned long
00308 # endif
00309 # ifndef SWIG_MAXCASTRANK
00310 # define SWIG_MAXCASTRANK (2)
00311 # endif
00312 # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
00313 # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
00314 SWIGINTERNINLINE int SWIG_AddCast(int r) {
00315 return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
00316 }
00317 SWIGINTERNINLINE int SWIG_CheckState(int r) {
00318 return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
00319 }
00320 #else
00321 # define SWIG_AddCast
00322 # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
00323 #endif
00324
00325
00326 #include <string.h>
00327
00328 #ifdef __cplusplus
00329 extern "C" {
00330 #endif
00331
00332 typedef void *(*swig_converter_func)(void *, int *);
00333 typedef struct swig_type_info *(*swig_dycast_func)(void **);
00334
00335
00336 typedef struct swig_type_info {
00337 const char *name;
00338 const char *str;
00339 swig_dycast_func dcast;
00340 struct swig_cast_info *cast;
00341 void *clientdata;
00342 int owndata;
00343 } swig_type_info;
00344
00345
00346 typedef struct swig_cast_info {
00347 swig_type_info *type;
00348 swig_converter_func converter;
00349 struct swig_cast_info *next;
00350 struct swig_cast_info *prev;
00351 } swig_cast_info;
00352
00353
00354
00355
00356 typedef struct swig_module_info {
00357 swig_type_info **types;
00358 size_t size;
00359 struct swig_module_info *next;
00360 swig_type_info **type_initial;
00361 swig_cast_info **cast_initial;
00362 void *clientdata;
00363 } swig_module_info;
00364
00365
00366
00367
00368
00369
00370
00371
00372 SWIGRUNTIME int
00373 SWIG_TypeNameComp(const char *f1, const char *l1,
00374 const char *f2, const char *l2) {
00375 for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
00376 while ((*f1 == ' ') && (f1 != l1)) ++f1;
00377 while ((*f2 == ' ') && (f2 != l2)) ++f2;
00378 if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
00379 }
00380 return (int)((l1 - f1) - (l2 - f2));
00381 }
00382
00383
00384
00385
00386
00387 SWIGRUNTIME int
00388 SWIG_TypeEquiv(const char *nb, const char *tb) {
00389 int equiv = 0;
00390 const char* te = tb + strlen(tb);
00391 const char* ne = nb;
00392 while (!equiv && *ne) {
00393 for (nb = ne; *ne; ++ne) {
00394 if (*ne == '|') break;
00395 }
00396 equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
00397 if (*ne) ++ne;
00398 }
00399 return equiv;
00400 }
00401
00402
00403
00404
00405
00406 SWIGRUNTIME int
00407 SWIG_TypeCompare(const char *nb, const char *tb) {
00408 int equiv = 0;
00409 const char* te = tb + strlen(tb);
00410 const char* ne = nb;
00411 while (!equiv && *ne) {
00412 for (nb = ne; *ne; ++ne) {
00413 if (*ne == '|') break;
00414 }
00415 equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
00416 if (*ne) ++ne;
00417 }
00418 return equiv;
00419 }
00420
00421
00422
00423
00424
00425 SWIGRUNTIME swig_cast_info *
00426 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
00427 if (ty) {
00428 swig_cast_info *iter = ty->cast;
00429 while (iter) {
00430 if (strcmp(iter->type->name, c) == 0) {
00431 if (iter == ty->cast)
00432 return iter;
00433
00434 iter->prev->next = iter->next;
00435 if (iter->next)
00436 iter->next->prev = iter->prev;
00437 iter->next = ty->cast;
00438 iter->prev = 0;
00439 if (ty->cast) ty->cast->prev = iter;
00440 ty->cast = iter;
00441 return iter;
00442 }
00443 iter = iter->next;
00444 }
00445 }
00446 return 0;
00447 }
00448
00449
00450
00451
00452 SWIGRUNTIME swig_cast_info *
00453 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
00454 if (ty) {
00455 swig_cast_info *iter = ty->cast;
00456 while (iter) {
00457 if (iter->type == from) {
00458 if (iter == ty->cast)
00459 return iter;
00460
00461 iter->prev->next = iter->next;
00462 if (iter->next)
00463 iter->next->prev = iter->prev;
00464 iter->next = ty->cast;
00465 iter->prev = 0;
00466 if (ty->cast) ty->cast->prev = iter;
00467 ty->cast = iter;
00468 return iter;
00469 }
00470 iter = iter->next;
00471 }
00472 }
00473 return 0;
00474 }
00475
00476
00477
00478
00479 SWIGRUNTIMEINLINE void *
00480 SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
00481 return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
00482 }
00483
00484
00485
00486
00487 SWIGRUNTIME swig_type_info *
00488 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
00489 swig_type_info *lastty = ty;
00490 if (!ty || !ty->dcast) return ty;
00491 while (ty && (ty->dcast)) {
00492 ty = (*ty->dcast)(ptr);
00493 if (ty) lastty = ty;
00494 }
00495 return lastty;
00496 }
00497
00498
00499
00500
00501 SWIGRUNTIMEINLINE const char *
00502 SWIG_TypeName(const swig_type_info *ty) {
00503 return ty->name;
00504 }
00505
00506
00507
00508
00509
00510 SWIGRUNTIME const char *
00511 SWIG_TypePrettyName(const swig_type_info *type) {
00512
00513
00514
00515
00516 if (!type) return NULL;
00517 if (type->str != NULL) {
00518 const char *last_name = type->str;
00519 const char *s;
00520 for (s = type->str; *s; s++)
00521 if (*s == '|') last_name = s+1;
00522 return last_name;
00523 }
00524 else
00525 return type->name;
00526 }
00527
00528
00529
00530
00531 SWIGRUNTIME void
00532 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
00533 swig_cast_info *cast = ti->cast;
00534
00535 ti->clientdata = clientdata;
00536
00537 while (cast) {
00538 if (!cast->converter) {
00539 swig_type_info *tc = cast->type;
00540 if (!tc->clientdata) {
00541 SWIG_TypeClientData(tc, clientdata);
00542 }
00543 }
00544 cast = cast->next;
00545 }
00546 }
00547 SWIGRUNTIME void
00548 SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
00549 SWIG_TypeClientData(ti, clientdata);
00550 ti->owndata = 1;
00551 }
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561 SWIGRUNTIME swig_type_info *
00562 SWIG_MangledTypeQueryModule(swig_module_info *start,
00563 swig_module_info *end,
00564 const char *name) {
00565 swig_module_info *iter = start;
00566 do {
00567 if (iter->size) {
00568 register size_t l = 0;
00569 register size_t r = iter->size - 1;
00570 do {
00571
00572 register size_t i = (l + r) >> 1;
00573 const char *iname = iter->types[i]->name;
00574 if (iname) {
00575 register int compare = strcmp(name, iname);
00576 if (compare == 0) {
00577 return iter->types[i];
00578 } else if (compare < 0) {
00579 if (i) {
00580 r = i - 1;
00581 } else {
00582 break;
00583 }
00584 } else if (compare > 0) {
00585 l = i + 1;
00586 }
00587 } else {
00588 break;
00589 }
00590 } while (l <= r);
00591 }
00592 iter = iter->next;
00593 } while (iter != end);
00594 return 0;
00595 }
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605
00606 SWIGRUNTIME swig_type_info *
00607 SWIG_TypeQueryModule(swig_module_info *start,
00608 swig_module_info *end,
00609 const char *name) {
00610
00611 swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
00612 if (ret) {
00613 return ret;
00614 } else {
00615
00616
00617 swig_module_info *iter = start;
00618 do {
00619 register size_t i = 0;
00620 for (; i < iter->size; ++i) {
00621 if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
00622 return iter->types[i];
00623 }
00624 iter = iter->next;
00625 } while (iter != end);
00626 }
00627
00628
00629 return 0;
00630 }
00631
00632
00633
00634
00635 SWIGRUNTIME char *
00636 SWIG_PackData(char *c, void *ptr, size_t sz) {
00637 static const char hex[17] = "0123456789abcdef";
00638 register const unsigned char *u = (unsigned char *) ptr;
00639 register const unsigned char *eu = u + sz;
00640 for (; u != eu; ++u) {
00641 register unsigned char uu = *u;
00642 *(c++) = hex[(uu & 0xf0) >> 4];
00643 *(c++) = hex[uu & 0xf];
00644 }
00645 return c;
00646 }
00647
00648
00649
00650
00651 SWIGRUNTIME const char *
00652 SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
00653 register unsigned char *u = (unsigned char *) ptr;
00654 register const unsigned char *eu = u + sz;
00655 for (; u != eu; ++u) {
00656 register char d = *(c++);
00657 register unsigned char uu;
00658 if ((d >= '0') && (d <= '9'))
00659 uu = ((d - '0') << 4);
00660 else if ((d >= 'a') && (d <= 'f'))
00661 uu = ((d - ('a'-10)) << 4);
00662 else
00663 return (char *) 0;
00664 d = *(c++);
00665 if ((d >= '0') && (d <= '9'))
00666 uu |= (d - '0');
00667 else if ((d >= 'a') && (d <= 'f'))
00668 uu |= (d - ('a'-10));
00669 else
00670 return (char *) 0;
00671 *u = uu;
00672 }
00673 return c;
00674 }
00675
00676
00677
00678
00679 SWIGRUNTIME char *
00680 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
00681 char *r = buff;
00682 if ((2*sizeof(void *) + 2) > bsz) return 0;
00683 *(r++) = '_';
00684 r = SWIG_PackData(r,&ptr,sizeof(void *));
00685 if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
00686 strcpy(r,name);
00687 return buff;
00688 }
00689
00690 SWIGRUNTIME const char *
00691 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
00692 if (*c != '_') {
00693 if (strcmp(c,"NULL") == 0) {
00694 *ptr = (void *) 0;
00695 return name;
00696 } else {
00697 return 0;
00698 }
00699 }
00700 return SWIG_UnpackData(++c,ptr,sizeof(void *));
00701 }
00702
00703 SWIGRUNTIME char *
00704 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
00705 char *r = buff;
00706 size_t lname = (name ? strlen(name) : 0);
00707 if ((2*sz + 2 + lname) > bsz) return 0;
00708 *(r++) = '_';
00709 r = SWIG_PackData(r,ptr,sz);
00710 if (lname) {
00711 strncpy(r,name,lname+1);
00712 } else {
00713 *r = 0;
00714 }
00715 return buff;
00716 }
00717
00718 SWIGRUNTIME const char *
00719 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
00720 if (*c != '_') {
00721 if (strcmp(c,"NULL") == 0) {
00722 memset(ptr,0,sz);
00723 return name;
00724 } else {
00725 return 0;
00726 }
00727 }
00728 return SWIG_UnpackData(++c,ptr,sz);
00729 }
00730
00731 #ifdef __cplusplus
00732 }
00733 #endif
00734
00735
00736
00737
00738
00739
00740
00741
00742
00743
00744
00745 #ifdef __cplusplus
00746 extern "C" {
00747 #endif
00748
00749 #include "lua.h"
00750 #include "lauxlib.h"
00751 #include <stdlib.h>
00752 #include <assert.h>
00753
00754
00755
00756
00757
00758 #define SWIG_LUA_INT 1
00759 #define SWIG_LUA_FLOAT 2
00760 #define SWIG_LUA_STRING 3
00761 #define SWIG_LUA_POINTER 4
00762 #define SWIG_LUA_BINARY 5
00763 #define SWIG_LUA_CHAR 6
00764
00765
00766 typedef struct {
00767 const char *name;
00768 lua_CFunction get;
00769 lua_CFunction set;
00770 } swig_lua_var_info;
00771
00772
00773 typedef struct {
00774 int type;
00775 char *name;
00776 long lvalue;
00777 double dvalue;
00778 void *pvalue;
00779 swig_type_info **ptype;
00780 } swig_lua_const_info;
00781
00782 typedef struct {
00783 const char *name;
00784 lua_CFunction method;
00785 } swig_lua_method;
00786
00787 typedef struct {
00788 const char *name;
00789 lua_CFunction getmethod;
00790 lua_CFunction setmethod;
00791 } swig_lua_attribute;
00792
00793 typedef struct swig_lua_class {
00794 const char *name;
00795 swig_type_info **type;
00796 lua_CFunction constructor;
00797 void (*destructor)(void *);
00798 swig_lua_method *methods;
00799 swig_lua_attribute *attributes;
00800 struct swig_lua_class **bases;
00801 const char **base_names;
00802 } swig_lua_class;
00803
00804
00805
00806 typedef struct {
00807 swig_type_info *type;
00808 int own;
00809 void *ptr;
00810 } swig_lua_userdata;
00811
00812
00813
00814
00815
00816
00817 typedef struct {
00818 swig_type_info *type;
00819 int own;
00820 char data[1];
00821 } swig_lua_rawdata;
00822
00823
00824 #define SWIG_NewPointerObj(L, ptr, type, owner) SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner)
00825 #define SWIG_ConvertPtr(L,idx, ptr, type, flags) SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags)
00826 #define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname) SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname)
00827
00828 #define SWIG_ConvertMember(L, idx, ptr, sz, ty) SWIG_Lua_ConvertPacked(L, idx, ptr, sz, ty)
00829 #define SWIG_NewMemberObj(L, ptr, sz, type) SWIG_Lua_NewPackedObj(L, ptr, sz, type)
00830
00831
00832 #define SWIG_GetModule(clientdata) SWIG_Lua_GetModule((lua_State*)(clientdata))
00833 #define SWIG_SetModule(clientdata, pointer) SWIG_Lua_SetModule((lua_State*) (clientdata), pointer)
00834 #define SWIG_MODULE_CLIENTDATA_TYPE lua_State*
00835
00836
00837 #define SWIG_contract_assert(expr, msg) \
00838 if (!(expr)) { lua_pushstring(L, (char *) msg); goto fail; } else
00839
00840
00841 #define SWIG_fail {goto fail;}
00842 #define SWIG_fail_arg(func_name,argnum,type) \
00843 {lua_pushfstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\
00844 func_name,argnum,type,SWIG_Lua_typename(L,argnum));\
00845 goto fail;}
00846 #define SWIG_fail_ptr(func_name,argnum,type) \
00847 SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*")
00848 #define SWIG_check_num_args(func_name,a,b) \
00849 if (lua_gettop(L)<a || lua_gettop(L)>b) \
00850 {lua_pushfstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\
00851 goto fail;}
00852
00853
00854 #define SWIG_Lua_get_table(L,n) \
00855 (lua_pushstring(L, n), lua_rawget(L,-2))
00856
00857 #define SWIG_Lua_add_function(L,n,f) \
00858 (lua_pushstring(L, n), \
00859 lua_pushcfunction(L, f), \
00860 lua_rawset(L,-3))
00861
00862
00863 #define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I))
00864
00865 #ifdef __cplusplus
00866
00867
00868
00869 #endif
00870
00871
00872 SWIGRUNTIME swig_module_info *
00873 SWIG_Lua_GetModule(lua_State* L) {
00874 swig_module_info *ret = 0;
00875 lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
00876 lua_rawget(L,LUA_REGISTRYINDEX);
00877 if (lua_islightuserdata(L,-1))
00878 ret=(swig_module_info*)lua_touserdata(L,-1);
00879 lua_pop(L,1);
00880 return ret;
00881 }
00882
00883 SWIGRUNTIME void
00884 SWIG_Lua_SetModule(lua_State* L, swig_module_info *module) {
00885
00886 lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
00887 lua_pushlightuserdata(L,(void*)module);
00888 lua_rawset(L,LUA_REGISTRYINDEX);
00889 }
00890
00891
00892
00893
00894
00895
00896
00897
00898 SWIGINTERN int SWIG_Lua_set_immutable(lua_State* L)
00899 {
00900
00901 #ifndef SWIGLUA_IGNORE_SET_IMMUTABLE
00902 lua_pop(L,1);
00903 lua_pushstring(L,"This variable is immutable");
00904 lua_error(L);
00905 #endif
00906 return 0;
00907 }
00908
00909
00910 SWIGINTERN int SWIG_Lua_module_get(lua_State* L)
00911 {
00912
00913
00914
00915
00916
00917
00918
00919
00920 assert(lua_istable(L,1));
00921 lua_getmetatable(L,1);
00922 assert(lua_istable(L,-1));
00923 SWIG_Lua_get_table(L,".get");
00924 lua_remove(L,3);
00925 if (lua_istable(L,-1))
00926 {
00927
00928 lua_pushvalue(L,2);
00929 lua_rawget(L,-2);
00930 lua_remove(L,3);
00931 if (lua_iscfunction(L,-1))
00932 {
00933 lua_call(L,0,1);
00934 return 1;
00935 }
00936 lua_pop(L,1);
00937 }
00938 lua_pop(L,1);
00939 lua_pushnil(L);
00940 return 1;
00941 }
00942
00943
00944 SWIGINTERN int SWIG_Lua_module_set(lua_State* L)
00945 {
00946
00947
00948
00949
00950
00951
00952 assert(lua_istable(L,1));
00953 lua_getmetatable(L,1);
00954 assert(lua_istable(L,-1));
00955 SWIG_Lua_get_table(L,".set");
00956 lua_remove(L,4);
00957 if (lua_istable(L,-1))
00958 {
00959
00960 lua_pushvalue(L,2);
00961 lua_rawget(L,-2);
00962 lua_remove(L,4);
00963 if (lua_iscfunction(L,-1))
00964 {
00965 lua_pushvalue(L,3);
00966 lua_call(L,1,0);
00967 return 0;
00968 }
00969 }
00970 lua_settop(L,3);
00971
00972 lua_rawset(L,1);
00973 return 0;
00974 }
00975
00976
00977 SWIGINTERN void SWIG_Lua_module_begin(lua_State* L,const char* name)
00978 {
00979 assert(lua_istable(L,-1));
00980 lua_pushstring(L,name);
00981 lua_newtable(L);
00982
00983 lua_newtable(L);
00984 SWIG_Lua_add_function(L,"__index",SWIG_Lua_module_get);
00985 SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_module_set);
00986 lua_pushstring(L,".get");
00987 lua_newtable(L);
00988 lua_rawset(L,-3);
00989 lua_pushstring(L,".set");
00990 lua_newtable(L);
00991 lua_rawset(L,-3);
00992 lua_setmetatable(L,-2);
00993 lua_rawset(L,-3);
00994 SWIG_Lua_get_table(L,name);
00995 }
00996
00997
00998 SWIGINTERN void SWIG_Lua_module_end(lua_State* L)
00999 {
01000 lua_pop(L,1);
01001 }
01002
01003
01004 SWIGINTERN void SWIG_Lua_module_add_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn)
01005 {
01006 assert(lua_istable(L,-1));
01007 lua_getmetatable(L,-1);
01008 assert(lua_istable(L,-1));
01009 SWIG_Lua_get_table(L,".get");
01010 assert(lua_istable(L,-1));
01011 SWIG_Lua_add_function(L,name,getFn);
01012 lua_pop(L,1);
01013 if (setFn)
01014 {
01015 SWIG_Lua_get_table(L,".set");
01016 assert(lua_istable(L,-1));
01017 SWIG_Lua_add_function(L,name,setFn);
01018 lua_pop(L,1);
01019 }
01020 lua_pop(L,1);
01021 }
01022
01023
01024 SWIGINTERN void SWIG_Lua_module_add_function(lua_State* L,const char* name,lua_CFunction fn)
01025 {
01026 SWIG_Lua_add_function(L,name,fn);
01027 }
01028
01029
01030
01031
01032
01033
01034 SWIGINTERN int SWIG_Lua_class_get(lua_State* L)
01035 {
01036
01037
01038
01039
01040 assert(lua_isuserdata(L,-2));
01041 lua_getmetatable(L,-2);
01042 assert(lua_istable(L,-1));
01043 SWIG_Lua_get_table(L,".get");
01044 assert(lua_istable(L,-1));
01045
01046 lua_pushvalue(L,2);
01047 lua_rawget(L,-2);
01048 lua_remove(L,-2);
01049 if (lua_iscfunction(L,-1))
01050 {
01051 lua_pushvalue(L,1);
01052 lua_call(L,1,1);
01053 lua_remove(L,-2);
01054 return 1;
01055 }
01056 lua_pop(L,1);
01057
01058 SWIG_Lua_get_table(L,".fn");
01059 assert(lua_istable(L,-1));
01060 lua_pushvalue(L,2);
01061 lua_rawget(L,-2);
01062 lua_remove(L,-2);
01063 if (lua_isfunction(L,-1))
01064 {
01065 lua_remove(L,-2);
01066 return 1;
01067 }
01068 lua_pop(L,1);
01069
01070
01071 SWIG_Lua_get_table(L,"__getitem");
01072 if (lua_iscfunction(L,-1))
01073 {
01074 lua_pushvalue(L,1);
01075 lua_pushvalue(L,2);
01076 lua_call(L,2,1);
01077 lua_remove(L,-2);
01078 return 1;
01079 }
01080 return 0;
01081 }
01082
01083
01084 SWIGINTERN int SWIG_Lua_class_set(lua_State* L)
01085 {
01086
01087
01088
01089
01090
01091
01092
01093
01094
01095 assert(lua_isuserdata(L,1));
01096 lua_getmetatable(L,1);
01097 assert(lua_istable(L,-1));
01098
01099 SWIG_Lua_get_table(L,".set");
01100 if (lua_istable(L,-1))
01101 {
01102
01103 lua_pushvalue(L,2);
01104 lua_rawget(L,-2);
01105 if (lua_iscfunction(L,-1))
01106 {
01107 lua_pushvalue(L,1);
01108 lua_pushvalue(L,3);
01109 lua_call(L,2,0);
01110 return 0;
01111 }
01112 lua_pop(L,1);
01113 }
01114 lua_pop(L,1);
01115
01116
01117 SWIG_Lua_get_table(L,"__setitem");
01118 if (lua_iscfunction(L,-1))
01119 {
01120 lua_pushvalue(L,1);
01121 lua_pushvalue(L,2);
01122 lua_pushvalue(L,3);
01123 lua_call(L,3,0);
01124 lua_remove(L,-2);
01125 return 1;
01126 }
01127 return 0;
01128 }
01129
01130
01131 SWIGINTERN int SWIG_Lua_class_destruct(lua_State* L)
01132 {
01133
01134
01135 swig_lua_userdata* usr;
01136 swig_lua_class* clss;
01137 assert(lua_isuserdata(L,-1));
01138 usr=(swig_lua_userdata*)lua_touserdata(L,-1);
01139
01140 if (usr->own)
01141 {
01142 clss=(swig_lua_class*)usr->type->clientdata;
01143 if (clss && clss->destructor)
01144 {
01145 clss->destructor(usr->ptr);
01146 }
01147 }
01148 return 0;
01149 }
01150
01151
01152 SWIGINTERN void SWIG_Lua_get_class_registry(lua_State* L)
01153 {
01154
01155 lua_pushstring(L,"SWIG");
01156 lua_rawget(L,LUA_REGISTRYINDEX);
01157 if (!lua_istable(L,-1))
01158 {
01159 lua_pop(L,1);
01160 lua_pushstring(L,"SWIG");
01161 lua_newtable(L);
01162 lua_rawset(L,LUA_REGISTRYINDEX);
01163
01164 lua_pushstring(L,"SWIG");
01165 lua_rawget(L,LUA_REGISTRYINDEX);
01166 }
01167 }
01168
01169
01170 SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State* L,const char* cname)
01171 {
01172 SWIG_Lua_get_class_registry(L);
01173 lua_pushstring(L,cname);
01174 lua_rawget(L,-2);
01175 lua_remove(L,-2);
01176 }
01177
01178
01179 SWIGINTERN void SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn)
01180 {
01181 assert(lua_istable(L,-1));
01182 SWIG_Lua_get_table(L,".get");
01183 assert(lua_istable(L,-1));
01184 SWIG_Lua_add_function(L,name,getFn);
01185 lua_pop(L,1);
01186 if (setFn)
01187 {
01188 SWIG_Lua_get_table(L,".set");
01189 assert(lua_istable(L,-1));
01190 SWIG_Lua_add_function(L,name,setFn);
01191 lua_pop(L,1);
01192 }
01193 }
01194
01195
01196 SWIGINTERN void SWIG_Lua_add_class_details(lua_State* L,swig_lua_class* clss)
01197 {
01198 int i;
01199
01200 for(i=0;clss->bases[i];i++)
01201 {
01202 SWIG_Lua_add_class_details(L,clss->bases[i]);
01203 }
01204
01205 for(i=0;clss->attributes[i].name;i++){
01206 SWIG_Lua_add_class_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod);
01207 }
01208
01209 SWIG_Lua_get_table(L,".fn");
01210 assert(lua_istable(L,-1));
01211 for(i=0;clss->methods[i].name;i++){
01212 SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method);
01213 }
01214 lua_pop(L,1);
01215
01216
01217
01218
01219 for(i=0;clss->methods[i].name;i++){
01220 if (clss->methods[i].name[0]=='_' && clss->methods[i].name[1]=='_'){
01221 SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method);
01222 }
01223 }
01224 }
01225
01226
01227
01228
01229
01230
01231
01232
01233 SWIGINTERN void SWIG_Lua_init_base_class(lua_State* L,swig_lua_class* clss)
01234 {
01235 int i=0;
01236 swig_module_info* module=SWIG_GetModule(L);
01237 for(i=0;clss->base_names[i];i++)
01238 {
01239 if (clss->bases[i]==0)
01240 {
01241
01242 swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]);
01243 if (info) clss->bases[i] = (swig_lua_class *) info->clientdata;
01244 }
01245 }
01246 }
01247
01248
01249 SWIGINTERN void SWIG_Lua_class_register(lua_State* L,swig_lua_class* clss)
01250 {
01251
01252
01253
01254
01255 if (clss->constructor)
01256 SWIG_Lua_add_function(L,clss->name,clss->constructor);
01257
01258 SWIG_Lua_get_class_registry(L);
01259 lua_pushstring(L,clss->name);
01260 lua_newtable(L);
01261
01262 lua_pushstring(L,".type");
01263 lua_pushstring(L,clss->name);
01264 lua_rawset(L,-3);
01265
01266 lua_pushstring(L,".get");
01267 lua_newtable(L);
01268 lua_rawset(L,-3);
01269
01270 lua_pushstring(L,".set");
01271 lua_newtable(L);
01272 lua_rawset(L,-3);
01273
01274 lua_pushstring(L,".fn");
01275 lua_newtable(L);
01276 lua_rawset(L,-3);
01277
01278 SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get);
01279 SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set);
01280 SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct);
01281
01282 lua_rawset(L,-3);
01283 lua_pop(L,1);
01284
01285 SWIG_Lua_get_class_metatable(L,clss->name);
01286 SWIG_Lua_add_class_details(L,clss);
01287 lua_pop(L,1);
01288 }
01289
01290
01291
01292
01293
01294
01295 SWIGINTERN void _SWIG_Lua_AddMetatable(lua_State* L,swig_type_info *type)
01296 {
01297 if (type->clientdata)
01298 {
01299 SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->name);
01300 if (lua_istable(L,-1))
01301 {
01302 lua_setmetatable(L,-2);
01303 }
01304 else
01305 {
01306 lua_pop(L,1);
01307 }
01308 }
01309 }
01310
01311
01312 SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State* L,void* ptr,swig_type_info *type, int own)
01313 {
01314 swig_lua_userdata* usr;
01315 if (!ptr){
01316 lua_pushnil(L);
01317 return;
01318 }
01319 usr=(swig_lua_userdata*)lua_newuserdata(L,sizeof(swig_lua_userdata));
01320 usr->ptr=ptr;
01321 usr->type=type;
01322 usr->own=own;
01323 _SWIG_Lua_AddMetatable(L,type);
01324 }
01325
01326
01327
01328 SWIGRUNTIME int SWIG_Lua_ConvertPtr(lua_State* L,int index,void** ptr,swig_type_info *type,int flags)
01329 {
01330 swig_lua_userdata* usr;
01331 swig_cast_info *cast;
01332 if (lua_isnil(L,index)){*ptr=0; return SWIG_OK;}
01333 usr=(swig_lua_userdata*)lua_touserdata(L,index);
01334 if (usr)
01335 {
01336 if (flags & SWIG_POINTER_DISOWN)
01337 {
01338 usr->own=0;
01339 }
01340 if (!type)
01341 {
01342 *ptr=usr->ptr;
01343 return SWIG_OK;
01344 }
01345 cast=SWIG_TypeCheckStruct(usr->type,type);
01346 if (cast)
01347 {
01348 int newmemory = 0;
01349 *ptr=SWIG_TypeCast(cast,usr->ptr,&newmemory);
01350 assert(!newmemory);
01351 return SWIG_OK;
01352 }
01353 }
01354 return SWIG_ERROR;
01355 }
01356
01357 SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State* L,int index,swig_type_info *type,int flags,
01358 int argnum,const char* func_name){
01359 void* result;
01360 if (!SWIG_IsOK(SWIG_ConvertPtr(L,index,&result,type,flags))){
01361 lua_pushfstring(L,"Error in %s, expected a %s at argument number %d\n",
01362 func_name,(type && type->str)?type->str:"void*",argnum);
01363 lua_error(L);
01364 }
01365 return result;
01366 }
01367
01368
01369 SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State* L,void* ptr,size_t size,swig_type_info *type)
01370 {
01371 swig_lua_rawdata* raw;
01372 assert(ptr);
01373 raw=(swig_lua_rawdata*)lua_newuserdata(L,sizeof(swig_lua_rawdata)-1+size);
01374 raw->type=type;
01375 raw->own=0;
01376 memcpy(raw->data,ptr,size);
01377 _SWIG_Lua_AddMetatable(L,type);
01378 }
01379
01380
01381 SWIGRUNTIME int SWIG_Lua_ConvertPacked(lua_State* L,int index,void* ptr,size_t size,swig_type_info *type)
01382 {
01383 swig_lua_rawdata* raw;
01384 raw=(swig_lua_rawdata*)lua_touserdata(L,index);
01385 if (!raw) return SWIG_ERROR;
01386 if (type==0 || type==raw->type)
01387 {
01388 memcpy(ptr,raw->data,size);
01389 return SWIG_OK;
01390 }
01391 return SWIG_ERROR;
01392 }
01393
01394
01395 SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp)
01396 {
01397 swig_lua_userdata* usr;
01398 if (lua_isuserdata(L,tp))
01399 {
01400 usr=(swig_lua_userdata*)lua_touserdata(L,1);
01401 if (usr && usr->type && usr->type->str)
01402 return usr->type->str;
01403 return "userdata (unknown type)";
01404 }
01405 return lua_typename(L,lua_type(L,tp));
01406 }
01407
01408
01409 SWIGRUNTIME int SWIG_Lua_type(lua_State* L)
01410 {
01411 lua_pushstring(L,SWIG_Lua_typename(L,1));
01412 return 1;
01413 }
01414
01415
01416
01417
01418 SWIGRUNTIME int SWIG_Lua_equal(lua_State* L)
01419 {
01420 int result;
01421 swig_lua_userdata *usr1,*usr2;
01422 if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2))
01423 return 0;
01424 usr1=(swig_lua_userdata*)lua_touserdata(L,1);
01425 usr2=(swig_lua_userdata*)lua_touserdata(L,2);
01426
01427 result=(usr1->ptr==usr2->ptr);
01428 lua_pushboolean(L,result);
01429 return 1;
01430 }
01431
01432
01433
01434
01435
01436
01437 SWIGINTERN void
01438 SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) {
01439 int i;
01440 for (i = 0; constants[i].type; i++) {
01441 switch(constants[i].type) {
01442 case SWIG_LUA_INT:
01443 lua_pushstring(L,constants[i].name);
01444 lua_pushnumber(L,(lua_Number)constants[i].lvalue);
01445 lua_rawset(L,-3);
01446 break;
01447 case SWIG_LUA_FLOAT:
01448 lua_pushstring(L,constants[i].name);
01449 lua_pushnumber(L,(lua_Number)constants[i].dvalue);
01450 lua_rawset(L,-3);
01451 break;
01452 case SWIG_LUA_CHAR:
01453 lua_pushstring(L,constants[i].name);
01454 lua_pushfstring(L,"%c",(char)constants[i].lvalue);
01455 lua_rawset(L,-3);
01456 break;
01457 case SWIG_LUA_STRING:
01458 lua_pushstring(L,constants[i].name);
01459 lua_pushstring(L,(char *) constants[i].pvalue);
01460 lua_rawset(L,-3);
01461 break;
01462 case SWIG_LUA_POINTER:
01463 lua_pushstring(L,constants[i].name);
01464 SWIG_NewPointerObj(L,constants[i].pvalue, *(constants[i]).ptype,0);
01465 lua_rawset(L,-3);
01466 break;
01467 case SWIG_LUA_BINARY:
01468 lua_pushstring(L,constants[i].name);
01469 SWIG_NewMemberObj(L,constants[i].pvalue,constants[i].lvalue,*(constants[i]).ptype);
01470 lua_rawset(L,-3);
01471 break;
01472 default:
01473 break;
01474 }
01475 }
01476 }
01477
01478
01479
01480
01481
01482 #ifndef SWIG_DOSTRING_FAIL
01483 #define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S)
01484 #endif
01485
01486
01487
01488
01489
01490 SWIGINTERN int
01491 SWIG_Lua_dostring(lua_State *L, const char* str) {
01492 int ok,top;
01493 if (str==0 || str[0]==0) return 0;
01494 top=lua_gettop(L);
01495 #if (defined(LUA_VERSION_NUM) && (LUA_VERSION_NUM>=501))
01496 ok=luaL_dostring(L,str);
01497 #else
01498 ok=lua_dostring(L,str);
01499 #endif
01500 if (ok!=0) {
01501 SWIG_DOSTRING_FAIL(lua_tostring(L,-1));
01502 }
01503 lua_settop(L,top);
01504 return ok;
01505 }
01506
01507 #ifdef __cplusplus
01508 }
01509 #endif
01510
01511
01512
01513
01514
01515
01516
01517
01518
01519
01520
01521 #ifdef SWIG_MODULE_CLIENTDATA_TYPE
01522
01523 SWIGRUNTIMEINLINE swig_type_info *
01524 SWIG_TypeQuery(SWIG_MODULE_CLIENTDATA_TYPE clientdata, const char *name) {
01525 swig_module_info *module = SWIG_GetModule(clientdata);
01526 return SWIG_TypeQueryModule(module, module, name);
01527 }
01528
01529 SWIGRUNTIMEINLINE swig_type_info *
01530 SWIG_MangledTypeQuery(SWIG_MODULE_CLIENTDATA_TYPE clientdata, const char *name) {
01531 swig_module_info *module = SWIG_GetModule(clientdata);
01532 return SWIG_MangledTypeQueryModule(module, module, name);
01533 }
01534
01535 #else
01536
01537 SWIGRUNTIMEINLINE swig_type_info *
01538 SWIG_TypeQuery(const char *name) {
01539 swig_module_info *module = SWIG_GetModule(NULL);
01540 return SWIG_TypeQueryModule(module, module, name);
01541 }
01542
01543 SWIGRUNTIMEINLINE swig_type_info *
01544 SWIG_MangledTypeQuery(const char *name) {
01545 swig_module_info *module = SWIG_GetModule(NULL);
01546 return SWIG_MangledTypeQueryModule(module, module, name);
01547 }
01548
01549 #endif