mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
Update SWIG wrapper
This commit is contained in:
parent
d616439618
commit
ad65b41aa7
1 changed files with 1862 additions and 1788 deletions
|
@ -536,7 +536,8 @@ SWIG_TypePrettyName(const swig_type_info *type) {
|
|||
for (s = type->str; *s; s++)
|
||||
if (*s == '|') last_name = s+1;
|
||||
return last_name;
|
||||
} else
|
||||
}
|
||||
else
|
||||
return type->name;
|
||||
}
|
||||
|
||||
|
@ -962,7 +963,8 @@ static const char *(lua_tolstring)(lua_State *L, int idx, size_t *len) {
|
|||
prefixed with the location of the innermost Lua call-point
|
||||
(as formatted by luaL_where). */
|
||||
SWIGRUNTIME void
|
||||
SWIG_Lua_pusherrstring(lua_State *L, const char *str) {
|
||||
SWIG_Lua_pusherrstring (lua_State *L, const char *str)
|
||||
{
|
||||
luaL_where (L, 1);
|
||||
lua_pushstring (L, str);
|
||||
lua_concat (L, 2);
|
||||
|
@ -972,7 +974,8 @@ SWIG_Lua_pusherrstring(lua_State *L, const char *str) {
|
|||
the Lua stack, like lua_pushfstring, but prefixed with the
|
||||
location of the innermost Lua call-point (as formatted by luaL_where). */
|
||||
SWIGRUNTIME void
|
||||
SWIG_Lua_pushferrstring(lua_State *L, const char *fmt, ...) {
|
||||
SWIG_Lua_pushferrstring (lua_State *L, const char *fmt, ...)
|
||||
{
|
||||
va_list argp;
|
||||
va_start(argp, fmt);
|
||||
luaL_where(L, 1);
|
||||
|
@ -1150,7 +1153,8 @@ SWIG_Lua_SetModule(lua_State *L, swig_module_info *module) {
|
|||
/* this function is called when trying to set an immutable.
|
||||
default action is to print an error.
|
||||
This can removed with a compile flag SWIGLUA_IGNORE_SET_IMMUTABLE */
|
||||
SWIGINTERN int SWIG_Lua_set_immutable(lua_State *L) {
|
||||
SWIGINTERN int SWIG_Lua_set_immutable(lua_State *L)
|
||||
{
|
||||
/* there should be 1 param passed in: the new value */
|
||||
#ifndef SWIGLUA_IGNORE_SET_IMMUTABLE
|
||||
lua_pop(L,1); /* remove it */
|
||||
|
@ -1166,7 +1170,8 @@ SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State *L, void *ptr, size_t size, swi
|
|||
static int swig_lua_elua_emulate_unique_key;
|
||||
|
||||
/* This function emulates eLua rotables behaviour. It loads a rotable definition into the usual lua table. */
|
||||
SWIGINTERN void SWIG_Lua_elua_emulate_register(lua_State *L, const swig_elua_entry *table) {
|
||||
SWIGINTERN void SWIG_Lua_elua_emulate_register(lua_State *L, const swig_elua_entry *table)
|
||||
{
|
||||
int i, table_parsed, parsed_tables_array, target_table;
|
||||
assert(lua_istable(L,-1));
|
||||
target_table = lua_gettop(L);
|
||||
|
@ -1183,7 +1188,8 @@ SWIGINTERN void SWIG_Lua_elua_emulate_register(lua_State *L, const swig_elua_ent
|
|||
lua_rawsetp(L, parsed_tables_array, table);
|
||||
table_parsed = 0;
|
||||
const int SWIGUNUSED pairs_start = lua_gettop(L);
|
||||
for (i = 0; table[i].key.type != LUA_TNIL || table[i].value.type != LUA_TNIL; i++) {
|
||||
for(i = 0;table[i].key.type != LUA_TNIL || table[i].value.type != LUA_TNIL;i++)
|
||||
{
|
||||
const swig_elua_entry *entry = table + i;
|
||||
int is_metatable = 0;
|
||||
switch(entry->key.type) {
|
||||
|
@ -1248,14 +1254,16 @@ SWIGINTERN void SWIG_Lua_elua_emulate_register(lua_State *L, const swig_elua_ent
|
|||
assert(lua_gettop(L) == target_table);
|
||||
}
|
||||
|
||||
SWIGINTERN void SWIG_Lua_elua_emulate_register_clear(lua_State *L) {
|
||||
SWIGINTERN void SWIG_Lua_elua_emulate_register_clear(lua_State *L)
|
||||
{
|
||||
lua_pushnil(L);
|
||||
lua_rawsetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key);
|
||||
}
|
||||
|
||||
SWIGINTERN void SWIG_Lua_get_class_registry(lua_State *L);
|
||||
|
||||
SWIGINTERN int SWIG_Lua_emulate_elua_getmetatable(lua_State *L) {
|
||||
SWIGINTERN int SWIG_Lua_emulate_elua_getmetatable(lua_State *L)
|
||||
{
|
||||
SWIG_check_num_args("getmetatable(SWIG eLua emulation)", 1, 1);
|
||||
SWIG_Lua_get_class_registry(L);
|
||||
lua_getfield(L,-1,"lua_getmetatable");
|
||||
|
@ -1280,7 +1288,8 @@ fail:
|
|||
return 0;
|
||||
}
|
||||
|
||||
SWIGINTERN void SWIG_Lua_emulate_elua_swap_getmetatable(lua_State *L) {
|
||||
SWIGINTERN void SWIG_Lua_emulate_elua_swap_getmetatable(lua_State *L)
|
||||
{
|
||||
SWIG_Lua_get_class_registry(L);
|
||||
lua_pushglobaltable(L);
|
||||
lua_pushstring(L,"lua_getmetatable");
|
||||
|
@ -1300,7 +1309,8 @@ SWIGINTERN void SWIG_Lua_emulate_elua_swap_getmetatable(lua_State *L) {
|
|||
* global variable support code: namespaces and modules (which are the same thing)
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
SWIGINTERN int SWIG_Lua_namespace_get(lua_State *L) {
|
||||
SWIGINTERN int SWIG_Lua_namespace_get(lua_State *L)
|
||||
{
|
||||
/* there should be 2 params passed in
|
||||
(1) table (not the meta table)
|
||||
(2) string name of the attribute
|
||||
|
@ -1314,8 +1324,8 @@ SWIGINTERN int SWIG_Lua_namespace_get(lua_State *L) {
|
|||
lua_pushvalue(L,2); /* key */
|
||||
lua_rawget(L,-2);
|
||||
lua_remove(L,-2); /* stack tidy, remove .get table */
|
||||
if (lua_iscfunction(L, -1)) {
|
||||
/* found it so call the fn & return its value */
|
||||
if (lua_iscfunction(L,-1))
|
||||
{ /* found it so call the fn & return its value */
|
||||
lua_call(L,0,1); /* 1 value in (userdata),1 out (result) */
|
||||
lua_remove(L,-2); /* stack tidy, remove metatable */
|
||||
return 1;
|
||||
|
@ -1327,8 +1337,8 @@ SWIGINTERN int SWIG_Lua_namespace_get(lua_State *L) {
|
|||
lua_pushvalue(L,2); /* key */
|
||||
lua_rawget(L,-2); /* look for the fn */
|
||||
lua_remove(L,-2); /* stack tidy, remove .fn table */
|
||||
if (lua_isfunction(L, -1)) { /* note: whether it's a C function or lua function */
|
||||
/* found it so return the fn & let lua call it */
|
||||
if (lua_isfunction(L,-1)) /* note: whether it's a C function or lua function */
|
||||
{ /* found it so return the fn & let lua call it */
|
||||
lua_remove(L,-2); /* stack tidy, remove metatable */
|
||||
return 1;
|
||||
}
|
||||
|
@ -1336,7 +1346,8 @@ SWIGINTERN int SWIG_Lua_namespace_get(lua_State *L) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
SWIGINTERN int SWIG_Lua_namespace_set(lua_State *L) {
|
||||
SWIGINTERN int SWIG_Lua_namespace_set(lua_State *L)
|
||||
{
|
||||
/* there should be 3 params passed in
|
||||
(1) table (not the meta table)
|
||||
(2) string name of the attribute
|
||||
|
@ -1348,12 +1359,13 @@ SWIGINTERN int SWIG_Lua_namespace_set(lua_State *L) {
|
|||
assert(lua_istable(L,-1));
|
||||
|
||||
SWIG_Lua_get_table(L,".set"); /* find the .set table */
|
||||
if (lua_istable(L, -1)) {
|
||||
if (lua_istable(L,-1))
|
||||
{
|
||||
/* look for the key in the .set table */
|
||||
lua_pushvalue(L,2); /* key */
|
||||
lua_rawget(L,-2);
|
||||
if (lua_iscfunction(L, -1)) {
|
||||
/* found it so call the fn & return its value */
|
||||
if (lua_iscfunction(L,-1))
|
||||
{ /* found it so call the fn & return its value */
|
||||
lua_pushvalue(L,3); /* value */
|
||||
lua_call(L,1,0);
|
||||
return 0;
|
||||
|
@ -1372,7 +1384,8 @@ SWIGINTERN void SWIG_Lua_add_variable(lua_State *L, const char *name, lua_CFunc
|
|||
SWIGINTERN void SWIG_Lua_class_register(lua_State *L,swig_lua_class *clss);
|
||||
|
||||
/* helper function - register namespace methods and attributes into namespace */
|
||||
SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State *L, swig_lua_namespace *ns) {
|
||||
SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State *L, swig_lua_namespace *ns)
|
||||
{
|
||||
int i;
|
||||
/* There must be namespace table (not metatable) at the top of the stack */
|
||||
assert(lua_istable(L,-1));
|
||||
|
@ -1395,7 +1408,8 @@ SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State *L, swig_lua_namespace *
|
|||
}
|
||||
|
||||
/* Register all classes in the namespace */
|
||||
SWIGINTERN void SWIG_Lua_add_namespace_classes(lua_State *L, swig_lua_namespace *ns) {
|
||||
SWIGINTERN void SWIG_Lua_add_namespace_classes(lua_State *L, swig_lua_namespace *ns)
|
||||
{
|
||||
swig_lua_class **classes;
|
||||
|
||||
/* There must be a module/namespace table at the top of the stack */
|
||||
|
@ -1416,7 +1430,8 @@ SWIGINTERN void SWIG_Lua_add_namespace_classes(lua_State *L, swig_lua_namespace
|
|||
when function is called).
|
||||
Function always returns newly registered table on top of the stack.
|
||||
*/
|
||||
SWIGINTERN void SWIG_Lua_namespace_register(lua_State *L, swig_lua_namespace *ns, int reg) {
|
||||
SWIGINTERN void SWIG_Lua_namespace_register(lua_State *L, swig_lua_namespace *ns, int reg)
|
||||
{
|
||||
swig_lua_namespace **sub_namespace;
|
||||
/* 1 argument - table on the top of the stack */
|
||||
const int SWIGUNUSED begin = lua_gettop(L);
|
||||
|
@ -1476,7 +1491,8 @@ SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State *L, const char *cname);
|
|||
typedef int (*swig_lua_base_iterator_func)(lua_State*,swig_type_info*, int, int *ret);
|
||||
|
||||
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) {
|
||||
int first_arg, swig_lua_base_iterator_func func, int *const ret)
|
||||
{
|
||||
/* first_arg - position of the object in stack. Everything that is above are arguments
|
||||
* and is passed to every evocation of the func */
|
||||
int last_arg = lua_gettop(L);/* position of last argument */
|
||||
|
@ -1507,7 +1523,8 @@ SWIGINTERN int SWIG_Lua_iterate_bases(lua_State *L, swig_type_info *SWIGUNUSED s
|
|||
|
||||
if(ret)
|
||||
*ret = 0;
|
||||
if (bases_count > 0) {
|
||||
if(bases_count>0)
|
||||
{
|
||||
int to_remove;
|
||||
size_t i;
|
||||
int j;
|
||||
|
@ -1573,7 +1590,8 @@ SWIGINTERN int SWIG_Lua_iterate_bases(lua_State *L, swig_type_info *SWIGUNUSED s
|
|||
* It returns an error code. Number of function return values is passed inside 'ret'.
|
||||
* first_arg is not used in this function because function always has 2 arguments.
|
||||
*/
|
||||
SWIGINTERN int SWIG_Lua_class_do_get_item(lua_State *L, swig_type_info *type, int SWIGUNUSED first_arg, int *ret) {
|
||||
SWIGINTERN int SWIG_Lua_class_do_get_item(lua_State *L, swig_type_info *type, int SWIGUNUSED first_arg, int *ret)
|
||||
{
|
||||
/* there should be 2 params passed in
|
||||
(1) userdata (not the meta table)
|
||||
(2) string name of the attribute
|
||||
|
@ -1589,8 +1607,8 @@ SWIGINTERN int SWIG_Lua_class_do_get_item(lua_State *L, swig_type_info *type, i
|
|||
/* NEW: looks for the __getitem() fn
|
||||
this is a user provided get fn */
|
||||
SWIG_Lua_get_table(L,"__getitem"); /* find the __getitem fn */
|
||||
if (lua_iscfunction(L, -1)) { /* if it's there */
|
||||
/* found it so call the fn & return its value */
|
||||
if (lua_iscfunction(L,-1)) /* if it's there */
|
||||
{ /* found it so call the fn & return its value */
|
||||
lua_pushvalue(L,substack_start+1); /* the userdata */
|
||||
lua_pushvalue(L,substack_start+2); /* the parameter */
|
||||
lua_call(L,2,1); /* 2 value in (userdata),1 out (result) */
|
||||
|
@ -1611,7 +1629,8 @@ SWIGINTERN int SWIG_Lua_class_do_get_item(lua_State *L, swig_type_info *type, i
|
|||
* It returns an error code. Number of function return values is passed inside 'ret'.
|
||||
* first_arg is not used in this function because function always has 2 arguments.
|
||||
*/
|
||||
SWIGINTERN int SWIG_Lua_class_do_get(lua_State *L, swig_type_info *type, int SWIGUNUSED first_arg, int *ret) {
|
||||
SWIGINTERN int SWIG_Lua_class_do_get(lua_State *L, swig_type_info *type, int SWIGUNUSED first_arg, int *ret)
|
||||
{
|
||||
/* there should be 2 params passed in
|
||||
(1) userdata (not the meta table)
|
||||
(2) string name of the attribute
|
||||
|
@ -1630,8 +1649,8 @@ SWIGINTERN int SWIG_Lua_class_do_get(lua_State *L, swig_type_info *type, int SW
|
|||
lua_pushvalue(L,substack_start+2); /* key */
|
||||
lua_rawget(L,-2);
|
||||
lua_remove(L,-2); /* stack tidy, remove .get table */
|
||||
if (lua_iscfunction(L, -1)) {
|
||||
/* found it so call the fn & return its value */
|
||||
if (lua_iscfunction(L,-1))
|
||||
{ /* found it so call the fn & return its value */
|
||||
lua_pushvalue(L,substack_start+1); /* the userdata */
|
||||
lua_call(L,1,1); /* 1 value in (userdata),1 out (result) */
|
||||
lua_remove(L,-2); /* stack tidy, remove metatable */
|
||||
|
@ -1646,8 +1665,8 @@ SWIGINTERN int SWIG_Lua_class_do_get(lua_State *L, swig_type_info *type, int SW
|
|||
lua_pushvalue(L,substack_start+2); /* key */
|
||||
lua_rawget(L,-2); /* look for the fn */
|
||||
lua_remove(L,-2); /* stack tidy, remove .fn table */
|
||||
if (lua_isfunction(L, -1)) { /* note: if it's a C function or lua function */
|
||||
/* found it so return the fn & let lua call it */
|
||||
if (lua_isfunction(L,-1)) /* note: if it's a C function or lua function */
|
||||
{ /* found it so return the fn & let lua call it */
|
||||
lua_remove(L,-2); /* stack tidy, remove metatable */
|
||||
if(ret)
|
||||
*ret = 1;
|
||||
|
@ -1663,7 +1682,8 @@ SWIGINTERN int SWIG_Lua_class_do_get(lua_State *L, swig_type_info *type, int SW
|
|||
|
||||
/* the class.get method, performs the lookup of class attributes
|
||||
*/
|
||||
SWIGINTERN int SWIG_Lua_class_get(lua_State *L) {
|
||||
SWIGINTERN int SWIG_Lua_class_get(lua_State *L)
|
||||
{
|
||||
/* there should be 2 params passed in
|
||||
(1) userdata (not the meta table)
|
||||
(2) string name of the attribute
|
||||
|
@ -1689,7 +1709,8 @@ SWIGINTERN int SWIG_Lua_class_get(lua_State *L) {
|
|||
/* helper for the class.set method, performs the lookup of class attributes
|
||||
* It returns error code. Number of function return values is passed inside 'ret'
|
||||
*/
|
||||
SWIGINTERN int SWIG_Lua_class_do_set(lua_State *L, swig_type_info *type, int first_arg, int *ret) {
|
||||
SWIGINTERN int SWIG_Lua_class_do_set(lua_State *L, swig_type_info *type, int first_arg, int *ret)
|
||||
{
|
||||
/* there should be 3 params passed in
|
||||
(1) table (not the meta table)
|
||||
(2) string name of the attribute
|
||||
|
@ -1706,13 +1727,14 @@ SWIGINTERN int SWIG_Lua_class_do_set(lua_State *L, swig_type_info *type, int fi
|
|||
*ret = 0; /* it is setter - number of return values is always 0 */
|
||||
|
||||
SWIG_Lua_get_table(L,".set"); /* find the .set table */
|
||||
if (lua_istable(L, -1)) {
|
||||
if (lua_istable(L,-1))
|
||||
{
|
||||
/* look for the key in the .set table */
|
||||
lua_pushvalue(L,substack_start+2); /* key */
|
||||
lua_rawget(L,-2);
|
||||
lua_remove(L,-2); /* tidy stack, remove .set table */
|
||||
if (lua_iscfunction(L, -1)) {
|
||||
/* found it so call the fn & return its value */
|
||||
if (lua_iscfunction(L,-1))
|
||||
{ /* found it so call the fn & return its value */
|
||||
lua_pushvalue(L,substack_start+1); /* userdata */
|
||||
lua_pushvalue(L,substack_start+3); /* value */
|
||||
lua_call(L,2,0);
|
||||
|
@ -1726,8 +1748,8 @@ SWIGINTERN int SWIG_Lua_class_do_set(lua_State *L, swig_type_info *type, int fi
|
|||
/* NEW: looks for the __setitem() fn
|
||||
this is a user provided set fn */
|
||||
SWIG_Lua_get_table(L,"__setitem"); /* find the fn */
|
||||
if (lua_iscfunction(L, -1)) { /* if it's there */
|
||||
/* found it so call the fn & return its value */
|
||||
if (lua_iscfunction(L,-1)) /* if it's there */
|
||||
{ /* found it so call the fn & return its value */
|
||||
lua_pushvalue(L,substack_start+1); /* the userdata */
|
||||
lua_pushvalue(L,substack_start+2); /* the parameter */
|
||||
lua_pushvalue(L,substack_start+3); /* the value */
|
||||
|
@ -1749,7 +1771,8 @@ SWIGINTERN int SWIG_Lua_class_do_set(lua_State *L, swig_type_info *type, int fi
|
|||
/* This is the actual method exported to Lua. It calls SWIG_Lua_class_do_set and correctly
|
||||
* handles return values.
|
||||
*/
|
||||
SWIGINTERN int SWIG_Lua_class_set(lua_State *L) {
|
||||
SWIGINTERN int SWIG_Lua_class_set(lua_State *L)
|
||||
{
|
||||
/* There should be 3 params passed in
|
||||
(1) table (not the meta table)
|
||||
(2) string name of the attribute
|
||||
|
@ -1773,7 +1796,8 @@ SWIGINTERN int SWIG_Lua_class_set(lua_State *L) {
|
|||
}
|
||||
|
||||
/* the class.destruct method called by the interpreter */
|
||||
SWIGINTERN int SWIG_Lua_class_destruct(lua_State *L) {
|
||||
SWIGINTERN int SWIG_Lua_class_destruct(lua_State *L)
|
||||
{
|
||||
/* there should be 1 params passed in
|
||||
(1) userdata (not the meta table) */
|
||||
swig_lua_userdata *usr;
|
||||
|
@ -1781,9 +1805,11 @@ SWIGINTERN int SWIG_Lua_class_destruct(lua_State *L) {
|
|||
assert(lua_isuserdata(L,-1)); /* just in case */
|
||||
usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */
|
||||
/* if must be destroyed & has a destructor */
|
||||
if (usr->own) { /* if must be destroyed */
|
||||
if (usr->own) /* if must be destroyed */
|
||||
{
|
||||
clss=(swig_lua_class*)usr->type->clientdata; /* get the class */
|
||||
if (clss && clss->destructor) { /* there is a destroy fn */
|
||||
if (clss && clss->destructor) /* there is a destroy fn */
|
||||
{
|
||||
clss->destructor(usr->ptr); /* bye bye */
|
||||
}
|
||||
}
|
||||
|
@ -1791,7 +1817,8 @@ SWIGINTERN int SWIG_Lua_class_destruct(lua_State *L) {
|
|||
}
|
||||
|
||||
/* the class.__tostring method called by the interpreter and print */
|
||||
SWIGINTERN int SWIG_Lua_class_tostring(lua_State *L) {
|
||||
SWIGINTERN int SWIG_Lua_class_tostring(lua_State *L)
|
||||
{
|
||||
/* there should be 1 param passed in
|
||||
(1) userdata (not the metatable) */
|
||||
swig_lua_userdata* userData;
|
||||
|
@ -1803,7 +1830,8 @@ SWIGINTERN int SWIG_Lua_class_tostring(lua_State *L) {
|
|||
}
|
||||
|
||||
/* to manually disown some userdata */
|
||||
SWIGINTERN int SWIG_Lua_class_disown(lua_State *L) {
|
||||
SWIGINTERN int SWIG_Lua_class_disown(lua_State *L)
|
||||
{
|
||||
/* there should be 1 params passed in
|
||||
(1) userdata (not the meta table) */
|
||||
swig_lua_userdata *usr;
|
||||
|
@ -1817,7 +1845,8 @@ SWIGINTERN int SWIG_Lua_class_disown(lua_State *L) {
|
|||
/* lua callable function to compare userdata's value
|
||||
the issue is that two userdata may point to the same thing
|
||||
but to lua, they are different objects */
|
||||
SWIGRUNTIME int SWIG_Lua_class_equal(lua_State *L) {
|
||||
SWIGRUNTIME int SWIG_Lua_class_equal(lua_State *L)
|
||||
{
|
||||
int result;
|
||||
swig_lua_userdata *usr1,*usr2;
|
||||
if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2)) /* just in case */
|
||||
|
@ -1831,7 +1860,8 @@ SWIGRUNTIME int SWIG_Lua_class_equal(lua_State *L) {
|
|||
}
|
||||
|
||||
/* populate table at the top of the stack with metamethods that ought to be inherited */
|
||||
SWIGINTERN void SWIG_Lua_populate_inheritable_metamethods(lua_State *L) {
|
||||
SWIGINTERN void SWIG_Lua_populate_inheritable_metamethods(lua_State *L)
|
||||
{
|
||||
SWIG_Lua_add_boolean(L, "__add", 1);
|
||||
SWIG_Lua_add_boolean(L, "__sub", 1);
|
||||
SWIG_Lua_add_boolean(L, "__mul", 1);
|
||||
|
@ -1850,7 +1880,8 @@ SWIGINTERN void SWIG_Lua_populate_inheritable_metamethods(lua_State *L) {
|
|||
}
|
||||
|
||||
/* creates the swig registry */
|
||||
SWIGINTERN void SWIG_Lua_create_class_registry(lua_State *L) {
|
||||
SWIGINTERN void SWIG_Lua_create_class_registry(lua_State *L)
|
||||
{
|
||||
/* create main SWIG registry table */
|
||||
lua_pushstring(L,"SWIG");
|
||||
lua_newtable(L);
|
||||
|
@ -1873,12 +1904,13 @@ SWIGINTERN void SWIG_Lua_create_class_registry(lua_State *L) {
|
|||
}
|
||||
|
||||
/* gets the swig registry (or creates it) */
|
||||
SWIGINTERN void SWIG_Lua_get_class_registry(lua_State *L) {
|
||||
SWIGINTERN void SWIG_Lua_get_class_registry(lua_State *L)
|
||||
{
|
||||
/* add this all into the swig registry: */
|
||||
lua_pushstring(L,"SWIG");
|
||||
lua_rawget(L,LUA_REGISTRYINDEX); /* get the registry */
|
||||
if (!lua_istable(L, -1)) { /* not there */
|
||||
/* must be first time, so add it */
|
||||
if (!lua_istable(L,-1)) /* not there */
|
||||
{ /* must be first time, so add it */
|
||||
lua_pop(L,1); /* remove the result */
|
||||
SWIG_Lua_create_class_registry(L);
|
||||
/* then get it */
|
||||
|
@ -1887,7 +1919,8 @@ SWIGINTERN void SWIG_Lua_get_class_registry(lua_State *L) {
|
|||
}
|
||||
}
|
||||
|
||||
SWIGINTERN void SWIG_Lua_get_inheritable_metamethods(lua_State *L) {
|
||||
SWIGINTERN void SWIG_Lua_get_inheritable_metamethods(lua_State *L)
|
||||
{
|
||||
SWIG_Lua_get_class_registry(L);
|
||||
lua_pushstring(L, ".library");
|
||||
lua_rawget(L,-2);
|
||||
|
@ -1901,7 +1934,8 @@ SWIGINTERN void SWIG_Lua_get_inheritable_metamethods(lua_State *L) {
|
|||
}
|
||||
|
||||
/* Helper function to get the classes metatable from the register */
|
||||
SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State *L, const char *cname) {
|
||||
SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State *L,const char *cname)
|
||||
{
|
||||
SWIG_Lua_get_class_registry(L); /* get the registry */
|
||||
lua_pushstring(L,cname); /* get the name */
|
||||
lua_rawget(L,-2); /* get it */
|
||||
|
@ -1915,11 +1949,14 @@ It cannot be done at compile time, as this will not work with hireachies
|
|||
spread over more than one swig file.
|
||||
Therefore it must be done at runtime, querying the SWIG type system.
|
||||
*/
|
||||
SWIGINTERN void SWIG_Lua_init_base_class(lua_State *L, swig_lua_class *clss) {
|
||||
SWIGINTERN void SWIG_Lua_init_base_class(lua_State *L,swig_lua_class *clss)
|
||||
{
|
||||
int i=0;
|
||||
swig_module_info *module=SWIG_GetModule(L);
|
||||
for (i = 0; clss->base_names[i]; i++) {
|
||||
if (clss->bases[i] == 0) { /* not found yet */
|
||||
for(i=0;clss->base_names[i];i++)
|
||||
{
|
||||
if (clss->bases[i]==0) /* not found yet */
|
||||
{
|
||||
/* lookup and cache the base class */
|
||||
swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]);
|
||||
if (info) clss->bases[i] = (swig_lua_class *) info->clientdata;
|
||||
|
@ -1929,7 +1966,8 @@ SWIGINTERN void SWIG_Lua_init_base_class(lua_State *L, swig_lua_class *clss) {
|
|||
|
||||
#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
|
||||
/* Merges two tables */
|
||||
SWIGINTERN void SWIG_Lua_merge_tables_by_index(lua_State *L, int target, int source) {
|
||||
SWIGINTERN void SWIG_Lua_merge_tables_by_index(lua_State *L, int target, int source)
|
||||
{
|
||||
/* iterating */
|
||||
lua_pushnil(L);
|
||||
while (lua_next(L,source) != 0) {
|
||||
|
@ -1944,7 +1982,8 @@ SWIGINTERN void SWIG_Lua_merge_tables_by_index(lua_State *L, int target, int sou
|
|||
}
|
||||
|
||||
/* Merges two tables with given name. original - index of target metatable, base - index of source metatable */
|
||||
SWIGINTERN void SWIG_Lua_merge_tables(lua_State *L, const char *name, int original, int base) {
|
||||
SWIGINTERN void SWIG_Lua_merge_tables(lua_State *L, const char* name, int original, int base)
|
||||
{
|
||||
/* push original[name], then base[name] */
|
||||
lua_pushstring(L,name);
|
||||
lua_rawget(L,original);
|
||||
|
@ -1958,7 +1997,8 @@ SWIGINTERN void SWIG_Lua_merge_tables(lua_State *L, const char *name, int origin
|
|||
}
|
||||
|
||||
/* Function takes all symbols from base and adds it to derived class. It's just a helper. */
|
||||
SWIGINTERN void SWIG_Lua_class_squash_base(lua_State *L, swig_lua_class *base_cls) {
|
||||
SWIGINTERN void SWIG_Lua_class_squash_base(lua_State *L, swig_lua_class *base_cls)
|
||||
{
|
||||
/* There is one parameter - original, i.e. 'derived' class metatable */
|
||||
assert(lua_istable(L,-1));
|
||||
int original = lua_gettop(L);
|
||||
|
@ -1971,10 +2011,12 @@ SWIGINTERN void SWIG_Lua_class_squash_base(lua_State *L, swig_lua_class *base_cl
|
|||
}
|
||||
|
||||
/* Function squashes all symbols from 'clss' bases into itself */
|
||||
SWIGINTERN void SWIG_Lua_class_squash_bases(lua_State *L, swig_lua_class *clss) {
|
||||
SWIGINTERN void SWIG_Lua_class_squash_bases(lua_State *L, swig_lua_class *clss)
|
||||
{
|
||||
int i;
|
||||
SWIG_Lua_get_class_metatable(L,clss->fqname);
|
||||
for (i = 0; clss->base_names[i]; i++) {
|
||||
for(i=0;clss->base_names[i];i++)
|
||||
{
|
||||
if (clss->bases[i]==0) /* Somehow it's not found. Skip it */
|
||||
continue;
|
||||
/* Thing is: all bases are already registered. Thus they have already executed
|
||||
|
@ -1989,13 +2031,15 @@ SWIGINTERN void SWIG_Lua_class_squash_bases(lua_State *L, swig_lua_class *clss)
|
|||
|
||||
#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) /* In elua this is useless */
|
||||
/* helper add a variable to a registered class */
|
||||
SWIGINTERN void SWIG_Lua_add_variable(lua_State *L, const char *name, lua_CFunction getFn, lua_CFunction setFn) {
|
||||
SWIGINTERN void SWIG_Lua_add_variable(lua_State *L,const char *name,lua_CFunction getFn,lua_CFunction setFn)
|
||||
{
|
||||
assert(lua_istable(L,-1)); /* just in case */
|
||||
SWIG_Lua_get_table(L,".get"); /* find the .get table */
|
||||
assert(lua_istable(L,-1)); /* just in case */
|
||||
SWIG_Lua_add_function(L,name,getFn);
|
||||
lua_pop(L,1); /* tidy stack (remove table) */
|
||||
if (setFn) {
|
||||
if (setFn)
|
||||
{
|
||||
SWIG_Lua_get_table(L,".set"); /* find the .set table */
|
||||
assert(lua_istable(L,-1)); /* just in case */
|
||||
SWIG_Lua_add_function(L,name,setFn);
|
||||
|
@ -2004,12 +2048,14 @@ SWIGINTERN void SWIG_Lua_add_variable(lua_State *L, const char *name, lua_CFunc
|
|||
}
|
||||
|
||||
/* helper to recursively add class static details (static attributes, operations and constants) */
|
||||
SWIGINTERN void SWIG_Lua_add_class_static_details(lua_State *L, swig_lua_class *clss) {
|
||||
SWIGINTERN void SWIG_Lua_add_class_static_details(lua_State *L, swig_lua_class *clss)
|
||||
{
|
||||
int i = 0;
|
||||
/* The class namespace table must be on the top of the stack */
|
||||
assert(lua_istable(L,-1));
|
||||
/* call all the base classes first: we can then override these later: */
|
||||
for (i = 0; clss->bases[i]; i++) {
|
||||
for(i=0;clss->bases[i];i++)
|
||||
{
|
||||
SWIG_Lua_add_class_static_details(L,clss->bases[i]);
|
||||
}
|
||||
|
||||
|
@ -2019,13 +2065,15 @@ SWIGINTERN void SWIG_Lua_add_class_static_details(lua_State *L, swig_lua_class *
|
|||
SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class *clss); /* forward declaration */
|
||||
|
||||
/* helper to recursively add class details (attributes & operations) */
|
||||
SWIGINTERN void SWIG_Lua_add_class_instance_details(lua_State *L, swig_lua_class *clss) {
|
||||
SWIGINTERN void SWIG_Lua_add_class_instance_details(lua_State *L, swig_lua_class *clss)
|
||||
{
|
||||
int i;
|
||||
size_t bases_count = 0;
|
||||
/* Add bases to .bases table */
|
||||
SWIG_Lua_get_table(L,".bases");
|
||||
assert(lua_istable(L,-1)); /* just in case */
|
||||
for (i = 0; clss->bases[i]; i++) {
|
||||
for(i=0;clss->bases[i];i++)
|
||||
{
|
||||
SWIG_Lua_get_class_metatable(L,clss->bases[i]->fqname);
|
||||
/* Base class must be already registered */
|
||||
assert(lua_istable(L,-1));
|
||||
|
@ -2089,7 +2137,8 @@ SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L); /*forward declaration
|
|||
* SWIG_Lua_resolve_metamethod
|
||||
* */
|
||||
SWIGINTERN int SWIG_Lua_do_resolve_metamethod(lua_State *L, const swig_lua_class *clss, int metamethod_name_idx,
|
||||
int skip_check) {
|
||||
int skip_check)
|
||||
{
|
||||
/* This function is called recursively */
|
||||
int result = 0;
|
||||
int i = 0;
|
||||
|
@ -2110,7 +2159,8 @@ SWIGINTERN int SWIG_Lua_do_resolve_metamethod(lua_State *L, const swig_lua_class
|
|||
}
|
||||
|
||||
/* Forwarding calls to bases */
|
||||
for (i = 0; clss->bases[i]; i++) {
|
||||
for(i=0;clss->bases[i];i++)
|
||||
{
|
||||
result = SWIG_Lua_do_resolve_metamethod(L, clss->bases[i], metamethod_name_idx, 0);
|
||||
if (result)
|
||||
break;
|
||||
|
@ -2121,7 +2171,8 @@ SWIGINTERN int SWIG_Lua_do_resolve_metamethod(lua_State *L, const swig_lua_class
|
|||
|
||||
/* The proxy function for metamethod. All parameters are passed as cclosure. Searches for actual method
|
||||
* and calls it */
|
||||
SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L) {
|
||||
SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L)
|
||||
{
|
||||
int numargs;
|
||||
int metamethod_name_idx;
|
||||
const swig_lua_class* clss;
|
||||
|
@ -2157,7 +2208,8 @@ SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L) {
|
|||
* Returns 1 if successfully added, 0 if not added because no base class has it, -1
|
||||
* if method is defined in the class metatable itself
|
||||
*/
|
||||
SWIGINTERN int SWIG_Lua_add_class_user_metamethod(lua_State *L, swig_lua_class *clss, const int metatable_index) {
|
||||
SWIGINTERN int SWIG_Lua_add_class_user_metamethod(lua_State *L, swig_lua_class *clss, const int metatable_index)
|
||||
{
|
||||
int key_index;
|
||||
int success = 0;
|
||||
int i = 0;
|
||||
|
@ -2177,7 +2229,8 @@ SWIGINTERN int SWIG_Lua_add_class_user_metamethod(lua_State *L, swig_lua_class *
|
|||
lua_pop(L,1);
|
||||
|
||||
/* Iterating over immediate bases */
|
||||
for (i = 0; clss->bases[i]; i++) {
|
||||
for(i=0;clss->bases[i];i++)
|
||||
{
|
||||
const swig_lua_class *base = clss->bases[i];
|
||||
SWIG_Lua_get_class_metatable(L, base->fqname);
|
||||
lua_pushvalue(L, key_index);
|
||||
|
@ -2203,7 +2256,8 @@ SWIGINTERN int SWIG_Lua_add_class_user_metamethod(lua_State *L, swig_lua_class *
|
|||
return success;
|
||||
}
|
||||
|
||||
SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class *clss) {
|
||||
SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class *clss)
|
||||
{
|
||||
int metatable_index;
|
||||
int metamethods_info_index;
|
||||
int tostring_undefined;
|
||||
|
@ -2259,7 +2313,8 @@ SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class
|
|||
}
|
||||
|
||||
/* Register class static methods,attributes etc as well as constructor proxy */
|
||||
SWIGINTERN void SWIG_Lua_class_register_static(lua_State *L, swig_lua_class *clss) {
|
||||
SWIGINTERN void SWIG_Lua_class_register_static(lua_State *L, swig_lua_class *clss)
|
||||
{
|
||||
const int SWIGUNUSED begin = lua_gettop(L);
|
||||
lua_checkstack(L,5); /* just in case */
|
||||
assert(lua_istable(L,-1)); /* just in case */
|
||||
|
@ -2273,7 +2328,8 @@ SWIGINTERN void SWIG_Lua_class_register_static(lua_State *L, swig_lua_class *cls
|
|||
so you can do MyClass(...) as well as new_MyClass(...)
|
||||
BUT only if a constructor is defined
|
||||
(this overcomes the problem of pure virtual classes without constructors)*/
|
||||
if (clss->constructor) {
|
||||
if (clss->constructor)
|
||||
{
|
||||
lua_getmetatable(L,-1);
|
||||
assert(lua_istable(L,-1)); /* just in case */
|
||||
SWIG_Lua_add_function(L,"__call", clss->constructor);
|
||||
|
@ -2291,7 +2347,8 @@ SWIGINTERN void SWIG_Lua_class_register_static(lua_State *L, swig_lua_class *cls
|
|||
/* Performs the instance (non-static) class registration process. Metatable for class is created
|
||||
* and added to the class registry.
|
||||
*/
|
||||
SWIGINTERN void SWIG_Lua_class_register_instance(lua_State *L, swig_lua_class *clss) {
|
||||
SWIGINTERN void SWIG_Lua_class_register_instance(lua_State *L,swig_lua_class *clss)
|
||||
{
|
||||
const int SWIGUNUSED begin = lua_gettop(L);
|
||||
int i;
|
||||
/* if name already there (class is already registered) then do nothing */
|
||||
|
@ -2305,7 +2362,8 @@ SWIGINTERN void SWIG_Lua_class_register_instance(lua_State *L, swig_lua_class *
|
|||
}
|
||||
lua_pop(L,2); /* tidy stack */
|
||||
/* Recursively initialize all bases */
|
||||
for (i = 0; clss->bases[i]; i++) {
|
||||
for(i=0;clss->bases[i];i++)
|
||||
{
|
||||
SWIG_Lua_class_register_instance(L,clss->bases[i]);
|
||||
}
|
||||
/* Again, get registry and push name */
|
||||
|
@ -2319,7 +2377,8 @@ SWIGINTERN void SWIG_Lua_class_register_instance(lua_State *L, swig_lua_class *
|
|||
*/
|
||||
{
|
||||
int new_metatable_index = lua_absindex(L,-1);
|
||||
for (i = 0; clss->bases[i]; i++) {
|
||||
for(i=0;clss->bases[i];i++)
|
||||
{
|
||||
int base_metatable;
|
||||
SWIG_Lua_get_class_metatable(L,clss->bases[i]->fqname);
|
||||
base_metatable = lua_absindex(L,-1);
|
||||
|
@ -2370,7 +2429,8 @@ SWIGINTERN void SWIG_Lua_class_register_instance(lua_State *L, swig_lua_class *
|
|||
assert( lua_gettop(L) == begin );
|
||||
}
|
||||
|
||||
SWIGINTERN void SWIG_Lua_class_register(lua_State *L, swig_lua_class *clss) {
|
||||
SWIGINTERN void SWIG_Lua_class_register(lua_State *L,swig_lua_class *clss)
|
||||
{
|
||||
int SWIGUNUSED begin;
|
||||
assert(lua_istable(L,-1)); /* This is a table (module or namespace) where classes will be added */
|
||||
SWIG_Lua_class_register_instance(L,clss);
|
||||
|
@ -2407,7 +2467,8 @@ SWIGINTERN void SWIG_Lua_class_register(lua_State *L, swig_lua_class *clss) {
|
|||
#endif /* SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA */
|
||||
|
||||
#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
|
||||
SWIGINTERN void SWIG_Lua_elua_class_register_instance(lua_State *L, swig_lua_class *clss) {
|
||||
SWIGINTERN void SWIG_Lua_elua_class_register_instance(lua_State *L, swig_lua_class *clss)
|
||||
{
|
||||
const int SWIGUNUSED begin = lua_gettop(L);
|
||||
int i;
|
||||
/* if name already there (class is already registered) then do nothing */
|
||||
|
@ -2421,7 +2482,8 @@ SWIGINTERN void SWIG_Lua_elua_class_register_instance(lua_State *L, swig_lua_cla
|
|||
}
|
||||
lua_pop(L,2); /* tidy stack */
|
||||
/* Recursively initialize all bases */
|
||||
for (i = 0; clss->bases[i]; i++) {
|
||||
for(i=0;clss->bases[i];i++)
|
||||
{
|
||||
SWIG_Lua_elua_class_register_instance(L,clss->bases[i]);
|
||||
}
|
||||
/* Again, get registry and push name */
|
||||
|
@ -2440,19 +2502,25 @@ SWIGINTERN void SWIG_Lua_elua_class_register_instance(lua_State *L, swig_lua_cla
|
|||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
/* helper to add metatable to new lua object */
|
||||
SWIGINTERN void SWIG_Lua_AddMetatable(lua_State *L, swig_type_info *type) {
|
||||
if (type->clientdata) { /* there is clientdata: so add the metatable */
|
||||
SWIGINTERN void SWIG_Lua_AddMetatable(lua_State *L,swig_type_info *type)
|
||||
{
|
||||
if (type->clientdata) /* there is clientdata: so add the metatable */
|
||||
{
|
||||
SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->fqname);
|
||||
if (lua_istable(L, -1)) {
|
||||
if (lua_istable(L,-1))
|
||||
{
|
||||
lua_setmetatable(L,-2);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
lua_pop(L,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* pushes a new object into the lua stack */
|
||||
SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State *L, void *ptr, swig_type_info *type, int own) {
|
||||
SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State *L,void *ptr,swig_type_info *type, int own)
|
||||
{
|
||||
swig_lua_userdata *usr;
|
||||
if (!ptr){
|
||||
lua_pushnil(L);
|
||||
|
@ -2469,40 +2537,51 @@ SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State *L, void *ptr, swig_type_info
|
|||
|
||||
/* takes a object from the lua stack & converts it into an object of the correct type
|
||||
(if possible) */
|
||||
SWIGRUNTIME int SWIG_Lua_ConvertPtr(lua_State *L, int index, void **ptr, swig_type_info *type, int flags) {
|
||||
SWIGRUNTIME int SWIG_Lua_ConvertPtr(lua_State *L,int index,void **ptr,swig_type_info *type,int flags)
|
||||
{
|
||||
int ret = SWIG_ERROR;
|
||||
swig_lua_userdata *usr;
|
||||
swig_cast_info *cast;
|
||||
/* special case: lua nil => NULL pointer */
|
||||
if (lua_isnil(L, index)) {
|
||||
if (lua_isnil(L,index))
|
||||
{
|
||||
*ptr=0;
|
||||
return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK;
|
||||
}
|
||||
if (lua_islightuserdata(L, index)) {
|
||||
if (lua_islightuserdata(L,index))
|
||||
{
|
||||
*ptr=lua_touserdata(L,index);
|
||||
return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK;
|
||||
}
|
||||
usr=(swig_lua_userdata*)lua_touserdata(L,index); /* get data */
|
||||
if (usr) {
|
||||
if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !usr->own) {
|
||||
if (usr)
|
||||
{
|
||||
if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE) && !usr->own)
|
||||
{
|
||||
return SWIG_ERROR_RELEASE_NOT_OWNED;
|
||||
}
|
||||
if (flags & SWIG_POINTER_DISOWN) { /* must disown the object */
|
||||
if (flags & SWIG_POINTER_DISOWN) /* must disown the object */
|
||||
{
|
||||
usr->own = 0;
|
||||
}
|
||||
if (!type) { /* special cast void*, no casting fn */
|
||||
if (!type) /* special cast void*, no casting fn */
|
||||
{
|
||||
*ptr=usr->ptr;
|
||||
ret = SWIG_OK;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
cast=SWIG_TypeCheck(usr->type->name,type); /* performs normal type checking */
|
||||
if (cast) {
|
||||
if (cast)
|
||||
{
|
||||
int newmemory = 0;
|
||||
*ptr=SWIG_TypeCast(cast,usr->ptr,&newmemory);
|
||||
assert(!newmemory); /* newmemory handling not yet implemented */
|
||||
ret = SWIG_OK;
|
||||
}
|
||||
}
|
||||
if ((ret == SWIG_OK) && (flags & SWIG_POINTER_CLEAR)) {
|
||||
if ((ret == SWIG_OK) && (flags & SWIG_POINTER_CLEAR))
|
||||
{
|
||||
usr->ptr = 0;
|
||||
}
|
||||
}
|
||||
|
@ -2520,7 +2599,8 @@ SWIGRUNTIME void *SWIG_Lua_MustGetPtr(lua_State *L, int index, swig_type_info *t
|
|||
}
|
||||
|
||||
/* pushes a packed userdata. user for member fn pointers only */
|
||||
SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State *L, void *ptr, size_t size, swig_type_info *type) {
|
||||
SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State *L,void *ptr,size_t size,swig_type_info *type)
|
||||
{
|
||||
swig_lua_rawdata *raw;
|
||||
assert(ptr); /* not acceptable to pass in a NULL value */
|
||||
raw=(swig_lua_rawdata*)lua_newuserdata(L,sizeof(swig_lua_rawdata)-1+size); /* alloc data */
|
||||
|
@ -2531,11 +2611,13 @@ SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State *L, void *ptr, size_t size, swi
|
|||
}
|
||||
|
||||
/* converts a packed userdata. user for member fn pointers only */
|
||||
SWIGRUNTIME int SWIG_Lua_ConvertPacked(lua_State *L, int index, void *ptr, size_t size, swig_type_info *type) {
|
||||
SWIGRUNTIME int SWIG_Lua_ConvertPacked(lua_State *L,int index,void *ptr,size_t size,swig_type_info *type)
|
||||
{
|
||||
swig_lua_rawdata *raw;
|
||||
raw=(swig_lua_rawdata*)lua_touserdata(L,index); /* get data */
|
||||
if (!raw) return SWIG_ERROR; /* error */
|
||||
if (type == 0 || type == raw->type) { /* void* or identical type */
|
||||
if (type==0 || type==raw->type) /* void* or identical type */
|
||||
{
|
||||
memcpy(ptr,raw->data,size); /* copy it */
|
||||
return SWIG_OK; /* ok */
|
||||
}
|
||||
|
@ -2543,9 +2625,11 @@ SWIGRUNTIME int SWIG_Lua_ConvertPacked(lua_State *L, int index, void *ptr, size
|
|||
}
|
||||
|
||||
/* a function to get the typestring of a piece of data */
|
||||
SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp) {
|
||||
SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp)
|
||||
{
|
||||
swig_lua_userdata *usr;
|
||||
if (lua_isuserdata(L, tp)) {
|
||||
if (lua_isuserdata(L,tp))
|
||||
{
|
||||
usr=(swig_lua_userdata*)lua_touserdata(L,tp); /* get data */
|
||||
if (usr && usr->type && usr->type->str)
|
||||
return usr->type->str;
|
||||
|
@ -2555,7 +2639,8 @@ SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp) {
|
|||
}
|
||||
|
||||
/* lua callable function to get the userdata's type */
|
||||
SWIGRUNTIME int SWIG_Lua_type(lua_State *L) {
|
||||
SWIGRUNTIME int SWIG_Lua_type(lua_State *L)
|
||||
{
|
||||
lua_pushstring(L,SWIG_Lua_typename(L,1));
|
||||
return 1;
|
||||
}
|
||||
|
@ -2704,12 +2789,10 @@ static int _wrap_new_pm3__SWIG_0(lua_State *L) {
|
|||
|
||||
SWIG_check_num_args("pm3::pm3",0,0)
|
||||
result = (pm3 *)new_pm3__SWIG_0();
|
||||
SWIG_NewPointerObj(L, result, SWIGTYPE_p_pm3, 1);
|
||||
SWIG_arg++;
|
||||
SWIG_NewPointerObj(L,result,SWIGTYPE_p_pm3,1); SWIG_arg++;
|
||||
return SWIG_arg;
|
||||
|
||||
fail:
|
||||
SWIGUNUSED;
|
||||
fail: SWIGUNUSED;
|
||||
lua_error(L);
|
||||
return 0;
|
||||
}
|
||||
|
@ -2724,12 +2807,10 @@ static int _wrap_new_pm3__SWIG_1(lua_State *L) {
|
|||
if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("pm3::pm3",1,"char *");
|
||||
arg1 = (char *)lua_tostring(L, 1);
|
||||
result = (pm3 *)new_pm3__SWIG_1(arg1);
|
||||
SWIG_NewPointerObj(L, result, SWIGTYPE_p_pm3, 1);
|
||||
SWIG_arg++;
|
||||
SWIG_NewPointerObj(L,result,SWIGTYPE_p_pm3,1); SWIG_arg++;
|
||||
return SWIG_arg;
|
||||
|
||||
fail:
|
||||
SWIGUNUSED;
|
||||
fail: SWIGUNUSED;
|
||||
lua_error(L);
|
||||
return 0;
|
||||
}
|
||||
|
@ -2759,8 +2840,7 @@ static int _wrap_new_pm3(lua_State *L) {
|
|||
" Possible C/C++ prototypes are:\n"
|
||||
" pm3::pm3()\n"
|
||||
" pm3::pm3(char *)\n");
|
||||
lua_error(L);
|
||||
return 0;
|
||||
lua_error(L);return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -2785,12 +2865,10 @@ static int _wrap_pm3_console(lua_State *L) {
|
|||
arg3 = (lua_toboolean(L, 3)!=0);
|
||||
}
|
||||
result = (int)pm3_console(arg1,arg2,arg3);
|
||||
lua_pushnumber(L, (lua_Number) result);
|
||||
SWIG_arg++;
|
||||
lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
|
||||
return SWIG_arg;
|
||||
|
||||
fail:
|
||||
SWIGUNUSED;
|
||||
fail: SWIGUNUSED;
|
||||
lua_error(L);
|
||||
return 0;
|
||||
}
|
||||
|
@ -2809,12 +2887,10 @@ static int _wrap_pm3_name_get(lua_State *L) {
|
|||
}
|
||||
|
||||
result = (char *)pm3_name_get(arg1);
|
||||
lua_pushstring(L, (const char *)result);
|
||||
SWIG_arg++;
|
||||
lua_pushstring(L,(const char *)result); SWIG_arg++;
|
||||
return SWIG_arg;
|
||||
|
||||
fail:
|
||||
SWIGUNUSED;
|
||||
fail: SWIGUNUSED;
|
||||
lua_error(L);
|
||||
return 0;
|
||||
}
|
||||
|
@ -2833,12 +2909,10 @@ static int _wrap_pm3_grabbed_output_get(lua_State *L) {
|
|||
}
|
||||
|
||||
result = (char *)pm3_grabbed_output_get(arg1);
|
||||
lua_pushstring(L, (const char *)result);
|
||||
SWIG_arg++;
|
||||
lua_pushstring(L,(const char *)result); SWIG_arg++;
|
||||
return SWIG_arg;
|
||||
|
||||
fail:
|
||||
SWIGUNUSED;
|
||||
fail: SWIGUNUSED;
|
||||
lua_error(L);
|
||||
return 0;
|
||||
}
|
||||
|
@ -3169,8 +3243,7 @@ SWIG_PropagateClientData(void) {
|
|||
|
||||
#ifdef __cplusplus
|
||||
#if 0
|
||||
{
|
||||
/* c-mode */
|
||||
{ /* c-mode */
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
@ -3267,7 +3340,8 @@ SWIGEXPORT int SWIG_init(lua_State *L) /* default Lua action */
|
|||
const char* SWIG_LUACODE=
|
||||
"";
|
||||
|
||||
void SWIG_init_user(lua_State *L) {
|
||||
void SWIG_init_user(lua_State* L)
|
||||
{
|
||||
/* exec Lua code if applicable */
|
||||
SWIG_Lua_dostring(L,SWIG_LUACODE);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue