diff options
-rw-r--r-- | include/BLua.h | 3 | ||||
-rw-r--r-- | lib/BLua.cc | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/include/BLua.h b/include/BLua.h index 6fadeaf..4d53191 100644 --- a/include/BLua.h +++ b/include/BLua.h @@ -61,6 +61,8 @@ class LuaObject : public Base { bool wantdestruct, pushed; }; +typedef int (*openlualib_t)(lua_State * L); + //!Basic LUA engine. /*! This will create an LUA context, and provide mechanisms to interact with it. @@ -77,6 +79,7 @@ class Lua : public Base { void open_math(); void open_debug(); void open_dir(); + int wrap_open(openlualib_t); void declarefunc(const String &, lua_CFunction, int = LUA_GLOBALSINDEX); void call(const String &, int = LUA_GLOBALSINDEX, int = 0, int = 0); void call(int = 0, int = 0) throw (GeneralException); diff --git a/lib/BLua.cc b/lib/BLua.cc index 9bd7828..6494211 100644 --- a/lib/BLua.cc +++ b/lib/BLua.cc @@ -638,6 +638,10 @@ void Lua::open_dir() { lua_pop(L, 1); } +int Lua::wrap_open(openlualib_t open) { + return open(L); +} + void Lua::declarefunc(const String & name, lua_CFunction f, int i) { lua_pushstring(L, name.to_charp()); lua_pushcfunction(L, f); |