diff --git a/include/villas/utils.h b/include/villas/utils.h index 62c6a9e7a..aa76bc048 100644 --- a/include/villas/utils.h +++ b/include/villas/utils.h @@ -176,6 +176,7 @@ char * cpulist_create(char *str, size_t len, cpu_set_t *set); json_t * config_to_json(config_setting_t *cfg); #endif +int json_to_config(json_t *json, config_setting_t *parent); /** Allocate and initialize memory. */ void * alloc(size_t bytes); diff --git a/plugins/hooks/example_hook.c b/plugins/hooks/example_hook.c index 1bd247fd2..aa7089102 100644 --- a/plugins/hooks/example_hook.c +++ b/plugins/hooks/example_hook.c @@ -14,10 +14,10 @@ struct hook; struct path; struct sample; -static int hook_example(struct hook *h, int when, struct hook_info *j) +static int example_start(struct hook *h) { info("Hello world from example hook!"); - + return 0; } @@ -27,8 +27,7 @@ static struct plugin p = { .type = PLUGIN_TYPE_HOOK, .hook = { .priority = 99, - .cb = hook_example, - .when = HOOK_PATH_START + .start = example_start } };