X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fgraph_list.c;h=0dc00063f06a9cd01cc41a34a555b824dfca3eb1;hb=2ab3d5bed954cccd4486ed3c8255f27b0a6ab7eb;hp=965fcbac4f6caad5913b9a0097dd2937ec773ffb;hpb=0ab3085f89e64eecd67d3179ea87f0463e918a10;p=collection4.git diff --git a/src/graph_list.c b/src/graph_list.c index 965fcba..0dc0006 100644 --- a/src/graph_list.c +++ b/src/graph_list.c @@ -12,7 +12,7 @@ #include "graph_config.h" #include "common.h" #include "filesystem.h" -#include "utils_params.h" +#include "utils_cgi.h" #include #include @@ -73,7 +73,7 @@ static int gl_register_file (const graph_ident_t *file, /* {{{ */ graph_config_t *cfg = gl_active[i]; int status; - if (!graph_matches (cfg, file)) + if (!graph_matches_ident (cfg, file)) continue; status = graph_add_file (cfg, file); @@ -153,7 +153,7 @@ int gl_config_submit (void) /* {{{ */ return (0); } /* }}} int graph_config_submit */ -int gl_graph_get_all (gl_cfg_callback callback, /* {{{ */ +int gl_graph_get_all (graph_callback_t callback, /* {{{ */ void *user_data) { size_t i; @@ -211,7 +211,7 @@ graph_config_t *gl_graph_get_selected (void) /* {{{ */ struct gl_inst_callback_data /* {{{ */ { graph_config_t *cfg; - gl_inst_callback callback; + graph_inst_callback_t callback; void *user_data; }; /* }}} struct gl_inst_callback_data */ @@ -224,7 +224,7 @@ static int gl_inst_callback_handler (graph_instance_t *inst, /* {{{ */ } /* }}} int gl_inst_callback_handler */ int gl_graph_instance_get_all (graph_config_t *cfg, /* {{{ */ - gl_inst_callback callback, void *user_data) + graph_inst_callback_t callback, void *user_data) { struct gl_inst_callback_data data = { @@ -236,11 +236,10 @@ int gl_graph_instance_get_all (graph_config_t *cfg, /* {{{ */ if ((cfg == NULL) || (callback == NULL)) return (EINVAL); - return (inst_foreach (graph_get_instances (cfg), - gl_inst_callback_handler, &data)); + return (graph_inst_foreach (cfg, gl_inst_callback_handler, &data)); } /* }}} int gl_graph_instance_get_all */ -int gl_instance_get_all (gl_inst_callback callback, /* {{{ */ +int gl_instance_get_all (graph_inst_callback_t callback, /* {{{ */ void *user_data) { size_t i; @@ -260,6 +259,25 @@ int gl_instance_get_all (gl_inst_callback callback, /* {{{ */ } /* }}} int gl_instance_get_all */ /* }}} gl_instance_get_all, gl_graph_instance_get_all */ +int gl_search (const char *term, graph_inst_callback_t callback, /* {{{ */ + void *user_data) +{ + size_t i; + + for (i = 0; i < gl_active_num; i++) + { + int status; + + status = graph_inst_search (gl_active[i], term, + /* callback = */ callback, + /* user data = */ user_data); + if (status != 0) + return (status); + } + + return (0); +} /* }}} int gl_search */ + int gl_update (void) /* {{{ */ { time_t now;