From e925db2b98638929b2aaece261d3e162334b7ba3 Mon Sep 17 00:00:00 2001 From: Tilka Date: Tue, 17 Apr 2012 10:57:10 +0200 Subject: [PATCH] small cleanup --- src/core/commands.c | 2 +- src/network/network.c | 7 ------- src/network/network.h | 2 -- src/network/select.c | 2 +- src/plugin_api/command_api.h | 18 +++++++++--------- 5 files changed, 11 insertions(+), 20 deletions(-) diff --git a/src/core/commands.c b/src/core/commands.c index 113e218..311cfd8 100644 --- a/src/core/commands.c +++ b/src/core/commands.c @@ -831,7 +831,7 @@ void commands_builtin_add(struct command_base* cbase) ADD_COMMAND("getip", 5, "u", auth_cred_operator, command_getip, "Show IP address for a user" ); ADD_COMMAND("help", 4, "?c",auth_cred_guest, command_help, "Show this help message." ); ADD_COMMAND("kick", 4, "u", auth_cred_operator, command_kick, "Kick a user" ); - ADD_COMMAND("log", 3, "?m", auth_cred_operator, command_log, "Display log" ); // fail + ADD_COMMAND("log", 3, "?m",auth_cred_operator, command_log, "Display log" ); // fail ADD_COMMAND("myip", 4, "", auth_cred_guest, command_myip, "Show your own IP." ); ADD_COMMAND("reload", 6, "", auth_cred_admin, command_reload, "Reload configuration files." ); ADD_COMMAND("shutdown", 8, "", auth_cred_admin, command_shutdown_hub, "Shutdown hub." ); diff --git a/src/network/network.c b/src/network/network.c index 4ddff6e..a7164d6 100644 --- a/src/network/network.c +++ b/src/network/network.c @@ -114,13 +114,6 @@ int net_destroy() return -1; } -#ifdef USE_LIBEVENT -struct event_base* net_get_evbase() -{ - return net_evbase; -} -#endif - static void net_error_out(int fd, const char* func) { int err = net_error(); diff --git a/src/network/network.h b/src/network/network.h index 4601d87..ef02ba6 100644 --- a/src/network/network.h +++ b/src/network/network.h @@ -51,8 +51,6 @@ extern int net_initialize(); */ extern int net_destroy(); -extern struct event_base* net_get_evbase(); - /** * @return the number of sockets currrently being monitored. */ diff --git a/src/network/select.c b/src/network/select.c index 1a0ef28..31efeff 100644 --- a/src/network/select.c +++ b/src/network/select.c @@ -55,7 +55,7 @@ int net_backend_poll_select(struct net_backend* data, int ms) struct net_backend_select* backend = (struct net_backend_select*) data; tval.tv_sec = ms / 1000; - tval.tv_usec = ((ms % 1000) * 1000); // FIXME: correct? + tval.tv_usec = (ms % 1000) * 1000; FD_ZERO(&backend->rfds); FD_ZERO(&backend->wfds); diff --git a/src/plugin_api/command_api.h b/src/plugin_api/command_api.h index dd75882..021d933 100644 --- a/src/plugin_api/command_api.h +++ b/src/plugin_api/command_api.h @@ -52,15 +52,15 @@ typedef int (*plugin_command_handler)(struct plugin_handle*, struct plugin_user* struct plugin_command_handle { - void* internal_handle; /**<<< "Internal used by the hub only" */ - struct plugin_handle* handle; /**<<< "The plugin handle this is associated with" */ - const char* prefix; /**<<< "Command prefix, for instance 'help' would be the prefix for the !help command." */ - size_t length; /**<<< "Length of the prefix" */ - const char* args; /**<<< "Argument codes" */ - enum auth_credentials cred; /**<<< "Minimum access level for the command" */ - plugin_command_handler handler; /**<<< "Function pointer for the command" */ - const char* description; /**<<< "Description for the command" */ - const char* origin; /**<<< "Name of plugin where the command originated." */ + void* internal_handle; /**<<< "Internal used by the hub only" */ + struct plugin_handle* handle; /**<<< "The plugin handle this is associated with" */ + const char* prefix; /**<<< "Command prefix, for instance 'help' would be the prefix for the !help command." */ + size_t length; /**<<< "Length of the prefix" */ + const char* args; /**<<< "Argument codes" */ + enum auth_credentials cred; /**<<< "Minimum access level for the command" */ + plugin_command_handler handler; /**<<< "Function pointer for the command" */ + const char* description; /**<<< "Description for the command" */ + const char* origin; /**<<< "Name of plugin where the command originated." */ }; #define PLUGIN_COMMAND_INITIALIZE(PTR, HANDLE, PREFIX, ARGS, CRED, CALLBACK, DESC) \