aboutsummaryrefslogtreecommitdiff
path: root/src/shared/lua_api/common.c
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2017-10-18 21:34:55 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2017-10-18 21:34:55 -0400
commit33e6b9627e6a46d388d46f2c5b4d15ba7e9f9904 (patch)
tree18d24b74e48d8b7e9cb656272df7a48b28d3b6c8 /src/shared/lua_api/common.c
parent76b4fddee6106b60dbc6da6d7bcef61b42a3c310 (diff)
downloadbrokengine-33e6b9627e6a46d388d46f2c5b4d15ba7e9f9904.tar.gz
brokengine-33e6b9627e6a46d388d46f2c5b4d15ba7e9f9904.tar.bz2
brokengine-33e6b9627e6a46d388d46f2c5b4d15ba7e9f9904.zip
Started refactoring
* Finished a basic server * Changed from ZMQ to nanomsg (basically the same though) * Moved some repeated code from the client/server directories into "shared" * Edited makefile to reflect new dependencies
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);
+ */
+}