aboutsummaryrefslogtreecommitdiff
path: root/src/shared/lua_api/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/lua_api/common.c')
-rw-r--r--src/shared/lua_api/common.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/shared/lua_api/common.c b/src/shared/lua_api/common.c
new file mode 100644
index 0000000..1e0c971
--- /dev/null
+++ b/src/shared/lua_api/common.c
@@ -0,0 +1,38 @@
+
+extern "C" {
+ #include <lua.h>
+ #include <lauxlib.h>
+ #include <lualib.h>
+}
+
+#include "common.h"
+
+//Expose things to the lua state
+void loadLLibs(lua_State* L){
+
+ lua_pushcfunction(L,luaopen_base);
+ lua_pushliteral(L,"");
+ lua_call(L,1,0);
+
+ lua_pushcfunction(L,luaopen_table);
+ lua_pushliteral(L,LUA_TABLIBNAME);
+ lua_call(L,1,0);
+
+ lua_pushcfunction(L,luaopen_string);
+ lua_pushliteral(L,LUA_STRLIBNAME);
+ lua_call(L,1,0);
+
+ lua_pushcfunction(L,luaopen_math);
+ lua_pushliteral(L,LUA_MATHLIBNAME);
+ lua_call(L,1,0);
+
+ lua_pushcfunction(L,luaopen_string);
+ lua_pushliteral(L,LUA_STRLIBNAME);
+ lua_call(L,1,0);
+
+ /*
+ lua_pushcfunction(L,luaopen_string);
+ lua_pushliteral(L,LUA_STRLIBNAME);
+ lua_call(L,1,0);
+ */
+}