2
0
Fork 0

Added actions and setups to plugin_core.c

personal/stbuehler/wip
Stefan Bühler 2008-07-23 22:25:16 +02:00
parent 6ee405f3cb
commit 6bbfe1e43e
1 changed files with 26 additions and 0 deletions

View File

@ -1,6 +1,25 @@
#include "base.h"
static action_result core_handle_static(server *srv, connection *con, gpointer param) {
UNUSED(param);
/* TODO */
CON_ERROR(srv, con, "%s", "Not implemented yet");
return HANDLER_ERROR;
}
static gboolean core_static(server *srv, gpointer p_d, option *opt, action_func *func) {
UNUSED(p_d);
if (opt) {
ERROR(srv, "%s", "static action doesn't have parameters");
return FALSE;
}
func->func = core_handle_static;
func->free = NULL;
func->param = NULL;
return TRUE;
}
static gboolean core_listen(server *srv, gpointer p_d, option *opt) {
UNUSED(p_d);
@ -18,6 +37,11 @@ static const plugin_option options[] = {
{ NULL, 0, NULL, NULL }
};
static const plugin_action actions[] = {
{ "static", core_static },
{ NULL, NULL }
};
static const plugin_setup setups[] = {
{ "listen", core_listen },
{ NULL, NULL }
@ -27,4 +51,6 @@ void plugin_core_init(server *srv, plugin *p) {
UNUSED(srv);
p->options = options;
p->actions = actions;
p->setups = setups;
}