summaryrefslogtreecommitdiff
path: root/luaclient.c
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2010-01-11 22:01:07 (GMT)
committerChristian Pointner <equinox@helsinki.at>2010-01-11 22:01:07 (GMT)
commit37ccdda9932a28ca4b974760978f6d6234007059 (patch)
tree46c43067e80e3819fb213ba7c0ce5f719e321bf8 /luaclient.c
parentd035636d833c393f86eb4eacb5c5934c94eb1a06 (diff)
luaclient receiving data works now
Diffstat (limited to 'luaclient.c')
-rw-r--r--luaclient.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/luaclient.c b/luaclient.c
index f77dbe0..58aaa7e 100644
--- a/luaclient.c
+++ b/luaclient.c
@@ -32,6 +32,7 @@
#include "l_log.h"
#include "l_sig_handler.h"
+#include "l_cmd.h"
#include "log.h"
#include "options.h"
@@ -39,10 +40,6 @@
#include "daemon.h"
#include "utils.h"
-int process_cmd(const char* cmd, int fd, cmd_t **cmd_q, client_t* client_lst, options_t* opt)
-{
- return 0;
-}
#define LUA_MAIN_LOOP_FUNC "main_loop"
@@ -52,8 +49,9 @@ static const luaL_Reg anylike_lualibs[] = {
{LUA_TABLIBNAME, luaopen_table},
{LUA_STRLIBNAME, luaopen_string},
{LUA_MATHLIBNAME, luaopen_math},
- {LUA_SIGNALLIBNAME, luaopen_signal},
{LUA_LOGLIBNAME, luaopen_log},
+ {LUA_SIGNALLIBNAME, luaopen_signal},
+ {LUA_CMDLIBNAME, luaopen_cmd},
{NULL, NULL}
};
@@ -96,7 +94,7 @@ int call_main_loop(lua_State* L, int cmd_fd, options_t* opt)
{
lua_getglobal(L, LUA_MAIN_LOOP_FUNC);
if(!lua_isfunction(L, -1)) {
- log_printf(ERROR, "there is no function '%s' inside the load file", LUA_MAIN_LOOP_FUNC);
+ log_printf(ERROR, "there is no function '%s' inside the loaded file", LUA_MAIN_LOOP_FUNC);
return -1;
};
@@ -231,7 +229,8 @@ int main(int argc, char* argv[])
fclose(pid_file);
}
- int cmd_fd = connect_command_socket(opt.command_sock_);
+ // extern global variable defined in l_cmd.c
+ cmd_fd = connect_command_socket(opt.command_sock_);
if(cmd_fd < 0) {
options_clear(&opt);
log_close();