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
197 #define SWIG_POINTER_OWN 0x1
280 #define SWIG_ERROR (-1)
281 #define SWIG_IsOK(r) (r >= 0)
282 #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
285 #define SWIG_CASTRANKLIMIT (1 << 8)
287 #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
289 #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
291 #define SWIG_BADOBJ (SWIG_ERROR)
292 #define SWIG_OLDOBJ (SWIG_OK)
293 #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
294 #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
296 #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
297 #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
298 #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
299 #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
300 #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
301 #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
304 #if defined(SWIG_CASTRANK_MODE)
305 # ifndef SWIG_TypeRank
306 # define SWIG_TypeRank unsigned long
308 # ifndef SWIG_MAXCASTRANK
309 # define SWIG_MAXCASTRANK (2)
311 # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
312 # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
317 return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
320 # define SWIG_AddCast(r) (r)
321 # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
331 typedef void *(*swig_converter_func)(
void *,
int *);
373 const char *f2,
const char *l2) {
374 for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
375 while ((*f1 ==
' ') && (f1 != l1)) ++f1;
376 while ((*f2 ==
' ') && (f2 != l2)) ++f2;
377 if (*f1 != *f2)
return (*f1 > *f2) ? 1 : -1;
379 return (
int)((l1 - f1) - (l2 - f2));
389 const char* te = tb + strlen(tb);
391 while (equiv != 0 && *ne) {
392 for (nb = ne; *ne; ++ne) {
393 if (*ne ==
'|')
break;
418 if (strcmp(iter->
type->
name, c) == 0) {
419 if (iter == ty->
cast)
445 if (iter->
type == from) {
446 if (iter == ty->
cast)
478 if (!ty || !ty->
dcast)
return ty;
479 while (ty && (ty->
dcast)) {
480 ty = (*ty->
dcast)(ptr);
504 if (!type)
return NULL;
505 if (type->
str != NULL) {
506 const char *last_name = type->
str;
508 for (s = type->
str; *s; s++)
509 if (*s ==
'|') last_name = s+1;
557 size_t r = iter->
size - 1;
560 size_t i = (l + r) >> 1;
561 const char *iname = iter->
types[i]->
name;
563 int compare = strcmp(name, iname);
565 return iter->
types[i];
566 }
else if (compare < 0) {
572 }
else if (compare > 0) {
581 }
while (iter != end);
608 for (; i < iter->
size; ++i) {
610 return iter->
types[i];
613 }
while (iter != end);
625 static const char hex[17] =
"0123456789abcdef";
626 const unsigned char *u = (
unsigned char *) ptr;
627 const unsigned char *eu = u + sz;
628 for (; u != eu; ++u) {
629 unsigned char uu = *u;
630 *(c++) = hex[(uu & 0xf0) >> 4];
631 *(c++) = hex[uu & 0xf];
641 unsigned char *u = (
unsigned char *) ptr;
642 const unsigned char *eu = u + sz;
643 for (; u != eu; ++u) {
646 if ((d >=
'0') && (d <=
'9'))
647 uu = (
unsigned char)((d -
'0') << 4);
648 else if ((d >=
'a') && (d <=
'f'))
649 uu = (
unsigned char)((d - (
'a'-10)) << 4);
653 if ((d >=
'0') && (d <=
'9'))
654 uu |= (
unsigned char)(d -
'0');
655 else if ((d >=
'a') && (d <=
'f'))
656 uu |= (
unsigned char)(d - (
'a'-10));
670 if ((2*
sizeof(
void *) + 2) > bsz)
return 0;
673 if (strlen(name) + 1 > (bsz - (r - buff)))
return 0;
681 if (strcmp(c,
"NULL") == 0) {
694 size_t lname = (name ? strlen(name) : 0);
695 if ((2*sz + 2 + lname) > bsz)
return 0;
699 strncpy(r,name,lname+1);
709 if (strcmp(c,
"NULL") == 0) {
722 #define SWIG_LUA_TARGET SWIG_LUA_FLAVOR_LUA
744 #define SWIG_LUA_FLAVOR_LUA 1
745 #define SWIG_LUA_FLAVOR_ELUA 2
746 #define SWIG_LUA_FLAVOR_ELUAC 3
748 #if !defined(SWIG_LUA_TARGET)
749 # error SWIG_LUA_TARGET not defined
752 #if defined(SWIG_LUA_ELUA_EMULATE)
754 struct swig_elua_entry;
756 typedef struct swig_elua_key {
764 typedef struct swig_elua_val {
768 const struct swig_elua_entry *table;
770 lua_CFunction
function;
780 typedef struct swig_elua_entry {
785 #define LSTRKEY(x) {LUA_TSTRING, {.strkey = x} }
786 #define LNUMKEY(x) {LUA_TNUMBER, {.numkey = x} }
787 #define LNILKEY {LUA_TNIL, {.strkey = 0} }
789 #define LNUMVAL(x) {LUA_TNUMBER, {.number = x} }
790 #define LFUNCVAL(x) {LUA_TFUNCTION, {.function = x} }
791 #define LROVAL(x) {LUA_TTABLE, {.table = x} }
792 #define LNILVAL {LUA_TNIL, {.string = 0} }
793 #define LSTRVAL(x) {LUA_TSTRING, {.string = x} }
795 #define LUA_REG_TYPE swig_elua_entry
797 #define SWIG_LUA_ELUA_EMUL_METATABLE_KEY "__metatable"
799 #define lua_pushrotable(L,p)\
802 SWIG_Lua_elua_emulate_register(L,(swig_elua_entry*)(p));
804 #define SWIG_LUA_CONSTTAB_POINTER(B,C,D)\
805 LSTRKEY(B), {LUA_TUSERDATA, { .userdata={0,0,(void*)(C),&D} } }
807 #define SWIG_LUA_CONSTTAB_BINARY(B,S,C,D)\
808 LSTRKEY(B), {LUA_TUSERDATA, { .userdata={1,S,(void*)(C),&D} } }
811 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
812 # define SWIG_LUA_CONSTTAB_INT(B, C) LSTRKEY(B), LNUMVAL(C)
813 # define SWIG_LUA_CONSTTAB_FLOAT(B, C) LSTRKEY(B), LNUMVAL(C)
814 # define SWIG_LUA_CONSTTAB_STRING(B, C) LSTRKEY(B), LSTRVAL(C)
815 # define SWIG_LUA_CONSTTAB_CHAR(B, C) LSTRKEY(B), LNUMVAL(C)
818 #ifndef SWIG_LUA_CONSTTAB_POINTER
819 #warning eLua does not support pointers as constants. By default, nil will be used as value
820 #define SWIG_LUA_CONSTTAB_POINTER(B,C,D) LSTRKEY(B), LNILVAL
823 #ifndef SWIG_LUA_CONSTTAB_BINARY
824 #warning eLua does not support pointers to member as constants. By default, nil will be used as value
825 #define SWIG_LUA_CONSTTAB_BINARY(B, S, C, D) LSTRKEY(B), LNILVAL
828 # define SWIG_LUA_CONSTTAB_INT(B, C) SWIG_LUA_INT, (char *)B, (long)C, 0, 0, 0
829 # define SWIG_LUA_CONSTTAB_FLOAT(B, C) SWIG_LUA_FLOAT, (char *)B, 0, (double)C, 0, 0
830 # define SWIG_LUA_CONSTTAB_STRING(B, C) SWIG_LUA_STRING, (char *)B, 0, 0, (void *)C, 0
831 # define SWIG_LUA_CONSTTAB_CHAR(B, C) SWIG_LUA_CHAR, (char *)B, (long)C, 0, 0, 0
832 # define SWIG_LUA_CONSTTAB_POINTER(B,C,D)\
833 SWIG_LUA_POINTER, (char *)B, 0, 0, (void *)C, &D
834 # define SWIG_LUA_CONSTTAB_BINARY(B, S, C, D)\
835 SWIG_LUA_BINARY, (char *)B, S, 0, (void *)C, &D
838 #ifndef SWIG_LUA_ELUA_EMULATE
839 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
840 # define LRO_STRVAL(v) {{.p = (char *) v}, LUA_TSTRING}
841 # define LSTRVAL LRO_STRVAL
845 #ifndef SWIG_LUA_ELUA_EMULATE
846 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
848 #ifndef MIN_OPT_LEVEL
849 #define MIN_OPT_LEVEL 2
853 #include "lrotable.h"
868 #if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501
869 # define lua_rawlen lua_strlen
870 #elif LUA_VERSION_NUM == 501
871 # define lua_rawlen lua_objlen
878 #if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
879 # define lua_pushglobaltable(L) lua_pushvalue(L, LUA_GLOBALSINDEX)
883 #if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
884 # define lua_absindex(L,i) ((i)>0 || (i) <= LUA_REGISTRYINDEX ? (i) : lua_gettop(L) + (i) + 1)
888 #if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
889 #define lua_rawsetp(L,index,ptr)\
890 lua_pushlightuserdata(L,(void*)(ptr));\
894 #define lua_rawgetp(L,index,ptr)\
895 lua_pushlightuserdata(L,(void*)(ptr));\
911 lua_pushstring (L, str);
924 lua_pushvfstring(L, fmt, argp);
934 #define SWIG_LUA_INT 1
935 #define SWIG_LUA_FLOAT 2
936 #define SWIG_LUA_STRING 3
937 #define SWIG_LUA_POINTER 4
938 #define SWIG_LUA_BINARY 5
939 #define SWIG_LUA_CHAR 6
948 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
1018 #define SWIG_NewPointerObj(L, ptr, type, owner) SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner)
1019 #define SWIG_ConvertPtr(L,idx, ptr, type, flags) SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags)
1020 #define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname) SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname)
1022 #define SWIG_ConvertMember(L, idx, ptr, sz, ty) SWIG_Lua_ConvertPacked(L, idx, ptr, sz, ty)
1023 #define SWIG_NewMemberObj(L, ptr, sz, type) SWIG_Lua_NewPackedObj(L, ptr, sz, type)
1026 #define SWIG_GetModule(clientdata) SWIG_Lua_GetModule((lua_State*)(clientdata))
1027 #define SWIG_SetModule(clientdata, pointer) SWIG_Lua_SetModule((lua_State*) (clientdata), pointer)
1028 #define SWIG_MODULE_CLIENTDATA_TYPE lua_State*
1031 #define SWIG_contract_assert(expr, msg) \
1032 if (!(expr)) { SWIG_Lua_pusherrstring(L, (char *) msg); goto fail; } else
1036 #define SWIG_fail {goto fail;}
1037 #define SWIG_fail_arg(func_name,argnum,type) \
1038 {SWIG_Lua_pushferrstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\
1039 func_name,argnum,type,SWIG_Lua_typename(L,argnum));\
1041 #define SWIG_fail_ptr(func_name,argnum,type) \
1042 SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*")
1043 #define SWIG_check_num_args(func_name,a,b) \
1044 if (lua_gettop(L)<a || lua_gettop(L)>b) \
1045 {SWIG_Lua_pushferrstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\
1049 #define SWIG_Lua_get_table(L,n) \
1050 (lua_pushstring(L, n), lua_rawget(L,-2))
1052 #define SWIG_Lua_add_function(L,n,f) \
1053 (lua_pushstring(L, n), \
1054 lua_pushcfunction(L, f), \
1057 #define SWIG_Lua_add_boolean(L,n,b) \
1058 (lua_pushstring(L, n), \
1059 lua_pushboolean(L, b), \
1063 #define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I))
1076 lua_rawget(L,LUA_REGISTRYINDEX);
1077 if (lua_islightuserdata(L,-1))
1087 lua_pushlightuserdata(L,(
void*)
module);
1088 lua_rawset(L,LUA_REGISTRYINDEX);
1101 #ifndef SWIGLUA_IGNORE_SET_IMMUTABLE
1103 luaL_error(L,
"This variable is immutable");
1108 #ifdef SWIG_LUA_ELUA_EMULATE
1112 static int swig_lua_elua_emulate_unique_key;
1115 SWIGINTERN void SWIG_Lua_elua_emulate_register(lua_State *L,
const swig_elua_entry *table)
1117 int i, table_parsed, parsed_tables_array, target_table;
1118 assert(lua_istable(L,-1));
1119 target_table = lua_gettop(L);
1121 lua_rawgetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key);
1122 if(lua_isnil(L,-1)) {
1125 lua_pushvalue(L,-1);
1126 lua_rawsetp(L,LUA_REGISTRYINDEX,(
void*)(&swig_lua_elua_emulate_unique_key));
1128 parsed_tables_array = lua_gettop(L);
1129 lua_pushvalue(L,target_table);
1132 const int SWIGUNUSED pairs_start = lua_gettop(L);
1133 for(i = 0;table[i].key.type != LUA_TNIL || table[i].value.type != LUA_TNIL;i++)
1135 const swig_elua_entry *entry = table + i;
1136 int is_metatable = 0;
1137 switch(entry->key.type) {
1139 lua_pushstring(L,entry->key.key.strkey);
1140 if(strcmp(entry->key.key.strkey, SWIG_LUA_ELUA_EMUL_METATABLE_KEY) == 0)
1144 lua_pushnumber(L,entry->key.key.numkey);
1152 switch(entry->value.type) {
1154 lua_pushstring(L,entry->value.value.string);
1157 lua_pushnumber(L,entry->value.value.number);
1160 lua_pushcfunction(L,entry->value.value.function);
1163 lua_rawgetp(L,parsed_tables_array, entry->value.value.table);
1164 table_parsed = !lua_isnil(L,-1);
1168 SWIG_Lua_elua_emulate_register(L,entry->value.value.table);
1171 assert(lua_istable(L,-1));
1172 lua_pushvalue(L,-1);
1173 lua_setmetatable(L,target_table);
1178 if(entry->value.value.userdata.member)
1180 entry->value.value.userdata.lvalue,
1181 *(entry->value.value.userdata.ptype));
1184 *(entry->value.value.userdata.ptype),0);
1192 assert(lua_gettop(L) == pairs_start + 2);
1193 lua_rawset(L,target_table);
1196 assert(lua_gettop(L) == target_table);
1199 SWIGINTERN void SWIG_Lua_elua_emulate_register_clear(lua_State *L)
1202 lua_rawsetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key);
1207 SWIGINTERN int SWIG_Lua_emulate_elua_getmetatable(lua_State *L)
1211 lua_getfield(L,-1,
"lua_getmetatable");
1213 assert(!lua_isnil(L,-1));
1215 assert(lua_gettop(L) == 3);
1217 if(!lua_isnil(L,-1))
1220 assert(lua_gettop(L) == 2);
1221 if(lua_istable(L,-2)) {
1223 lua_getfield(L,-1, SWIG_LUA_ELUA_EMUL_METATABLE_KEY);
1225 assert(lua_gettop(L) == 2);
1233 SWIGINTERN void SWIG_Lua_emulate_elua_swap_getmetatable(lua_State *L)
1237 lua_pushstring(L,
"lua_getmetatable");
1238 lua_getfield(L,-2,
"getmetatable");
1239 assert(!lua_isnil(L,-1));
1241 lua_pushstring(L,
"getmetatable");
1242 lua_pushcfunction(L, SWIG_Lua_emulate_elua_getmetatable);
1260 assert(lua_istable(L,-2));
1261 lua_getmetatable(L,-2);
1262 assert(lua_istable(L,-1));
1264 assert(lua_istable(L,-1));
1269 if (lua_iscfunction(L,-1))
1278 assert(lua_istable(L,-1));
1282 if (lua_isfunction(L,-1))
1299 assert(lua_istable(L,1));
1300 lua_getmetatable(L,1);
1301 assert(lua_istable(L,-1));
1304 if (lua_istable(L,-1))
1309 if (lua_iscfunction(L,-1))
1323 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
1333 assert(lua_istable(L,-1));
1340 lua_getmetatable(L,-1);
1358 assert(lua_istable(L,-1));
1362 if( classes != 0 ) {
1363 while(*classes != 0) {
1380 assert(lua_istable(L,-1));
1381 lua_checkstack(L,5);
1386 lua_pushstring(L,
".get");
1390 lua_pushstring(L,
".set");
1394 lua_pushstring(L,
".fn");
1402 lua_setmetatable(L,-2);
1410 if( sub_namespace != 0) {
1411 while(*sub_namespace != 0) {
1419 lua_pushstring(L,ns->
name);
1420 lua_pushvalue(L,-2);
1423 assert(lua_gettop(L) == begin+1);
1440 int last_arg = lua_gettop(L);
1441 int original_metatable = last_arg + 1;
1446 lua_getmetatable(L,first_arg);
1449 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
1451 assert(lua_istable(L,-1));
1453 bases_table = lua_gettop(L);
1457 assert(swig_type!=0);
1460 const char **base_names= ((
swig_lua_class*)(swig_type->clientdata))->base_names;
1462 for(;base_names[bases_count];
1473 int subcall_last_arg;
1474 int subcall_first_arg = lua_gettop(L) + 1;
1477 for(j=first_arg;j<=last_arg;j++)
1479 subcall_last_arg = lua_gettop(L);
1482 for(i=0;i<bases_count;i++) {
1484 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
1485 lua_rawgeti(L,bases_table,i+1);
1487 if(lua_isnil(L,-1)) {
1501 assert(base_swig_type != 0);
1507 assert(lua_isuserdata(L, subcall_first_arg));
1508 assert(lua_istable(L,-1));
1509 lua_setmetatable(L,subcall_first_arg);
1510 assert(lua_gettop(L) == subcall_last_arg);
1511 result = func(L, base_swig_type,subcall_first_arg,
ret);
1517 lua_pushvalue(L,original_metatable);
1518 lua_setmetatable(L,first_arg);
1520 to_remove = subcall_last_arg - last_arg;
1521 for(j=0;j<to_remove;j++)
1522 lua_remove(L,last_arg+1);
1525 lua_pop(L, lua_gettop(L) - last_arg);
1527 if(
ret) assert(lua_gettop(L) == last_arg + *
ret);
1541 int bases_search_result;
1542 int substack_start = lua_gettop(L)-2;
1543 assert(first_arg == substack_start+1);
1544 lua_checkstack(L,5);
1545 assert(lua_isuserdata(L,-2));
1546 lua_getmetatable(L,-2);
1547 assert(lua_istable(L,-1));
1551 if (lua_iscfunction(L,-1))
1553 lua_pushvalue(L,substack_start+1);
1554 lua_pushvalue(L,substack_start+2);
1565 return bases_search_result;
1579 int bases_search_result;
1580 int substack_start = lua_gettop(L)-2;
1581 assert(first_arg == substack_start+1);
1582 lua_checkstack(L,5);
1583 assert(lua_isuserdata(L,-2));
1584 lua_getmetatable(L,-2);
1585 assert(lua_istable(L,-1));
1587 assert(lua_istable(L,-1));
1589 lua_pushvalue(L,substack_start+2);
1592 if (lua_iscfunction(L,-1))
1594 lua_pushvalue(L,substack_start+1);
1604 assert(lua_istable(L,-1));
1605 lua_pushvalue(L,substack_start+2);
1608 if (lua_isfunction(L,-1))
1620 return bases_search_result;
1635 assert(lua_isuserdata(L,1));
1660 int bases_search_result;
1661 int substack_start = lua_gettop(L) - 3;
1662 lua_checkstack(L,5);
1663 assert(lua_isuserdata(L,substack_start+1));
1664 lua_getmetatable(L,substack_start+1);
1665 assert(lua_istable(L,-1));
1670 if (lua_istable(L,-1))
1673 lua_pushvalue(L,substack_start+2);
1676 if (lua_iscfunction(L,-1))
1678 lua_pushvalue(L,substack_start+1);
1679 lua_pushvalue(L,substack_start+3);
1681 lua_remove(L,substack_start+4);
1691 if (lua_iscfunction(L,-1))
1693 lua_pushvalue(L,substack_start+1);
1694 lua_pushvalue(L,substack_start+2);
1695 lua_pushvalue(L,substack_start+3);
1707 assert(lua_gettop(L) == substack_start + 3);
1708 return bases_search_result;
1725 assert(lua_isuserdata(L,1));
1730 SWIG_Lua_pushferrstring(L,
"Assignment not possible. No setter/member with this name. For custom assignments implement __setitem method.");
1745 assert(lua_isuserdata(L,-1));
1764 const char *className;
1766 assert(lua_isuserdata(L,1));
1767 userData = lua_touserdata(L,1);
1768 lua_getmetatable(L,1);
1769 assert(lua_istable(L,-1));
1771 lua_getfield(L, -1,
".type");
1772 className = lua_tostring(L, -1);
1774 lua_pushfstring(L,
"<%s userdata: %p>", className, userData);
1784 assert(lua_isuserdata(L,-1));
1798 if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2))
1803 result=(usr1->
ptr==usr2->
ptr);
1804 lua_pushboolean(L,result);
1832 lua_pushstring(L,
"SWIG");
1837 lua_pushstring(L,
".library");
1841 lua_pushstring(L,
"inheritable_metamethods");
1849 lua_rawset(L,LUA_REGISTRYINDEX);
1856 lua_pushstring(L,
"SWIG");
1857 lua_rawget(L,LUA_REGISTRYINDEX);
1858 if (!lua_istable(L,-1))
1863 lua_pushstring(L,
"SWIG");
1864 lua_rawget(L,LUA_REGISTRYINDEX);
1871 lua_pushstring(L,
".library");
1873 assert( !lua_isnil(L,-1) );
1874 lua_pushstring(L,
"inheritable_metamethods");
1886 lua_pushstring(L,cname);
1904 if (clss->
bases[i]==0)
1913 #if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
1915 SWIGINTERN void SWIG_Lua_merge_tables_by_index(lua_State *L,
int target,
int source)
1919 while (lua_next(L,source) != 0) {
1922 lua_pushvalue(L,-2);
1923 lua_pushvalue(L,-2);
1924 lua_rawset(L, target);
1931 SWIGINTERN void SWIG_Lua_merge_tables(lua_State *L,
const char* name,
int original,
int base)
1934 lua_pushstring(L,name);
1935 lua_rawget(L,original);
1936 int original_table = lua_gettop(L);
1937 lua_pushstring(L,name);
1939 int base_table = lua_gettop(L);
1940 SWIG_Lua_merge_tables_by_index(L, original_table, base_table);
1949 assert(lua_istable(L,-1));
1950 int original = lua_gettop(L);
1952 int base = lua_gettop(L);
1953 SWIG_Lua_merge_tables(L,
".fn", original, base );
1954 SWIG_Lua_merge_tables(L,
".set", original, base );
1955 SWIG_Lua_merge_tables(L,
".get", original, base );
1966 if (clss->
bases[i]==0)
1972 SWIG_Lua_class_squash_base(L, clss->
bases[i]);
1978 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
1982 assert(lua_istable(L,-1));
1984 assert(lua_istable(L,-1));
1990 assert(lua_istable(L,-1));
2001 assert(lua_istable(L,-1));
2003 for(i=0;clss->
bases[i];i++)
2017 size_t bases_count = 0;
2020 assert(lua_istable(L,-1));
2021 for(i=0;clss->
bases[i];i++)
2025 assert(lua_istable(L,-1));
2026 lua_rawseti(L,-2,i+1);
2037 assert(lua_istable(L,-1));
2038 for(i=0;clss->
methods[i].name;i++){
2052 #if !defined(SWIG_LUA_SQUASH_BASES)
2094 lua_pushvalue(L, metamethod_name_idx);
2108 for(i=0;clss->
bases[i];i++)
2123 int metamethod_name_idx;
2127 lua_checkstack(L,5);
2128 numargs = lua_gettop(L);
2131 lua_pushvalue(L, lua_upvalueindex(1));
2132 metamethod_name_idx = lua_gettop(L);
2134 lua_pushvalue(L, lua_upvalueindex(2));
2141 SWIG_Lua_pushferrstring(L,
"The metamethod proxy is set, but it failed to find actual metamethod. Memory corruption is most likely explanation.");
2148 lua_call(L, numargs, LUA_MULTRET);
2149 return lua_gettop(L);
2164 assert(lua_isstring(L,-1));
2166 key_index = lua_gettop(L);
2169 lua_pushvalue(L,key_index);
2170 lua_gettable(L,metatable_index);
2171 if( !lua_isnil(L,-1) ) {
2178 for(i=0;clss->
bases[i];i++)
2182 lua_pushvalue(L, key_index);
2184 if( !lua_isnil(L,-1) ) {
2185 lua_pushvalue(L, key_index);
2188 lua_pushvalue(L, key_index);
2189 lua_pushlightuserdata(L, clss);
2192 lua_rawset(L, metatable_index);
2207 int metatable_index;
2208 int metamethods_info_index;
2209 int tostring_undefined;
2210 int eq_undefined = 0;
2213 metatable_index = lua_gettop(L);
2215 assert(lua_istable(L,-1));
2216 metamethods_info_index = lua_gettop(L);
2218 while(lua_next(L, metamethods_info_index) != 0 ) {
2220 const int is_inheritable = lua_toboolean(L,-2);
2223 if(is_inheritable) {
2231 lua_pushstring(L,
"__tostring");
2232 lua_pushvalue(L,-1);
2233 lua_rawget(L,metatable_index);
2234 tostring_undefined = lua_isnil(L,-1);
2236 if( tostring_undefined ) {
2238 lua_rawset(L, metatable_index);
2244 lua_pushstring(L,
"__eq");
2245 lua_pushvalue(L,-1);
2246 lua_rawget(L,metatable_index);
2247 eq_undefined = lua_isnil(L,-1);
2249 if( eq_undefined ) {
2251 lua_rawset(L, metatable_index);
2265 lua_checkstack(L,5);
2266 assert(lua_istable(L,-1));
2271 assert(lua_istable(L,-1));
2279 lua_getmetatable(L,-1);
2280 assert(lua_istable(L,-1));
2285 assert(lua_istable(L,-1));
2290 assert( lua_gettop(L) == begin );
2302 lua_pushstring(L,clss->
fqname);
2304 if(!lua_isnil(L,-1)) {
2306 assert(lua_gettop(L)==begin);
2311 for(i=0;clss->
bases[i];i++)
2317 lua_pushstring(L,clss->
fqname);
2319 #if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
2326 for(i=0;clss->
bases[i];i++)
2331 SWIG_Lua_merge_tables_by_index(L,new_metatable_index, base_metatable);
2338 lua_pushstring(L,
".type");
2339 lua_pushstring(L,clss->
fqname);
2342 lua_pushstring(L,
".bases");
2346 lua_pushstring(L,
".get");
2350 lua_pushstring(L,
".set");
2354 lua_pushstring(L,
".fn");
2366 assert(lua_gettop(L) == begin);
2368 #if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
2370 SWIG_Lua_class_squash_bases(L,clss);
2375 assert( lua_gettop(L) == begin );
2381 assert(lua_istable(L,-1));
2395 begin = lua_gettop(L);
2398 assert(lua_istable(L,-1));
2399 lua_getmetatable(L,-1);
2400 assert(lua_istable(L,-1));
2401 lua_pushstring(L,
".instance");
2404 assert(lua_istable(L,-1));
2405 lua_pushstring(L,
".static");
2406 lua_pushvalue(L, -4);
2407 assert(lua_istable(L,-1));
2411 assert(lua_gettop(L) == begin);
2415 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
2422 lua_pushstring(L,clss->
fqname);
2424 if(!lua_isnil(L,-1)) {
2426 assert(lua_gettop(L)==begin);
2431 for(i=0;clss->
bases[i];i++)
2433 SWIG_Lua_elua_class_register_instance(L,clss->
bases[i]);
2437 lua_pushstring(L,clss->
fqname);
2439 lua_pushrotable(L, (
void*)(clss->
metatable));
2442 assert(lua_gettop(L) == begin);
2456 if (lua_istable(L,-1))
2458 lua_setmetatable(L,-2);
2479 #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
2490 if (lua_isnil(L,index)){*ptr=0;
return SWIG_OK;}
2516 int argnum,
const char *func_name){
2519 luaL_error (L,
"Error in %s, expected a %s at argument number %d\n",
2520 func_name,(type && type->
str)?type->
str:
"void*",argnum);
2533 memcpy(raw->
data,ptr,size);
2543 if (type==0 || type==raw->
type)
2545 memcpy(ptr,raw->
data,size);
2555 if (lua_isuserdata(L,tp))
2560 return "userdata (unknown type)";
2562 return lua_typename(L,lua_type(L,tp));
2576 #if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
2581 for (i = 0; constants[i].
type; i++) {
2582 switch(constants[i].type) {
2584 lua_pushstring(L,constants[i].name);
2585 lua_pushinteger(L,(lua_Number)constants[i].lvalue);
2589 lua_pushstring(L,constants[i].name);
2590 lua_pushnumber(L,(lua_Number)constants[i].dvalue);
2594 lua_pushstring(L,constants[i].name);
2596 char c = constants[i].
lvalue;
2597 lua_pushlstring(L,&c,1);
2602 lua_pushstring(L,constants[i].name);
2603 lua_pushstring(L,(
char *) constants[i].pvalue);
2607 lua_pushstring(L,constants[i].name);
2612 lua_pushstring(L,constants[i].name);
2613 SWIG_NewMemberObj(L,constants[i].pvalue,constants[i].lvalue,*(constants[i]).ptype);
2627 #ifndef SWIG_DOSTRING_FAIL
2628 #define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S)
2638 if (str==0 || str[0]==0)
return 0;
2640 #if (defined(LUA_VERSION_NUM) && (LUA_VERSION_NUM>=501))
2641 ok=luaL_dostring(L,str);
2643 ok=lua_dostring(L,str);
2666 #ifdef SWIG_MODULE_CLIENTDATA_TYPE