summaryrefslogtreecommitdiffhomepage
path: root/plop.c
diff options
context:
space:
mode:
Diffstat (limited to 'plop.c')
-rw-r--r--plop.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/plop.c b/plop.c
index c64ad11..592fca0 100644
--- a/plop.c
+++ b/plop.c
@@ -13,11 +13,28 @@
#include <lauxlib.h>
#include <lua.h>
+#include <lualib.h>
#include "connection.h"
#include "request.h"
#include "response.h"
+/// Initializes new Lua state for the server.
+/// \return Lua state
+lua_State * plop_initialize_lua(void)
+{
+ lua_State * L = luaL_newstate();
+
+ if (NULL == L)
+ {
+ return NULL;
+ }
+
+ luaL_openlibs(L);
+
+ return L;
+}
+
/// Tries to create, bind and start listening on INET server socket.
/// \param node Hostname
/// \param service Port