diff options
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -2,9 +2,7 @@ #include <sys/epoll.h> #include <unistd.h> -#include <lauxlib.h> #include <lua.h> -#include <lualib.h> #include "plop.h" @@ -25,9 +23,6 @@ static void usage(const char * const name) /// \return Error code int main(int argc, char ** argv) { - lua_State * L = luaL_newstate(); - luaL_openlibs(L); - const char * service = "8080"; int opt; @@ -54,6 +49,13 @@ int main(int argc, char ** argv) return 8; } + lua_State * L = plop_initialize_lua(); + + if (NULL == L) + { + return 9; + } + if (LUA_OK != plop_load_handler(L, argv[optind])) { return 2; |