1 #include <murphy/common/macros.h>
3 #include <murphy/core/plugin.h>
4 #include <murphy/core/console.h>
6 #include "decision-types.h"
11 static int plugin_init(mrp_plugin_t *plugin)
13 plugin->data = create_decision(plugin->ctx, MRP_DEFAULT_PEP_ADDRESS);
15 return (plugin->data != NULL);
19 static void plugin_exit(mrp_plugin_t *plugin)
21 pdp_t *pdp = (pdp_t *)plugin->data;
23 destroy_decision(pdp);
27 static void cmd_cb(mrp_console_t *c, void *user_data, int argc, char **argv)
29 MRP_UNUSED(user_data);
33 mrp_console_printf(c, "decision:%s() called...\n", __FUNCTION__);
37 #define PLUGIN_DESCRIPTION "Murphy decision making plugin prototype."
38 #define PLUGIN_VERSION MRP_VERSION_INT(0, 0, 1)
39 #define PLUGIN_HELP "TODO..."
40 #define PLUGIN_AUTHORS "Aku Ankka <aku.ankka@ankkalinna.org>"
42 MRP_CONSOLE_GROUP(plugin_commands, "decision", NULL, NULL, {
43 MRP_TOKENIZED_CMD("cmd", cmd_cb, TRUE,
44 "cmd [args]", "a command", "A command..."),
47 MURPHY_REGISTER_PLUGIN("decision-proto",
48 PLUGIN_VERSION, PLUGIN_DESCRIPTION,
49 PLUGIN_AUTHORS, PLUGIN_HELP, MRP_SINGLETON,
50 plugin_init, plugin_exit,
51 NULL, 0, /* plugin argument table */
52 NULL, 0, /* exported methods */
53 NULL, 0, /* imported methods */