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
40 # if defined(__GNUC__)
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
54 # if defined(_MSC_VER)
55 # pragma warning(disable : 4505)
59 #ifndef SWIGUNUSEDPARM
61 # define SWIGUNUSEDPARM(p)
63 # define SWIGUNUSEDPARM(p) p SWIGUNUSED
69 # define SWIGINTERN static SWIGUNUSED
73 #ifndef SWIGINTERNINLINE
74 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
79 # if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
80 # ifndef GCC_HASCLASSVISIBILITY
81 # define GCC_HASCLASSVISIBILITY
87 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
88 # if defined(STATIC_LINKED)
91 # define SWIGEXPORT __declspec(dllexport)
94 # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
95 # define SWIGEXPORT __attribute__ ((visibility("default")))
104 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
105 # define SWIGSTDCALL __stdcall
112 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
113 # define _CRT_SECURE_NO_DEPRECATE
117 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
118 # define _SCL_SECURE_NO_DEPRECATE
122 #if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
123 # define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
131 #ifdef __INTEL_COMPILER
132 # pragma warning disable 592
135 #define SWIG_UnknownError -1
136 #define SWIG_IOError -2
137 #define SWIG_RuntimeError -3
138 #define SWIG_IndexError -4
139 #define SWIG_TypeError -5
140 #define SWIG_DivisionByZero -6
141 #define SWIG_OverflowError -7
142 #define SWIG_SyntaxError -8
143 #define SWIG_ValueError -9
144 #define SWIG_SystemError -10
145 #define SWIG_AttributeError -11
146 #define SWIG_MemoryError -12
147 #define SWIG_NullReferenceError -13
159 #define SWIG_RUNTIME_VERSION "4"
162 #ifdef SWIG_TYPE_TABLE
163 # define SWIG_QUOTE_STRING(x) #x
164 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
165 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
167 # define SWIG_TYPE_TABLE_NAME
180 # define SWIGRUNTIME SWIGINTERN
183 #ifndef SWIGRUNTIMEINLINE
184 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
188 #ifndef SWIG_BUFFER_SIZE
189 # define SWIG_BUFFER_SIZE 1024
193 #define SWIG_POINTER_DISOWN 0x1
194 #define SWIG_CAST_NEW_MEMORY 0x2
195 #define SWIG_POINTER_NO_NULL 0x4
198 #define SWIG_POINTER_OWN 0x1
281 #define SWIG_ERROR (-1)
282 #define SWIG_IsOK(r) (r >= 0)
283 #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
286 #define SWIG_CASTRANKLIMIT (1 << 8)
288 #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
290 #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
292 #define SWIG_BADOBJ (SWIG_ERROR)
293 #define SWIG_OLDOBJ (SWIG_OK)
294 #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
295 #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
297 #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
298 #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
299 #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
300 #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
301 #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
302 #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
305 #if defined(SWIG_CASTRANK_MODE)
306 # ifndef SWIG_TypeRank
307 # define SWIG_TypeRank unsigned long
309 # ifndef SWIG_MAXCASTRANK
310 # define SWIG_MAXCASTRANK (2)
312 # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
313 # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
318 return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
321 # define SWIG_AddCast(r) (r)
322 # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
332 typedef void *(*swig_converter_func)(
void *,
int *);
374 const char *f2,
const char *l2) {
375 for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
376 while ((*f1 ==
' ') && (f1 != l1)) ++f1;
377 while ((*f2 ==
' ') && (f2 != l2)) ++f2;
378 if (*f1 != *f2)
return (*f1 > *f2) ? 1 : -1;
380 return (
int)((l1 - f1) - (l2 - f2));
390 const char* te = tb + strlen(tb);
392 while (equiv != 0 && *ne) {
393 for (nb = ne; *ne; ++ne) {
394 if (*ne ==
'|')
break;
419 if (strcmp(iter->
type->
name, c) == 0) {
420 if (iter == ty->
cast)
446 if (iter->
type == from) {
447 if (iter == ty->
cast)
479 if (!ty || !ty->
dcast)
return ty;
480 while (ty && (ty->
dcast)) {
481 ty = (*ty->
dcast)(ptr);
505 if (!type)
return NULL;
506 if (type->
str != NULL) {
507 const char *last_name = type->
str;
509 for (s = type->
str; *s; s++)
510 if (*s ==
'|') last_name = s+1;
558 size_t r = iter->
size - 1;
561 size_t i = (l + r) >> 1;
562 const char *iname = iter->
types[i]->
name;
564 int compare = strcmp(name, iname);
566 return iter->
types[i];
567 }
else if (compare < 0) {
573 }
else if (compare > 0) {
582 }
while (iter != end);
609 for (; i < iter->
size; ++i) {
611 return iter->
types[i];
614 }
while (iter != end);
626 static const char hex[17] =
"0123456789abcdef";
627 const unsigned char *u = (
unsigned char *) ptr;
628 const unsigned char *eu = u + sz;
629 for (; u != eu; ++u) {
630 unsigned char uu = *u;
631 *(c++) = hex[(uu & 0xf0) >> 4];
632 *(c++) = hex[uu & 0xf];
642 unsigned char *u = (
unsigned char *) ptr;
643 const unsigned char *eu = u + sz;
644 for (; u != eu; ++u) {
647 if ((d >=
'0') && (d <=
'9'))
648 uu = (
unsigned char)((d -
'0') << 4);
649 else if ((d >=
'a') && (d <=
'f'))
650 uu = (
unsigned char)((d - (
'a'-10)) << 4);
654 if ((d >=
'0') && (d <=
'9'))
655 uu |= (
unsigned char)(d -
'0');
656 else if ((d >=
'a') && (d <=
'f'))
657 uu |= (
unsigned char)(d - (
'a'-10));
671 if ((2*
sizeof(
void *) + 2) > bsz)
return 0;
674 if (strlen(name) + 1 > (bsz - (r - buff)))
return 0;
682 if (strcmp(c,
"NULL") == 0) {
695 size_t lname = (name ? strlen(name) : 0);
696 if ((2*sz + 2 + lname) > bsz)
return 0;
700 strncpy(r,name,lname+1);
710 if (strcmp(c,
"NULL") == 0) {
723 #define SWIG_LUA_TARGET SWIG_LUA_FLAVOR_LUA
745 #define SWIG_LUA_FLAVOR_LUA 1
746 #define SWIG_LUA_FLAVOR_ELUA 2
747 #define SWIG_LUA_FLAVOR_ELUAC 3
749 #if !defined(SWIG_LUA_TARGET)
750 # error SWIG_LUA_TARGET not defined
753 #if defined(SWIG_LUA_ELUA_EMULATE)
755 struct swig_elua_entry;
757 typedef struct swig_elua_key {
765 typedef struct swig_elua_val {
769 const struct swig_elua_entry *table;
771 lua_CFunction
function;
781 typedef struct swig_elua_entry {
786 #define LSTRKEY(x) {LUA_TSTRING, {.strkey = x} }
787 #define LNUMKEY(x) {LUA_TNUMBER, {.numkey = x} }
788 #define LNILKEY {LUA_TNIL, {.strkey = 0} }
790 #define LNUMVAL(x) {LUA_TNUMBER, {.number = x} }
791 #define LFUNCVAL(x) {LUA_TFUNCTION, {.function = x} }
792 #define LROVAL(x) {LUA_TTABLE, {.table = x} }
793 #define LNILVAL {LUA_TNIL, {.string = 0} }
794 #define LSTRVAL(x) {LUA_TSTRING, {.string = x} }
796 #define LUA_REG_TYPE swig_elua_entry
798 #define SWIG_LUA_ELUA_EMUL_METATABLE_KEY "__metatable"
800 #define lua_pushrotable(L,p)\
803 SWIG_Lua_elua_emulate_register(L,(swig_elua_entry*)(p));
805 #define SWIG_LUA_CONSTTAB_POINTER(B,C,D)\
806 LSTRKEY(B), {LUA_TUSERDATA, { .userdata={0,0,(void*)(C),&D} } }
808 #define SWIG_LUA_CONSTTAB_BINARY(B,S,C,D)\
809 LSTRKEY(B), {LUA_TUSERDATA, { .userdata={1,S,(void*)(C),&D} } }
812 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
813 # define SWIG_LUA_CONSTTAB_INT(B, C) LSTRKEY(B), LNUMVAL(C)
814 # define SWIG_LUA_CONSTTAB_FLOAT(B, C) LSTRKEY(B), LNUMVAL(C)
815 # define SWIG_LUA_CONSTTAB_STRING(B, C) LSTRKEY(B), LSTRVAL(C)
816 # define SWIG_LUA_CONSTTAB_CHAR(B, C) LSTRKEY(B), LNUMVAL(C)
819 #ifndef SWIG_LUA_CONSTTAB_POINTER
820 #warning eLua does not support pointers as constants. By default, nil will be used as value
821 #define SWIG_LUA_CONSTTAB_POINTER(B,C,D) LSTRKEY(B), LNILVAL
824 #ifndef SWIG_LUA_CONSTTAB_BINARY
825 #warning eLua does not support pointers to member as constants. By default, nil will be used as value
826 #define SWIG_LUA_CONSTTAB_BINARY(B, S, C, D) LSTRKEY(B), LNILVAL
829 # define SWIG_LUA_CONSTTAB_INT(B, C) SWIG_LUA_INT, (char *)B, (long)C, 0, 0, 0
830 # define SWIG_LUA_CONSTTAB_FLOAT(B, C) SWIG_LUA_FLOAT, (char *)B, 0, (double)C, 0, 0
831 # define SWIG_LUA_CONSTTAB_STRING(B, C) SWIG_LUA_STRING, (char *)B, 0, 0, (void *)C, 0
832 # define SWIG_LUA_CONSTTAB_CHAR(B, C) SWIG_LUA_CHAR, (char *)B, (long)C, 0, 0, 0
833 # define SWIG_LUA_CONSTTAB_POINTER(B,C,D)\
834 SWIG_LUA_POINTER, (char *)B, 0, 0, (void *)C, &D
835 # define SWIG_LUA_CONSTTAB_BINARY(B, S, C, D)\
836 SWIG_LUA_BINARY, (char *)B, S, 0, (void *)C, &D
839 #ifndef SWIG_LUA_ELUA_EMULATE
840 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
841 # define LRO_STRVAL(v) {{.p = (char *) v}, LUA_TSTRING}
842 # define LSTRVAL LRO_STRVAL
846 #ifndef SWIG_LUA_ELUA_EMULATE
847 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
849 #ifndef MIN_OPT_LEVEL
850 #define MIN_OPT_LEVEL 2
854 #include "lrotable.h"
869 #if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501
870 # define lua_rawlen lua_strlen
871 #elif LUA_VERSION_NUM == 501
872 # define lua_rawlen lua_objlen
879 #if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
880 # define lua_pushglobaltable(L) lua_pushvalue(L, LUA_GLOBALSINDEX)
884 #if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
885 # define lua_absindex(L,i) ((i)>0 || (i) <= LUA_REGISTRYINDEX ? (i) : lua_gettop(L) + (i) + 1)
889 #if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
890 #define lua_rawsetp(L,index,ptr)\
891 lua_pushlightuserdata(L,(void*)(ptr));\
895 #define lua_rawgetp(L,index,ptr)\
896 lua_pushlightuserdata(L,(void*)(ptr));\
912 lua_pushstring (L, str);
925 lua_pushvfstring(L, fmt, argp);
935 #define SWIG_LUA_INT 1
936 #define SWIG_LUA_FLOAT 2
937 #define SWIG_LUA_STRING 3
938 #define SWIG_LUA_POINTER 4
939 #define SWIG_LUA_BINARY 5
940 #define SWIG_LUA_CHAR 6
949 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
1019 #define SWIG_NewPointerObj(L, ptr, type, owner) SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner)
1020 #define SWIG_ConvertPtr(L,idx, ptr, type, flags) SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags)
1021 #define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname) SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname)
1023 #define SWIG_ConvertMember(L, idx, ptr, sz, ty) SWIG_Lua_ConvertPacked(L, idx, ptr, sz, ty)
1024 #define SWIG_NewMemberObj(L, ptr, sz, type) SWIG_Lua_NewPackedObj(L, ptr, sz, type)
1027 #define SWIG_GetModule(clientdata) SWIG_Lua_GetModule((lua_State*)(clientdata))
1028 #define SWIG_SetModule(clientdata, pointer) SWIG_Lua_SetModule((lua_State*) (clientdata), pointer)
1029 #define SWIG_MODULE_CLIENTDATA_TYPE lua_State*
1032 #define SWIG_contract_assert(expr, msg) \
1033 if (!(expr)) { SWIG_Lua_pusherrstring(L, (char *) msg); goto fail; } else
1037 #define SWIG_fail {goto fail;}
1038 #define SWIG_fail_arg(func_name,argnum,type) \
1039 {SWIG_Lua_pushferrstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\
1040 func_name,argnum,type,SWIG_Lua_typename(L,argnum));\
1042 #define SWIG_fail_ptr(func_name,argnum,type) \
1043 SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*")
1044 #define SWIG_check_num_args(func_name,a,b) \
1045 if (lua_gettop(L)<a || lua_gettop(L)>b) \
1046 {SWIG_Lua_pushferrstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\
1050 #define SWIG_Lua_get_table(L,n) \
1051 (lua_pushstring(L, n), lua_rawget(L,-2))
1053 #define SWIG_Lua_add_function(L,n,f) \
1054 (lua_pushstring(L, n), \
1055 lua_pushcfunction(L, f), \
1058 #define SWIG_Lua_add_boolean(L,n,b) \
1059 (lua_pushstring(L, n), \
1060 lua_pushboolean(L, b), \
1064 #define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I))
1077 lua_rawget(L,LUA_REGISTRYINDEX);
1078 if (lua_islightuserdata(L,-1))
1088 lua_pushlightuserdata(L,(
void*)
module);
1089 lua_rawset(L,LUA_REGISTRYINDEX);
1102 #ifndef SWIGLUA_IGNORE_SET_IMMUTABLE
1104 luaL_error(L,
"This variable is immutable");
1109 #ifdef SWIG_LUA_ELUA_EMULATE
1113 static int swig_lua_elua_emulate_unique_key;
1116 SWIGINTERN void SWIG_Lua_elua_emulate_register(lua_State *L,
const swig_elua_entry *table)
1118 int i, table_parsed, parsed_tables_array, target_table;
1119 assert(lua_istable(L,-1));
1120 target_table = lua_gettop(L);
1122 lua_rawgetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key);
1123 if(lua_isnil(L,-1)) {
1126 lua_pushvalue(L,-1);
1127 lua_rawsetp(L,LUA_REGISTRYINDEX,(
void*)(&swig_lua_elua_emulate_unique_key));
1129 parsed_tables_array = lua_gettop(L);
1130 lua_pushvalue(L,target_table);
1133 const int SWIGUNUSED pairs_start = lua_gettop(L);
1134 for(i = 0;table[i].key.type != LUA_TNIL || table[i].value.type != LUA_TNIL;i++)
1136 const swig_elua_entry *entry = table + i;
1137 int is_metatable = 0;
1138 switch(entry->key.type) {
1140 lua_pushstring(L,entry->key.key.strkey);
1141 if(strcmp(entry->key.key.strkey, SWIG_LUA_ELUA_EMUL_METATABLE_KEY) == 0)
1145 lua_pushnumber(L,entry->key.key.numkey);
1153 switch(entry->value.type) {
1155 lua_pushstring(L,entry->value.value.string);
1158 lua_pushnumber(L,entry->value.value.number);
1161 lua_pushcfunction(L,entry->value.value.function);
1164 lua_rawgetp(L,parsed_tables_array, entry->value.value.table);
1165 table_parsed = !lua_isnil(L,-1);
1169 SWIG_Lua_elua_emulate_register(L,entry->value.value.table);
1172 assert(lua_istable(L,-1));
1173 lua_pushvalue(L,-1);
1174 lua_setmetatable(L,target_table);
1179 if(entry->value.value.userdata.member)
1181 entry->value.value.userdata.lvalue,
1182 *(entry->value.value.userdata.ptype));
1185 *(entry->value.value.userdata.ptype),0);
1193 assert(lua_gettop(L) == pairs_start + 2);
1194 lua_rawset(L,target_table);
1197 assert(lua_gettop(L) == target_table);
1200 SWIGINTERN void SWIG_Lua_elua_emulate_register_clear(lua_State *L)
1203 lua_rawsetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key);
1208 SWIGINTERN int SWIG_Lua_emulate_elua_getmetatable(lua_State *L)
1212 lua_getfield(L,-1,
"lua_getmetatable");
1214 assert(!lua_isnil(L,-1));
1216 assert(lua_gettop(L) == 3);
1218 if(!lua_isnil(L,-1))
1221 assert(lua_gettop(L) == 2);
1222 if(lua_istable(L,-2)) {
1224 lua_getfield(L,-1, SWIG_LUA_ELUA_EMUL_METATABLE_KEY);
1226 assert(lua_gettop(L) == 2);
1234 SWIGINTERN void SWIG_Lua_emulate_elua_swap_getmetatable(lua_State *L)
1238 lua_pushstring(L,
"lua_getmetatable");
1239 lua_getfield(L,-2,
"getmetatable");
1240 assert(!lua_isnil(L,-1));
1242 lua_pushstring(L,
"getmetatable");
1243 lua_pushcfunction(L, SWIG_Lua_emulate_elua_getmetatable);
1261 assert(lua_istable(L,-2));
1262 lua_getmetatable(L,-2);
1263 assert(lua_istable(L,-1));
1265 assert(lua_istable(L,-1));
1270 if (lua_iscfunction(L,-1))
1279 assert(lua_istable(L,-1));
1283 if (lua_isfunction(L,-1))
1300 assert(lua_istable(L,1));
1301 lua_getmetatable(L,1);
1302 assert(lua_istable(L,-1));
1305 if (lua_istable(L,-1))
1310 if (lua_iscfunction(L,-1))
1324 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
1334 assert(lua_istable(L,-1));
1341 lua_getmetatable(L,-1);
1359 assert(lua_istable(L,-1));
1363 if( classes != 0 ) {
1364 while(*classes != 0) {
1381 assert(lua_istable(L,-1));
1382 lua_checkstack(L,5);
1387 lua_pushstring(L,
".get");
1391 lua_pushstring(L,
".set");
1395 lua_pushstring(L,
".fn");
1403 lua_setmetatable(L,-2);
1411 if( sub_namespace != 0) {
1412 while(*sub_namespace != 0) {
1420 lua_pushstring(L,ns->
name);
1421 lua_pushvalue(L,-2);
1424 assert(lua_gettop(L) == begin+1);
1441 int last_arg = lua_gettop(L);
1442 int original_metatable = last_arg + 1;
1447 lua_getmetatable(L,first_arg);
1450 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
1452 assert(lua_istable(L,-1));
1454 bases_table = lua_gettop(L);
1458 assert(swig_type!=0);
1461 const char **base_names= ((
swig_lua_class*)(swig_type->clientdata))->base_names;
1463 for(;base_names[bases_count];
1474 int subcall_last_arg;
1475 int subcall_first_arg = lua_gettop(L) + 1;
1478 for(j=first_arg;j<=last_arg;j++)
1480 subcall_last_arg = lua_gettop(L);
1483 for(i=0;i<bases_count;i++) {
1485 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
1486 lua_rawgeti(L,bases_table,i+1);
1488 if(lua_isnil(L,-1)) {
1502 assert(base_swig_type != 0);
1508 assert(lua_isuserdata(L, subcall_first_arg));
1509 assert(lua_istable(L,-1));
1510 lua_setmetatable(L,subcall_first_arg);
1511 assert(lua_gettop(L) == subcall_last_arg);
1512 result = func(L, base_swig_type,subcall_first_arg,
ret);
1518 lua_pushvalue(L,original_metatable);
1519 lua_setmetatable(L,first_arg);
1521 to_remove = subcall_last_arg - last_arg;
1522 for(j=0;j<to_remove;j++)
1523 lua_remove(L,last_arg+1);
1526 lua_pop(L, lua_gettop(L) - last_arg);
1528 if(
ret) assert(lua_gettop(L) == last_arg + *
ret);
1542 int bases_search_result;
1543 int substack_start = lua_gettop(L)-2;
1544 assert(first_arg == substack_start+1);
1545 lua_checkstack(L,5);
1546 assert(lua_isuserdata(L,-2));
1547 lua_getmetatable(L,-2);
1548 assert(lua_istable(L,-1));
1552 if (lua_iscfunction(L,-1))
1554 lua_pushvalue(L,substack_start+1);
1555 lua_pushvalue(L,substack_start+2);
1566 return bases_search_result;
1580 int bases_search_result;
1581 int substack_start = lua_gettop(L)-2;
1582 assert(first_arg == substack_start+1);
1583 lua_checkstack(L,5);
1584 assert(lua_isuserdata(L,-2));
1585 lua_getmetatable(L,-2);
1586 assert(lua_istable(L,-1));
1588 assert(lua_istable(L,-1));
1590 lua_pushvalue(L,substack_start+2);
1593 if (lua_iscfunction(L,-1))
1595 lua_pushvalue(L,substack_start+1);
1605 assert(lua_istable(L,-1));
1606 lua_pushvalue(L,substack_start+2);
1609 if (lua_isfunction(L,-1))
1621 return bases_search_result;
1636 assert(lua_isuserdata(L,1));
1661 int bases_search_result;
1662 int substack_start = lua_gettop(L) - 3;
1663 lua_checkstack(L,5);
1664 assert(lua_isuserdata(L,substack_start+1));
1665 lua_getmetatable(L,substack_start+1);
1666 assert(lua_istable(L,-1));
1671 if (lua_istable(L,-1))
1674 lua_pushvalue(L,substack_start+2);
1677 if (lua_iscfunction(L,-1))
1679 lua_pushvalue(L,substack_start+1);
1680 lua_pushvalue(L,substack_start+3);
1682 lua_remove(L,substack_start+4);
1692 if (lua_iscfunction(L,-1))
1694 lua_pushvalue(L,substack_start+1);
1695 lua_pushvalue(L,substack_start+2);
1696 lua_pushvalue(L,substack_start+3);
1708 assert(lua_gettop(L) == substack_start + 3);
1709 return bases_search_result;
1726 assert(lua_isuserdata(L,1));
1731 SWIG_Lua_pushferrstring(L,
"Assignment not possible. No setter/member with this name. For custom assignments implement __setitem method.");
1746 assert(lua_isuserdata(L,-1));
1766 assert(lua_isuserdata(L,1));
1769 lua_pushfstring(L,
"<userdata of type '%s' at %p>", userData->
type->
str, userData->
ptr);
1779 assert(lua_isuserdata(L,-1));
1793 if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2))
1798 result=(usr1->
ptr==usr2->
ptr);
1799 lua_pushboolean(L,result);
1827 lua_pushstring(L,
"SWIG");
1832 lua_pushstring(L,
".library");
1836 lua_pushstring(L,
"inheritable_metamethods");
1844 lua_rawset(L,LUA_REGISTRYINDEX);
1851 lua_pushstring(L,
"SWIG");
1852 lua_rawget(L,LUA_REGISTRYINDEX);
1853 if (!lua_istable(L,-1))
1858 lua_pushstring(L,
"SWIG");
1859 lua_rawget(L,LUA_REGISTRYINDEX);
1866 lua_pushstring(L,
".library");
1868 assert( !lua_isnil(L,-1) );
1869 lua_pushstring(L,
"inheritable_metamethods");
1881 lua_pushstring(L,cname);
1899 if (clss->
bases[i]==0)
1908 #if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
1910 SWIGINTERN void SWIG_Lua_merge_tables_by_index(lua_State *L,
int target,
int source)
1914 while (lua_next(L,source) != 0) {
1917 lua_pushvalue(L,-2);
1918 lua_pushvalue(L,-2);
1919 lua_rawset(L, target);
1926 SWIGINTERN void SWIG_Lua_merge_tables(lua_State *L,
const char* name,
int original,
int base)
1929 lua_pushstring(L,name);
1930 lua_rawget(L,original);
1931 int original_table = lua_gettop(L);
1932 lua_pushstring(L,name);
1934 int base_table = lua_gettop(L);
1935 SWIG_Lua_merge_tables_by_index(L, original_table, base_table);
1944 assert(lua_istable(L,-1));
1945 int original = lua_gettop(L);
1947 int base = lua_gettop(L);
1948 SWIG_Lua_merge_tables(L,
".fn", original, base );
1949 SWIG_Lua_merge_tables(L,
".set", original, base );
1950 SWIG_Lua_merge_tables(L,
".get", original, base );
1961 if (clss->
bases[i]==0)
1967 SWIG_Lua_class_squash_base(L, clss->
bases[i]);
1973 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
1977 assert(lua_istable(L,-1));
1979 assert(lua_istable(L,-1));
1985 assert(lua_istable(L,-1));
1996 assert(lua_istable(L,-1));
1998 for(i=0;clss->
bases[i];i++)
2012 size_t bases_count = 0;
2015 assert(lua_istable(L,-1));
2016 for(i=0;clss->
bases[i];i++)
2020 assert(lua_istable(L,-1));
2021 lua_rawseti(L,-2,i+1);
2032 assert(lua_istable(L,-1));
2033 for(i=0;clss->
methods[i].name;i++){
2047 #if !defined(SWIG_LUA_SQUASH_BASES)
2089 lua_pushvalue(L, metamethod_name_idx);
2103 for(i=0;clss->
bases[i];i++)
2118 int metamethod_name_idx;
2122 lua_checkstack(L,5);
2123 numargs = lua_gettop(L);
2126 lua_pushvalue(L, lua_upvalueindex(1));
2127 metamethod_name_idx = lua_gettop(L);
2129 lua_pushvalue(L, lua_upvalueindex(2));
2136 SWIG_Lua_pushferrstring(L,
"The metamethod proxy is set, but it failed to find actual metamethod. Memory corruption is most likely explanation.");
2143 lua_call(L, numargs, LUA_MULTRET);
2144 return lua_gettop(L);
2159 assert(lua_isstring(L,-1));
2161 key_index = lua_gettop(L);
2164 lua_pushvalue(L,key_index);
2165 lua_gettable(L,metatable_index);
2166 if( !lua_isnil(L,-1) ) {
2173 for(i=0;clss->
bases[i];i++)
2177 lua_pushvalue(L, key_index);
2179 if( !lua_isnil(L,-1) ) {
2180 lua_pushvalue(L, key_index);
2183 lua_pushvalue(L, key_index);
2184 lua_pushlightuserdata(L, clss);
2187 lua_rawset(L, metatable_index);
2202 int metatable_index;
2203 int metamethods_info_index;
2204 int tostring_undefined;
2205 int eq_undefined = 0;
2208 metatable_index = lua_gettop(L);
2210 assert(lua_istable(L,-1));
2211 metamethods_info_index = lua_gettop(L);
2213 while(lua_next(L, metamethods_info_index) != 0 ) {
2215 const int is_inheritable = lua_toboolean(L,-2);
2218 if(is_inheritable) {
2226 lua_pushstring(L,
"__tostring");
2227 lua_pushvalue(L,-1);
2228 lua_rawget(L,metatable_index);
2229 tostring_undefined = lua_isnil(L,-1);
2231 if( tostring_undefined ) {
2233 lua_rawset(L, metatable_index);
2239 lua_pushstring(L,
"__eq");
2240 lua_pushvalue(L,-1);
2241 lua_rawget(L,metatable_index);
2242 eq_undefined = lua_isnil(L,-1);
2244 if( eq_undefined ) {
2246 lua_rawset(L, metatable_index);
2260 lua_checkstack(L,5);
2261 assert(lua_istable(L,-1));
2266 assert(lua_istable(L,-1));
2274 lua_getmetatable(L,-1);
2275 assert(lua_istable(L,-1));
2280 assert(lua_istable(L,-1));
2285 assert( lua_gettop(L) == begin );
2297 lua_pushstring(L,clss->
fqname);
2299 if(!lua_isnil(L,-1)) {
2301 assert(lua_gettop(L)==begin);
2306 for(i=0;clss->
bases[i];i++)
2312 lua_pushstring(L,clss->
fqname);
2314 #if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
2321 for(i=0;clss->
bases[i];i++)
2326 SWIG_Lua_merge_tables_by_index(L,new_metatable_index, base_metatable);
2333 lua_pushstring(L,
".type");
2334 lua_pushstring(L,clss->
fqname);
2337 lua_pushstring(L,
".bases");
2341 lua_pushstring(L,
".get");
2345 lua_pushstring(L,
".set");
2349 lua_pushstring(L,
".fn");
2361 assert(lua_gettop(L) == begin);
2363 #if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
2365 SWIG_Lua_class_squash_bases(L,clss);
2370 assert( lua_gettop(L) == begin );
2376 assert(lua_istable(L,-1));
2390 begin = lua_gettop(L);
2393 assert(lua_istable(L,-1));
2394 lua_getmetatable(L,-1);
2395 assert(lua_istable(L,-1));
2396 lua_pushstring(L,
".instance");
2399 assert(lua_istable(L,-1));
2400 lua_pushstring(L,
".static");
2401 lua_pushvalue(L, -4);
2402 assert(lua_istable(L,-1));
2406 assert(lua_gettop(L) == begin);
2410 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
2417 lua_pushstring(L,clss->
fqname);
2419 if(!lua_isnil(L,-1)) {
2421 assert(lua_gettop(L)==begin);
2426 for(i=0;clss->
bases[i];i++)
2428 SWIG_Lua_elua_class_register_instance(L,clss->
bases[i]);
2432 lua_pushstring(L,clss->
fqname);
2434 lua_pushrotable(L, (
void*)(clss->
metatable));
2437 assert(lua_gettop(L) == begin);
2451 if (lua_istable(L,-1))
2453 lua_setmetatable(L,-2);
2474 #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
2486 if (lua_isnil(L,index))
2491 if (lua_islightuserdata(L,index))
2493 *ptr=lua_touserdata(L,index);
2521 int argnum,
const char *func_name){
2524 luaL_error (L,
"Error in %s, expected a %s at argument number %d\n",
2525 func_name,(type && type->
str)?type->
str:
"void*",argnum);
2538 memcpy(raw->
data,ptr,size);
2548 if (type==0 || type==raw->
type)
2550 memcpy(ptr,raw->
data,size);
2560 if (lua_isuserdata(L,tp))
2565 return "userdata (unknown type)";
2567 return lua_typename(L,lua_type(L,tp));
2581 #if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
2586 for (i = 0; constants[i].
type; i++) {
2587 switch(constants[i].type) {
2589 lua_pushstring(L,constants[i].name);
2590 lua_pushinteger(L,(lua_Integer)constants[i].lvalue);
2594 lua_pushstring(L,constants[i].name);
2595 lua_pushnumber(L,(lua_Number)constants[i].dvalue);
2599 lua_pushstring(L,constants[i].name);
2601 char c = (char)constants[i].lvalue;
2602 lua_pushlstring(L,&c,1);
2607 lua_pushstring(L,constants[i].name);
2608 lua_pushstring(L,(
char *) constants[i].pvalue);
2612 lua_pushstring(L,constants[i].name);
2617 lua_pushstring(L,constants[i].name);
2618 SWIG_NewMemberObj(L,constants[i].pvalue,constants[i].lvalue,*(constants[i]).ptype);
2632 #ifndef SWIG_DOSTRING_FAIL
2633 #define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S)
2643 if (str==0 || str[0]==0)
return 0;
2645 #if (defined(LUA_VERSION_NUM) && (LUA_VERSION_NUM>=501))
2646 ok=luaL_dostring(L,str);
2648 ok=lua_dostring(L,str);
2671 #ifdef SWIG_MODULE_CLIENTDATA_TYPE
swig_converter_func converter
struct swig_cast_info * next
struct swig_cast_info * prev
void(* destructor)(void *)
swig_lua_attribute * attributes
swig_lua_namespace * cls_static
struct swig_lua_class ** bases
swig_lua_method * metatable
lua_CFunction constructor
swig_lua_method * methods
swig_lua_method * ns_methods
swig_lua_attribute * ns_attributes
struct swig_lua_class ** ns_classes
swig_lua_const_info * ns_constants
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
#define SWIG_DOSTRING_FAIL(S)
static swig_type_info * SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr)
static void SWIG_Lua_add_class_static_details(lua_State *L, swig_lua_class *clss)
static int SWIG_Lua_class_set(lua_State *L)
static int SWIG_Lua_namespace_get(lua_State *L)
static int SWIG_TypeEquiv(const char *nb, const char *tb)
static int SWIG_Lua_class_tostring(lua_State *L)
struct swig_lua_class swig_lua_class
#define SWIG_CheckState(r)
static int SWIG_Lua_set_immutable(lua_State *L)
static int SWIG_Lua_ConvertPacked(lua_State *L, int index, void *ptr, size_t size, swig_type_info *type)
#define SWIG_NewMemberObj(L, ptr, sz, type)
static int SWIG_Lua_class_do_get(lua_State *L, swig_type_info *type, int first_arg, int *ret)
struct swig_lua_namespace swig_lua_namespace
static int SWIG_Lua_resolve_metamethod(lua_State *L)
static int SWIG_Lua_class_get(lua_State *L)
static void * SWIG_Lua_MustGetPtr(lua_State *L, int index, swig_type_info *type, int flags, int argnum, const char *func_name)
static int SWIG_TypeCmp(const char *nb, const char *tb)
struct swig_cast_info swig_cast_info
static void SWIG_Lua_NewPackedObj(lua_State *L, void *ptr, size_t size, swig_type_info *type)
static swig_type_info * SWIG_TypeQueryModule(swig_module_info *start, swig_module_info *end, const char *name)
static int SWIG_TypeNameComp(const char *f1, const char *l1, const char *f2, const char *l2)
static void SWIG_Lua_class_register(lua_State *L, swig_lua_class *clss)
static const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz)
#define SWIG_ConvertPtr(L, idx, ptr, type, flags)
static void SWIG_Lua_InstallConstants(lua_State *L, swig_lua_const_info constants[])
static void SWIG_Lua_class_register_static(lua_State *L, swig_lua_class *clss)
static swig_cast_info * SWIG_TypeCheck(const char *c, swig_type_info *ty)
#define SWIG_Lua_get_table(L, n)
#define SWIG_RUNTIME_VERSION
static int SWIG_Lua_ConvertPtr(lua_State *L, int index, void **ptr, swig_type_info *type, int flags)
static int SWIG_Lua_iterate_bases(lua_State *L, swig_type_info *swig_type, int first_arg, swig_lua_base_iterator_func func, int *const ret)
static void SWIG_Lua_NewPointerObj(lua_State *L, void *ptr, swig_type_info *type, int own)
#define SWIG_Lua_add_function(L, n, f)
#define SWIG_MODULE_CLIENTDATA_TYPE
static void SWIG_TypeClientData(swig_type_info *ti, void *clientdata)
static void SWIG_Lua_add_variable(lua_State *L, const char *name, lua_CFunction getFn, lua_CFunction setFn)
static void SWIG_Lua_AddMetatable(lua_State *L, swig_type_info *type)
static void SWIG_Lua_create_class_registry(lua_State *L)
static void SWIG_Lua_add_namespace_classes(lua_State *L, swig_lua_namespace *ns)
static const char * SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name)
static int SWIG_Lua_add_namespace_details(lua_State *L, swig_lua_namespace *ns)
#define lua_rawsetp(L, index, ptr)
static const char * SWIG_Lua_typename(lua_State *L, int tp)
static char * SWIG_PackData(char *c, void *ptr, size_t sz)
#define SWIG_check_num_args(func_name, a, b)
static swig_cast_info * SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty)
static void SWIG_Lua_add_class_instance_details(lua_State *L, swig_lua_class *clss)
static void SWIG_Lua_pusherrstring(lua_State *L, const char *str)
static const char * SWIG_TypePrettyName(const swig_type_info *type)
static void SWIG_Lua_populate_inheritable_metamethods(lua_State *L)
#define SWIG_NewPointerObj(L, ptr, type, owner)
static int SWIG_Lua_class_do_set(lua_State *L, swig_type_info *type, int first_arg, int *ret)
static swig_type_info * SWIG_MangledTypeQuery(lua_State *clientdata, const char *name)
void *(* swig_converter_func)(void *, int *)
#define SWIG_POINTER_NO_NULL
static void * SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory)
#define lua_absindex(L, i)
static int SWIG_Lua_do_resolve_metamethod(lua_State *L, const swig_lua_class *clss, int metamethod_name_idx, int skip_check)
#define SWIG_NullReferenceError
static int SWIG_Lua_class_do_get_item(lua_State *L, swig_type_info *type, int first_arg, int *ret)
#define SWIG_POINTER_DISOWN
struct swig_type_info swig_type_info
static int SWIG_Lua_class_equal(lua_State *L)
static int SWIG_Lua_class_destruct(lua_State *L)
static swig_type_info * SWIG_TypeQuery(lua_State *clientdata, const char *name)
static void SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata)
static int SWIG_Lua_namespace_set(lua_State *L)
static char * SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz)
#define SWIG_GetModule(clientdata)
static void SWIG_Lua_init_base_class(lua_State *L, swig_lua_class *clss)
static void SWIG_Lua_class_register_instance(lua_State *L, swig_lua_class *clss)
#define lua_pushglobaltable(L)
static char * SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz)
#define SWIG_TYPE_TABLE_NAME
int(* swig_lua_base_iterator_func)(lua_State *, swig_type_info *, int, int *ret)
struct swig_module_info swig_module_info
static void SWIG_Lua_namespace_register(lua_State *L, swig_lua_namespace *ns, int reg)
static void SWIG_Lua_pushferrstring(lua_State *L, const char *fmt,...)
static void SWIG_Lua_get_class_metatable(lua_State *L, const char *cname)
static void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class *clss)
static int SWIG_Lua_type(lua_State *L)
static swig_module_info * SWIG_Lua_GetModule(lua_State *L)
static void SWIG_Lua_get_inheritable_metamethods(lua_State *L)
static int SWIG_Lua_class_disown(lua_State *L)
static swig_type_info * SWIG_MangledTypeQueryModule(swig_module_info *start, swig_module_info *end, const char *name)
static int SWIG_Lua_add_class_user_metamethod(lua_State *L, swig_lua_class *clss, const int metatable_index)
struct swig_type_info *(* swig_dycast_func)(void **)
static int SWIG_Lua_dostring(lua_State *L, const char *str)
static void SWIG_Lua_SetModule(lua_State *L, swig_module_info *module)
static const char * SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name)
static const char * SWIG_TypeName(const swig_type_info *ty)
#define SWIG_Lua_add_boolean(L, n, b)
#define lua_rawgetp(L, index, ptr)
static void SWIG_Lua_get_class_registry(lua_State *L)
#define SWIGRUNTIMEINLINE