17#ifndef SWIGTEMPLATEDISAMBIGUATOR
18# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
19# define SWIGTEMPLATEDISAMBIGUATOR template
20# elif defined(__HP_aCC)
23# define SWIGTEMPLATEDISAMBIGUATOR template
25# define SWIGTEMPLATEDISAMBIGUATOR
31# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
32# define SWIGINLINE inline
41# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
42# define SWIGUNUSED __attribute__ ((__unused__))
47# define SWIGUNUSED __attribute__ ((__unused__))
53#ifndef SWIG_MSC_UNSUPPRESS_4505
55# pragma warning(disable : 4505)
61# define SWIGUNUSEDPARM(p)
63# define SWIGUNUSEDPARM(p) p SWIGUNUSED
69# define SWIGINTERN static SWIGUNUSED
73#ifndef SWIGINTERNINLINE
74# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
78#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
79# ifndef GCC_HASCLASSVISIBILITY
80# define GCC_HASCLASSVISIBILITY
85# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
86# if defined(STATIC_LINKED)
89# define SWIGEXPORT __declspec(dllexport)
92# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
93# define SWIGEXPORT __attribute__ ((visibility("default")))
102# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
103# define SWIGSTDCALL __stdcall
110#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
111# define _CRT_SECURE_NO_DEPRECATE
115#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
116# define _SCL_SECURE_NO_DEPRECATE
120#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
121# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
129#ifdef __INTEL_COMPILER
130# pragma warning disable 592
133#define SWIG_UnknownError -1
134#define SWIG_IOError -2
135#define SWIG_RuntimeError -3
136#define SWIG_IndexError -4
137#define SWIG_TypeError -5
138#define SWIG_DivisionByZero -6
139#define SWIG_OverflowError -7
140#define SWIG_SyntaxError -8
141#define SWIG_ValueError -9
142#define SWIG_SystemError -10
143#define SWIG_AttributeError -11
144#define SWIG_MemoryError -12
145#define SWIG_NullReferenceError -13
157#define SWIG_RUNTIME_VERSION "4"
160#ifdef SWIG_TYPE_TABLE
161# define SWIG_QUOTE_STRING(x) #x
162# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
163# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
165# define SWIG_TYPE_TABLE_NAME
178# define SWIGRUNTIME SWIGINTERN
181#ifndef SWIGRUNTIMEINLINE
182# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
186#ifndef SWIG_BUFFER_SIZE
187# define SWIG_BUFFER_SIZE 1024
191#define SWIG_POINTER_DISOWN 0x1
192#define SWIG_CAST_NEW_MEMORY 0x2
195#define SWIG_POINTER_OWN 0x1
278#define SWIG_ERROR (-1)
279#define SWIG_IsOK(r) (r >= 0)
280#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
283#define SWIG_CASTRANKLIMIT (1 << 8)
285#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
287#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
289#define SWIG_BADOBJ (SWIG_ERROR)
290#define SWIG_OLDOBJ (SWIG_OK)
291#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
292#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
294#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
295#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
296#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
297#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
298#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
299#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
302#if defined(SWIG_CASTRANK_MODE)
303# ifndef SWIG_TypeRank
304# define SWIG_TypeRank unsigned long
306# ifndef SWIG_MAXCASTRANK
307# define SWIG_MAXCASTRANK (2)
309# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
310# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
315 return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
318# define SWIG_AddCast(r) (r)
319# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
329typedef void *(*swig_converter_func)(
void *,
int *);
336 swig_dycast_func
dcast;
344 swig_type_info *
type;
346 struct swig_cast_info *
next;
347 struct swig_cast_info *
prev;
354 swig_type_info **
types;
356 struct swig_module_info *
next;
371 const char *f2,
const char *l2) {
372 for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
373 while ((*f1 ==
' ') && (f1 != l1)) ++f1;
374 while ((*f2 ==
' ') && (f2 != l2)) ++f2;
375 if (*f1 != *f2)
return (*f1 > *f2) ? 1 : -1;
377 return (
int)((l1 - f1) - (l2 - f2));
387 const char* te = tb + strlen(tb);
389 while (equiv != 0 && *ne) {
390 for (nb = ne; *ne; ++ne) {
391 if (*ne ==
'|')
break;
416 if (strcmp(iter->
type->
name, c) == 0) {
417 if (iter == ty->
cast)
443 if (iter->
type == from) {
444 if (iter == ty->
cast)
476 if (!ty || !ty->
dcast)
return ty;
477 while (ty && (ty->
dcast)) {
478 ty = (*ty->
dcast)(ptr);
502 if (!
type)
return NULL;
503 if (
type->str != NULL) {
504 const char *last_name =
type->str;
506 for (s =
type->str; *s; s++)
507 if (*s ==
'|') last_name = s+1;
555 size_t r = iter->
size - 1;
558 size_t i = (l + r) >> 1;
561 int compare = strcmp(
name, iname);
564 }
else if (compare < 0) {
570 }
else if (compare > 0) {
579 }
while (iter != end);
606 for (;
i < iter->
size; ++
i) {
611 }
while (iter != end);
623 static const char hex[17] =
"0123456789abcdef";
624 const unsigned char *u = (
unsigned char *) ptr;
625 const unsigned char *eu = u + sz;
626 for (; u != eu; ++u) {
627 unsigned char uu = *u;
628 *(c++) = hex[(uu & 0xf0) >> 4];
629 *(c++) = hex[uu & 0xf];
639 unsigned char *u = (
unsigned char *) ptr;
640 const unsigned char *eu = u + sz;
641 for (; u != eu; ++u) {
644 if ((d >=
'0') && (d <=
'9'))
645 uu = ((d -
'0') << 4);
646 else if ((d >=
'a') && (d <=
'f'))
647 uu = ((d - (
'a'-10)) << 4);
651 if ((d >=
'0') && (d <=
'9'))
653 else if ((d >=
'a') && (d <=
'f'))
654 uu |= (d - (
'a'-10));
668 if ((2*
sizeof(
void *) + 2) > bsz)
return 0;
671 if (strlen(
name) + 1 > (bsz - (r - buff)))
return 0;
679 if (strcmp(c,
"NULL") == 0) {
692 size_t lname = (
name ? strlen(
name) : 0);
693 if ((2*sz + 2 + lname) > bsz)
return 0;
697 strncpy(r,
name,lname+1);
707 if (strcmp(c,
"NULL") == 0) {
720#define SWIG_LUA_TARGET SWIG_LUA_FLAVOR_LUA
742#define SWIG_LUA_FLAVOR_LUA 1
743#define SWIG_LUA_FLAVOR_ELUA 2
744#define SWIG_LUA_FLAVOR_ELUAC 3
746#if !defined(SWIG_LUA_TARGET)
747# error SWIG_LUA_TARGET not defined
750#if defined(SWIG_LUA_ELUA_EMULATE)
752struct swig_elua_entry;
754typedef struct swig_elua_key {
762typedef struct swig_elua_val {
766 const struct swig_elua_entry *table;
768 lua_CFunction function;
773 swig_type_info **ptype;
778typedef struct swig_elua_entry {
783#define LSTRKEY(x) {LUA_TSTRING, {.strkey = x} }
784#define LNUMKEY(x) {LUA_TNUMBER, {.numkey = x} }
785#define LNILKEY {LUA_TNIL, {.strkey = 0} }
787#define LNUMVAL(x) {LUA_TNUMBER, {.number = x} }
788#define LFUNCVAL(x) {LUA_TFUNCTION, {.function = x} }
789#define LROVAL(x) {LUA_TTABLE, {.table = x} }
790#define LNILVAL {LUA_TNIL, {.string = 0} }
791#define LSTRVAL(x) {LUA_TSTRING, {.string = x} }
793#define LUA_REG_TYPE swig_elua_entry
795#define SWIG_LUA_ELUA_EMUL_METATABLE_KEY "__metatable"
797#define lua_pushrotable(L,p)\
800 SWIG_Lua_elua_emulate_register(L,(swig_elua_entry*)(p));
802#define SWIG_LUA_CONSTTAB_POINTER(B,C,D)\
803 LSTRKEY(B), {LUA_TUSERDATA, { .userdata={0,0,(void*)(C),&D} } }
805#define SWIG_LUA_CONSTTAB_BINARY(B,S,C,D)\
806 LSTRKEY(B), {LUA_TUSERDATA, { .userdata={1,S,(void*)(C),&D} } }
809#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
810# define SWIG_LUA_CONSTTAB_INT(B, C) LSTRKEY(B), LNUMVAL(C)
811# define SWIG_LUA_CONSTTAB_FLOAT(B, C) LSTRKEY(B), LNUMVAL(C)
812# define SWIG_LUA_CONSTTAB_STRING(B, C) LSTRKEY(B), LSTRVAL(C)
813# define SWIG_LUA_CONSTTAB_CHAR(B, C) LSTRKEY(B), LNUMVAL(C)
816#ifndef SWIG_LUA_CONSTTAB_POINTER
817#warning eLua does not support pointers as constants. By default, nil will be used as value
818#define SWIG_LUA_CONSTTAB_POINTER(B,C,D) LSTRKEY(B), LNILVAL
821#ifndef SWIG_LUA_CONSTTAB_BINARY
822#warning eLua does not support pointers to member as constants. By default, nil will be used as value
823#define SWIG_LUA_CONSTTAB_BINARY(B, S, C, D) LSTRKEY(B), LNILVAL
826# define SWIG_LUA_CONSTTAB_INT(B, C) SWIG_LUA_INT, (char *)B, (long)C, 0, 0, 0
827# define SWIG_LUA_CONSTTAB_FLOAT(B, C) SWIG_LUA_FLOAT, (char *)B, 0, (double)C, 0, 0
828# define SWIG_LUA_CONSTTAB_STRING(B, C) SWIG_LUA_STRING, (char *)B, 0, 0, (void *)C, 0
829# define SWIG_LUA_CONSTTAB_CHAR(B, C) SWIG_LUA_CHAR, (char *)B, (long)C, 0, 0, 0
830# define SWIG_LUA_CONSTTAB_POINTER(B,C,D)\
831 SWIG_LUA_POINTER, (char *)B, 0, 0, (void *)C, &D
832# define SWIG_LUA_CONSTTAB_BINARY(B, S, C, D)\
833 SWIG_LUA_BINARY, (char *)B, S, 0, (void *)C, &D
836#ifndef SWIG_LUA_ELUA_EMULATE
837#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
838# define LRO_STRVAL(v) {{.p = (char *) v}, LUA_TSTRING}
839# define LSTRVAL LRO_STRVAL
843#ifndef SWIG_LUA_ELUA_EMULATE
844#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
847#define MIN_OPT_LEVEL 2
866#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501
867# define lua_rawlen lua_strlen
868#elif LUA_VERSION_NUM == 501
869# define lua_rawlen lua_objlen
876#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
877# define lua_pushglobaltable(L) lua_pushvalue(L, LUA_GLOBALSINDEX)
881#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
882# define lua_absindex(L,i) ((i)>0 || (i) <= LUA_REGISTRYINDEX ? (i) : lua_gettop(L) + (i) + 1)
886#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
887#define lua_rawsetp(L,index,ptr)\
888 lua_pushlightuserdata(L,(void*)(ptr));\
892#define lua_rawgetp(L,index,ptr)\
893 lua_pushlightuserdata(L,(void*)(ptr));\
909 lua_pushstring (L, str);
922 lua_pushvfstring(L, fmt, argp);
932#define SWIG_LUA_INT 1
933#define SWIG_LUA_FLOAT 2
934#define SWIG_LUA_STRING 3
935#define SWIG_LUA_POINTER 4
936#define SWIG_LUA_BINARY 5
937#define SWIG_LUA_CHAR 6
946#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
966 lua_CFunction getmethod;
967 lua_CFunction setmethod;
985 swig_type_info **
type;
992 struct swig_lua_class **
bases;
999 swig_type_info *
type;
1016#define SWIG_NewPointerObj(L, ptr, type, owner) SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner)
1017#define SWIG_ConvertPtr(L,idx, ptr, type, flags) SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags)
1018#define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname) SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname)
1020#define SWIG_ConvertMember(L, idx, ptr, sz, ty) SWIG_Lua_ConvertPacked(L, idx, ptr, sz, ty)
1021#define SWIG_NewMemberObj(L, ptr, sz, type) SWIG_Lua_NewPackedObj(L, ptr, sz, type)
1024#define SWIG_GetModule(clientdata) SWIG_Lua_GetModule((lua_State*)(clientdata))
1025#define SWIG_SetModule(clientdata, pointer) SWIG_Lua_SetModule((lua_State*) (clientdata), pointer)
1026#define SWIG_MODULE_CLIENTDATA_TYPE lua_State*
1029#define SWIG_contract_assert(expr, msg) \
1030 if (!(expr)) { SWIG_Lua_pusherrstring(L, (char *) msg); goto fail; } else
1034#define SWIG_fail {goto fail;}
1035#define SWIG_fail_arg(func_name,argnum,type) \
1036 {SWIG_Lua_pushferrstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\
1037 func_name,argnum,type,SWIG_Lua_typename(L,argnum));\
1039#define SWIG_fail_ptr(func_name,argnum,type) \
1040 SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*")
1041#define SWIG_check_num_args(func_name,a,b) \
1042 if (lua_gettop(L)<a || lua_gettop(L)>b) \
1043 {SWIG_Lua_pushferrstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\
1047#define SWIG_Lua_get_table(L,n) \
1048 (lua_pushstring(L, n), lua_rawget(L,-2))
1050#define SWIG_Lua_add_function(L,n,f) \
1051 (lua_pushstring(L, n), \
1052 lua_pushcfunction(L, f), \
1055#define SWIG_Lua_add_boolean(L,n,b) \
1056 (lua_pushstring(L, n), \
1057 lua_pushboolean(L, b), \
1061#define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I))
1074 lua_rawget(L,LUA_REGISTRYINDEX);
1075 if (lua_islightuserdata(L,-1))
1085 lua_pushlightuserdata(L,(
void*)module);
1086 lua_rawset(L,LUA_REGISTRYINDEX);
1099#ifndef SWIGLUA_IGNORE_SET_IMMUTABLE
1101 luaL_error(L,
"This variable is immutable");
1106#ifdef SWIG_LUA_ELUA_EMULATE
1110static int swig_lua_elua_emulate_unique_key;
1113SWIGINTERN void SWIG_Lua_elua_emulate_register(lua_State *L,
const swig_elua_entry *table)
1115 int i, table_parsed, parsed_tables_array, target_table;
1116 assert(lua_istable(L,-1));
1117 target_table = lua_gettop(L);
1119 lua_rawgetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key);
1120 if(lua_isnil(L,-1)) {
1123 lua_pushvalue(L,-1);
1124 lua_rawsetp(L,LUA_REGISTRYINDEX,(
void*)(&swig_lua_elua_emulate_unique_key));
1126 parsed_tables_array = lua_gettop(L);
1127 lua_pushvalue(L,target_table);
1130 const int SWIGUNUSED pairs_start = lua_gettop(L);
1131 for(
i = 0;table[
i].key.type != LUA_TNIL || table[
i].value.type != LUA_TNIL;
i++)
1133 const swig_elua_entry *entry = table +
i;
1134 int is_metatable = 0;
1135 switch(entry->key.type) {
1137 lua_pushstring(L,entry->key.key.strkey);
1138 if(strcmp(entry->key.key.strkey, SWIG_LUA_ELUA_EMUL_METATABLE_KEY) == 0)
1142 lua_pushnumber(L,entry->key.key.numkey);
1150 switch(entry->value.type) {
1152 lua_pushstring(L,entry->value.value.string);
1155 lua_pushnumber(L,entry->value.value.number);
1158 lua_pushcfunction(L,entry->value.value.function);
1161 lua_rawgetp(L,parsed_tables_array, entry->value.value.table);
1162 table_parsed = !lua_isnil(L,-1);
1166 SWIG_Lua_elua_emulate_register(L,entry->value.value.table);
1169 assert(lua_istable(L,-1));
1170 lua_pushvalue(L,-1);
1171 lua_setmetatable(L,target_table);
1176 if(entry->value.value.userdata.member)
1178 entry->value.value.userdata.lvalue,
1179 *(entry->value.value.userdata.ptype));
1182 *(entry->value.value.userdata.ptype),0);
1190 assert(lua_gettop(L) == pairs_start + 2);
1191 lua_rawset(L,target_table);
1194 assert(lua_gettop(L) == target_table);
1197SWIGINTERN void SWIG_Lua_elua_emulate_register_clear(lua_State *L)
1200 lua_rawsetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key);
1205SWIGINTERN int SWIG_Lua_emulate_elua_getmetatable(lua_State *L)
1209 lua_getfield(L,-1,
"lua_getmetatable");
1211 assert(!lua_isnil(L,-1));
1213 assert(lua_gettop(L) == 3);
1215 if(!lua_isnil(L,-1))
1218 assert(lua_gettop(L) == 2);
1219 if(lua_istable(L,-2)) {
1221 lua_getfield(L,-1, SWIG_LUA_ELUA_EMUL_METATABLE_KEY);
1223 assert(lua_gettop(L) == 2);
1231SWIGINTERN void SWIG_Lua_emulate_elua_swap_getmetatable(lua_State *L)
1235 lua_pushstring(L,
"lua_getmetatable");
1236 lua_getfield(L,-2,
"getmetatable");
1237 assert(!lua_isnil(L,-1));
1239 lua_pushstring(L,
"getmetatable");
1240 lua_pushcfunction(L, SWIG_Lua_emulate_elua_getmetatable);
1258 assert(lua_istable(L,-2));
1259 lua_getmetatable(L,-2);
1260 assert(lua_istable(L,-1));
1262 assert(lua_istable(L,-1));
1267 if (lua_iscfunction(L,-1))
1276 assert(lua_istable(L,-1));
1280 if (lua_isfunction(L,-1))
1297 assert(lua_istable(L,1));
1298 lua_getmetatable(L,1);
1299 assert(lua_istable(L,-1));
1302 if (lua_istable(L,-1))
1307 if (lua_iscfunction(L,-1))
1321#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
1331 assert(lua_istable(L,-1));
1338 lua_getmetatable(L,-1);
1356 assert(lua_istable(L,-1));
1360 if( classes != 0 ) {
1361 while(*classes != 0) {
1378 assert(lua_istable(L,-1));
1379 lua_checkstack(L,5);
1384 lua_pushstring(L,
".get");
1388 lua_pushstring(L,
".set");
1392 lua_pushstring(L,
".fn");
1400 lua_setmetatable(L,-2);
1408 if( sub_namespace != 0) {
1409 while(*sub_namespace != 0) {
1417 lua_pushstring(L,ns->
name);
1418 lua_pushvalue(L,-2);
1421 assert(lua_gettop(L) == begin+1);
1438 int last_arg = lua_gettop(L);
1439 int original_metatable = last_arg + 1;
1444 lua_getmetatable(L,first_arg);
1447#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
1449 assert(lua_istable(L,-1));
1451 bases_table = lua_gettop(L);
1455 assert(swig_type!=0);
1460 for(;base_names[bases_count];
1471 int subcall_last_arg;
1472 int subcall_first_arg = lua_gettop(L) + 1;
1475 for(j=first_arg;j<=last_arg;j++)
1477 subcall_last_arg = lua_gettop(L);
1480 for(
i=0;
i<bases_count;
i++) {
1482#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
1483 lua_rawgeti(L,bases_table,
i+1);
1485 if(lua_isnil(L,-1)) {
1499 assert(base_swig_type != 0);
1505 assert(lua_isuserdata(L, subcall_first_arg));
1506 assert(lua_istable(L,-1));
1507 lua_setmetatable(L,subcall_first_arg);
1508 assert(lua_gettop(L) == subcall_last_arg);
1509 result = func(L, base_swig_type,subcall_first_arg, ret);
1515 lua_pushvalue(L,original_metatable);
1516 lua_setmetatable(L,first_arg);
1518 to_remove = subcall_last_arg - last_arg;
1519 for(j=0;j<to_remove;j++)
1520 lua_remove(L,last_arg+1);
1523 lua_pop(L, lua_gettop(L) - last_arg);
1525 if(ret) assert(lua_gettop(L) == last_arg + *ret);
1539 int bases_search_result;
1540 int substack_start = lua_gettop(L)-2;
1541 assert(first_arg == substack_start+1);
1542 lua_checkstack(L,5);
1543 assert(lua_isuserdata(L,-2));
1544 lua_getmetatable(L,-2);
1545 assert(lua_istable(L,-1));
1547 assert(lua_istable(L,-1));
1549 lua_pushvalue(L,substack_start+2);
1552 if (lua_iscfunction(L,-1))
1554 lua_pushvalue(L,substack_start+1);
1564 assert(lua_istable(L,-1));
1565 lua_pushvalue(L,substack_start+2);
1568 if (lua_isfunction(L,-1))
1579 if (lua_iscfunction(L,-1))
1581 lua_pushvalue(L,substack_start+1);
1582 lua_pushvalue(L,substack_start+2);
1593 return bases_search_result;
1608 assert(lua_isuserdata(L,1));
1629 int bases_search_result;
1630 int substack_start = lua_gettop(L) - 3;
1631 lua_checkstack(L,5);
1632 assert(lua_isuserdata(L,substack_start+1));
1633 lua_getmetatable(L,substack_start+1);
1634 assert(lua_istable(L,-1));
1639 if (lua_istable(L,-1))
1642 lua_pushvalue(L,substack_start+2);
1645 if (lua_iscfunction(L,-1))
1647 lua_pushvalue(L,substack_start+1);
1648 lua_pushvalue(L,substack_start+3);
1650 lua_remove(L,substack_start+4);
1660 if (lua_iscfunction(L,-1))
1662 lua_pushvalue(L,substack_start+1);
1663 lua_pushvalue(L,substack_start+2);
1664 lua_pushvalue(L,substack_start+3);
1676 assert(lua_gettop(L) == substack_start + 3);
1677 return bases_search_result;
1694 assert(lua_isuserdata(L,1));
1699 SWIG_Lua_pushferrstring(L,
"Assignment not possible. No setter/member with this name. For custom assignments implement __setitem method.");
1714 assert(lua_isuserdata(L,-1));
1733 const char *className;
1735 assert(lua_isuserdata(L,1));
1736 userData = lua_touserdata(L,1);
1737 lua_getmetatable(L,1);
1738 assert(lua_istable(L,-1));
1740 lua_getfield(L, -1,
".type");
1741 className = lua_tostring(L, -1);
1743 lua_pushfstring(L,
"<%s userdata: %p>", className, userData);
1753 assert(lua_isuserdata(L,-1));
1767 if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2))
1772 result=(usr1->
ptr==usr2->
ptr);
1773 lua_pushboolean(L,result);
1801 lua_pushstring(L,
"SWIG");
1806 lua_pushstring(L,
".library");
1810 lua_pushstring(L,
"inheritable_metamethods");
1818 lua_rawset(L,LUA_REGISTRYINDEX);
1825 lua_pushstring(L,
"SWIG");
1826 lua_rawget(L,LUA_REGISTRYINDEX);
1827 if (!lua_istable(L,-1))
1832 lua_pushstring(L,
"SWIG");
1833 lua_rawget(L,LUA_REGISTRYINDEX);
1840 lua_pushstring(L,
".library");
1842 assert( !lua_isnil(L,-1) );
1843 lua_pushstring(L,
"inheritable_metamethods");
1855 lua_pushstring(L,cname);
1882#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
1884SWIGINTERN void SWIG_Lua_merge_tables_by_index(lua_State *L,
int target,
int source)
1888 while (lua_next(L,source) != 0) {
1891 lua_pushvalue(L,-2);
1892 lua_pushvalue(L,-2);
1893 lua_rawset(L, target);
1900SWIGINTERN void SWIG_Lua_merge_tables(lua_State *L,
const char*
name,
int original,
int base)
1903 lua_pushstring(L,
name);
1904 lua_rawget(L,original);
1905 int original_table = lua_gettop(L);
1906 lua_pushstring(L,
name);
1908 int base_table = lua_gettop(L);
1909 SWIG_Lua_merge_tables_by_index(L, original_table, base_table);
1918 assert(lua_istable(L,-1));
1919 int original = lua_gettop(L);
1921 int base = lua_gettop(L);
1922 SWIG_Lua_merge_tables(L,
".fn", original, base );
1923 SWIG_Lua_merge_tables(L,
".set", original, base );
1924 SWIG_Lua_merge_tables(L,
".get", original, base );
1941 SWIG_Lua_class_squash_base(L, clss->
bases[
i]);
1947#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
1951 assert(lua_istable(L,-1));
1953 assert(lua_istable(L,-1));
1959 assert(lua_istable(L,-1));
1970 assert(lua_istable(L,-1));
1986 size_t bases_count = 0;
1989 assert(lua_istable(L,-1));
1994 assert(lua_istable(L,-1));
1995 lua_rawseti(L,-2,
i+1);
2006 assert(lua_istable(L,-1));
2021#if !defined(SWIG_LUA_SQUASH_BASES)
2063 lua_pushvalue(L, metamethod_name_idx);
2092 int metamethod_name_idx;
2096 lua_checkstack(L,5);
2097 numargs = lua_gettop(L);
2100 lua_pushvalue(L, lua_upvalueindex(1));
2101 metamethod_name_idx = lua_gettop(L);
2103 lua_pushvalue(L, lua_upvalueindex(2));
2110 SWIG_Lua_pushferrstring(L,
"The metamethod proxy is set, but it failed to find actual metamethod. Memory corruption is most likely explanation.");
2117 lua_call(L, numargs, LUA_MULTRET);
2118 return lua_gettop(L);
2133 assert(lua_isstring(L,-1));
2135 key_index = lua_gettop(L);
2138 lua_pushvalue(L,key_index);
2139 lua_gettable(L,metatable_index);
2140 if( !lua_isnil(L,-1) ) {
2151 lua_pushvalue(L, key_index);
2153 if( !lua_isnil(L,-1) ) {
2154 lua_pushvalue(L, key_index);
2157 lua_pushvalue(L, key_index);
2158 lua_pushlightuserdata(L, clss);
2161 lua_rawset(L, metatable_index);
2176 int metatable_index;
2177 int metamethods_info_index;
2178 int tostring_undefined;
2179 int eq_undefined = 0;
2182 metatable_index = lua_gettop(L);
2184 assert(lua_istable(L,-1));
2185 metamethods_info_index = lua_gettop(L);
2187 while(lua_next(L, metamethods_info_index) != 0 ) {
2189 const int is_inheritable = lua_toboolean(L,-2);
2192 if(is_inheritable) {
2200 lua_pushstring(L,
"__tostring");
2201 lua_pushvalue(L,-1);
2202 lua_rawget(L,metatable_index);
2203 tostring_undefined = lua_isnil(L,-1);
2205 if( tostring_undefined ) {
2207 lua_rawset(L, metatable_index);
2213 lua_pushstring(L,
"__eq");
2214 lua_pushvalue(L,-1);
2215 lua_rawget(L,metatable_index);
2216 eq_undefined = lua_isnil(L,-1);
2218 if( eq_undefined ) {
2220 lua_rawset(L, metatable_index);
2234 lua_checkstack(L,5);
2235 assert(lua_istable(L,-1));
2240 assert(lua_istable(L,-1));
2248 lua_getmetatable(L,-1);
2249 assert(lua_istable(L,-1));
2254 assert(lua_istable(L,-1));
2259 assert( lua_gettop(L) == begin );
2271 lua_pushstring(L,clss->
fqname);
2273 if(!lua_isnil(L,-1)) {
2275 assert(lua_gettop(L)==begin);
2286 lua_pushstring(L,clss->
fqname);
2288#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
2300 SWIG_Lua_merge_tables_by_index(L,new_metatable_index, base_metatable);
2307 lua_pushstring(L,
".type");
2308 lua_pushstring(L,clss->
fqname);
2311 lua_pushstring(L,
".bases");
2315 lua_pushstring(L,
".get");
2319 lua_pushstring(L,
".set");
2323 lua_pushstring(L,
".fn");
2335 assert(lua_gettop(L) == begin);
2337#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
2339 SWIG_Lua_class_squash_bases(L,clss);
2344 assert( lua_gettop(L) == begin );
2350 assert(lua_istable(L,-1));
2364 begin = lua_gettop(L);
2367 assert(lua_istable(L,-1));
2368 lua_getmetatable(L,-1);
2369 assert(lua_istable(L,-1));
2370 lua_pushstring(L,
".instance");
2373 assert(lua_istable(L,-1));
2374 lua_pushstring(L,
".static");
2375 lua_pushvalue(L, -4);
2376 assert(lua_istable(L,-1));
2380 assert(lua_gettop(L) == begin);
2384#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
2391 lua_pushstring(L,clss->
fqname);
2393 if(!lua_isnil(L,-1)) {
2395 assert(lua_gettop(L)==begin);
2402 SWIG_Lua_elua_class_register_instance(L,clss->
bases[
i]);
2406 lua_pushstring(L,clss->
fqname);
2408 lua_pushrotable(L, (
void*)(clss->
metatable));
2411 assert(lua_gettop(L) == begin);
2422 if (
type->clientdata)
2425 if (lua_istable(L,-1))
2427 lua_setmetatable(L,-2);
2448#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
2485 int argnum,
const char *func_name){
2488 luaL_error (L,
"Error in %s, expected a %s at argument number %d\n",
2489 func_name,(
type &&
type->str)?
type->str:
"void*",argnum);
2524 if (lua_isuserdata(L,tp))
2529 return "userdata (unknown type)";
2531 return lua_typename(L,lua_type(L,tp));
2545#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
2550 for (
i = 0; constants[
i].
type;
i++) {
2551 switch(constants[
i].
type) {
2553 lua_pushstring(L,constants[
i].
name);
2554 lua_pushinteger(L,(lua_Number)constants[
i].lvalue);
2558 lua_pushstring(L,constants[
i].
name);
2559 lua_pushnumber(L,(lua_Number)constants[
i].dvalue);
2563 lua_pushstring(L,constants[
i].
name);
2566 lua_pushlstring(L,&c,1);
2571 lua_pushstring(L,constants[
i].
name);
2572 lua_pushstring(L,(
char *) constants[
i].pvalue);
2576 lua_pushstring(L,constants[
i].
name);
2581 lua_pushstring(L,constants[
i].
name);
2596#ifndef SWIG_DOSTRING_FAIL
2597#define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S)
2607 if (str==0 || str[0]==0)
return 0;
2609#if (defined(LUA_VERSION_NUM) && (LUA_VERSION_NUM>=501))
2610 ok=luaL_dostring(L,str);
2612 ok=lua_dostring(L,str);
2635#ifdef SWIG_MODULE_CLIENTDATA_TYPE
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
QGL_EXTERN void(APIENTRY *qglActiveTexture)(GLenum texture)
QGL_EXTERN GLsizei const GLvoid * data
QGL_EXTERN GLint GLenum type
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
struct swig_cast_info * prev
struct swig_cast_info * next
swig_converter_func converter
swig_lua_method * metatable
struct swig_lua_class ** bases
swig_lua_namespace * cls_static
lua_CFunction constructor
swig_lua_method * methods
swig_lua_attribute * attributes
void(* destructor)(void *)
swig_lua_attribute * ns_attributes
swig_lua_const_info * ns_constants
struct swig_lua_class ** ns_classes
swig_lua_method * ns_methods
struct swig_lua_namespace ** ns_namespaces
swig_cast_info ** cast_initial
swig_type_info ** type_initial
struct swig_module_info * next
struct swig_cast_info * cast
SWIGRUNTIME int SWIG_Lua_class_equal(lua_State *L)
SWIGRUNTIME void * SWIG_Lua_MustGetPtr(lua_State *L, int index, swig_type_info *type, int flags, int argnum, const char *func_name)
#define SWIG_DOSTRING_FAIL(S)
SWIGRUNTIME swig_cast_info * SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty)
SWIGRUNTIME int SWIG_Lua_ConvertPtr(lua_State *L, int index, void **ptr, swig_type_info *type, int flags)
SWIGRUNTIME void SWIG_Lua_SetModule(lua_State *L, swig_module_info *module)
SWIGINTERN int SWIG_Lua_do_resolve_metamethod(lua_State *L, const swig_lua_class *clss, int metamethod_name_idx, int skip_check)
SWIGRUNTIME void SWIG_Lua_pusherrstring(lua_State *L, const char *str)
SWIGINTERN int SWIG_Lua_class_do_get(lua_State *L, swig_type_info *type, int SWIGUNUSED first_arg, int *ret)
SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L)
SWIGINTERN void SWIG_Lua_add_namespace_classes(lua_State *L, swig_lua_namespace *ns)
#define SWIG_CheckState(r)
#define SWIG_NewMemberObj(L, ptr, sz, type)
SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class *clss)
SWIGRUNTIME int SWIG_TypeEquiv(const char *nb, const char *tb)
SWIGINTERN void SWIG_Lua_class_register_static(lua_State *L, swig_lua_class *clss)
SWIGRUNTIME const char * SWIG_Lua_typename(lua_State *L, int tp)
SWIGRUNTIME int SWIG_TypeNameComp(const char *f1, const char *l1, const char *f2, const char *l2)
SWIGRUNTIME int SWIG_Lua_ConvertPacked(lua_State *L, int index, void *ptr, size_t size, swig_type_info *type)
SWIGINTERN int SWIG_Lua_iterate_bases(lua_State *L, swig_type_info *SWIGUNUSED swig_type, int first_arg, swig_lua_base_iterator_func func, int *const ret)
#define SWIG_ConvertPtr(L, idx, ptr, type, flags)
SWIGINTERN int SWIG_Lua_dostring(lua_State *L, const char *str)
#define SWIG_Lua_get_table(L, n)
SWIGRUNTIME void SWIG_TypeClientData(swig_type_info *ti, void *clientdata)
SWIGRUNTIME swig_type_info * SWIG_TypeQueryModule(swig_module_info *start, swig_module_info *end, const char *name)
#define SWIG_Lua_add_function(L, n, f)
SWIGRUNTIME char * SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz)
SWIGINTERN int SWIG_Lua_add_class_user_metamethod(lua_State *L, swig_lua_class *clss, const int metatable_index)
SWIGINTERN void SWIG_Lua_populate_inheritable_metamethods(lua_State *L)
SWIGRUNTIME const char * SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name)
SWIGRUNTIME swig_type_info * SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr)
SWIGRUNTIME swig_module_info * SWIG_Lua_GetModule(lua_State *L)
#define lua_rawsetp(L, index, ptr)
SWIGRUNTIME void SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata)
SWIGRUNTIME int SWIG_TypeCmp(const char *nb, const char *tb)
SWIGRUNTIME const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz)
SWIGINTERN void SWIG_Lua_get_inheritable_metamethods(lua_State *L)
void *(* swig_converter_func)(void *, int *)
SWIGINTERN void SWIG_Lua_add_variable(lua_State *L, const char *name, lua_CFunction getFn, lua_CFunction setFn)
#define SWIG_check_num_args(func_name, a, b)
SWIGINTERN int SWIG_Lua_namespace_get(lua_State *L)
SWIGINTERN int SWIG_Lua_class_get(lua_State *L)
SWIGRUNTIME int SWIG_Lua_type(lua_State *L)
SWIGINTERN void SWIG_Lua_namespace_register(lua_State *L, swig_lua_namespace *ns, int reg)
SWIGINTERN void SWIG_Lua_get_class_registry(lua_State *L)
SWIGINTERN void SWIG_Lua_add_class_static_details(lua_State *L, swig_lua_class *clss)
#define SWIG_NewPointerObj(L, ptr, type, owner)
SWIGINTERN void SWIG_Lua_AddMetatable(lua_State *L, swig_type_info *type)
SWIGRUNTIME swig_type_info * SWIG_MangledTypeQueryModule(swig_module_info *start, swig_module_info *end, const char *name)
SWIGINTERN void SWIG_Lua_class_register(lua_State *L, swig_lua_class *clss)
SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State *L, void *ptr, swig_type_info *type, int own)
SWIGRUNTIME const char * SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name)
SWIGINTERN int SWIG_Lua_set_immutable(lua_State *L)
#define lua_absindex(L, i)
SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State *L, swig_lua_namespace *ns)
SWIGRUNTIMEINLINE const char * SWIG_TypeName(const swig_type_info *ty)
SWIGINTERN int SWIG_Lua_namespace_set(lua_State *L)
SWIGINTERN int SWIG_Lua_class_disown(lua_State *L)
SWIGRUNTIME char * SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz)
SWIGINTERN void SWIG_Lua_class_register_instance(lua_State *L, swig_lua_class *clss)
SWIGRUNTIME char * SWIG_PackData(char *c, void *ptr, size_t sz)
SWIGINTERN int SWIG_Lua_class_do_set(lua_State *L, swig_type_info *type, int first_arg, int *ret)
SWIGINTERN int SWIG_Lua_class_set(lua_State *L)
#define SWIG_GetModule(clientdata)
SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State *L, void *ptr, size_t size, swig_type_info *type)
SWIGINTERN int SWIG_Lua_class_destruct(lua_State *L)
#define lua_pushglobaltable(L)
SWIGRUNTIME const char * SWIG_TypePrettyName(const swig_type_info *type)
SWIGRUNTIME swig_cast_info * SWIG_TypeCheck(const char *c, swig_type_info *ty)
SWIGINTERN void SWIG_Lua_init_base_class(lua_State *L, swig_lua_class *clss)
SWIGINTERN void SWIG_Lua_create_class_registry(lua_State *L)
SWIGRUNTIME void SWIG_Lua_pushferrstring(lua_State *L, const char *fmt,...)
SWIGINTERN int SWIG_Lua_class_tostring(lua_State *L)
SWIGINTERN void SWIG_Lua_InstallConstants(lua_State *L, swig_lua_const_info constants[])
SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State *L, const char *cname)
SWIGINTERN void SWIG_Lua_add_class_instance_details(lua_State *L, swig_lua_class *clss)
#define SWIG_Lua_add_boolean(L, n, b)
#define lua_rawgetp(L, index, ptr)
SWIGRUNTIMEINLINE void * SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory)
SWIGRUNTIME int SWIG_Lua_class_equal(lua_State *L)
#define SWIG_MangledTypeQuery(name)
#define SWIG_TypeQuery(name)
SWIGINTERN int SWIG_Lua_class_do_get(lua_State *L, swig_type_info *type, int SWIGUNUSED first_arg, int *ret)
SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L)
SWIGRUNTIME int SWIG_TypeEquiv(const char *nb, const char *tb)
#define SWIG_RUNTIME_VERSION
#define SWIG_MODULE_CLIENTDATA_TYPE
SWIGINTERN int SWIG_Lua_namespace_get(lua_State *L)
SWIGINTERN int SWIG_Lua_class_get(lua_State *L)
#define SWIG_POINTER_DISOWN
SWIGINTERN int SWIG_Lua_namespace_set(lua_State *L)
SWIGINTERN int SWIG_Lua_class_disown(lua_State *L)
SWIGINTERN int SWIG_Lua_class_do_set(lua_State *L, swig_type_info *type, int first_arg, int *ret)
SWIGINTERN int SWIG_Lua_class_set(lua_State *L)
SWIGINTERN int SWIG_Lua_class_destruct(lua_State *L)
#define SWIG_TYPE_TABLE_NAME
int(* swig_lua_base_iterator_func)(lua_State *, swig_type_info *, int, int *ret)
SWIGINTERN int SWIG_Lua_class_tostring(lua_State *L)
#define SWIGRUNTIMEINLINE