26 #define DBG_LUA LOG_STREAM(debug, log_scripting_lua)
27 #define LOG_LUA LOG_STREAM(info, log_scripting_lua)
28 #define WRN_LUA LOG_STREAM(warn, log_scripting_lua)
29 #define ERR_LUA LOG_STREAM(err, log_scripting_lua)
50 ERR_LUA <<
"This may indicate a memory leak, please report at bugs.wesnoth.org" << std::endl;
51 lua_pushstring(L,
"C++ function object garbage collection failure");
64 result <<
"c++ function: " << std::hex <<
d;
95 if (
l.name !=
nullptr) {
120 if (
l.name ==
nullptr) {
124 for (i = 0; i < nup; ++
i)
std::function< int(lua_State *)> lua_function
LUALIB_API void * luaL_checkudata(lua_State *L, int ud, const char *tname)
#define lua_pushcfunction(L, f)
LUA_API int lua_type(lua_State *L, int idx)
static int intf_closure_dispatcher(lua_State *L)
LUALIB_API void luaL_checkstack(lua_State *L, int space, const char *msg)
LUA_API void lua_pushcclosure(lua_State *L, lua_CFunction fn, int n)
LUALIB_API void luaL_setmetatable(lua_State *L, const char *tname)
void push_function(lua_State *L, const lua_function &f)
Pushes a std::function wrapper object onto the stack.
LUA_API void * lua_newuserdata(lua_State *L, size_t size)
#define lua_upvalueindex(i)
static int intf_cleanup(lua_State *L)
void push_closure(lua_State *L, const lua_function &f, int nup)
Pushes a closure which retains a std::function object as its first up-value.
LUA_API void lua_remove(lua_State *L, int idx)
LUALIB_API void * luaL_testudata(lua_State *L, int ud, const char *tname)
LUALIB_API int luaL_newmetatable(lua_State *L, const char *tname)
#define luaL_checkversion(L)
char const * cpp_function
static int intf_dispatcher(lua_State *L)
LUA_API void lua_insert(lua_State *L, int idx)
LUA_API void lua_pushvalue(lua_State *L, int idx)
LUA_API int lua_error(lua_State *L)
Standard logging facilities (interface).
void register_metatable(lua_State *L)
static int intf_tostring(lua_State *L)
static lg::log_domain log_scripting_lua("scripting/lua")
LUA_API const char * lua_pushstring(lua_State *L, const char *s)
LUA_API void lua_setfield(lua_State *L, int idx, const char *k)
LUA_API const char * lua_typename(lua_State *L, int t)
void set_functions(lua_State *L, const std::vector< lua_cpp::Reg > &functions)
Analogous to lua_setfuncs, it registers a collection of function wrapper objects into a table...