From: Florian Forster Date: Mon, 21 Jun 2010 10:30:07 +0000 (+0200) Subject: src/graph.[ch]: Implement "graph_inst_foreach". X-Git-Tag: v4.0.0~212 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=dc45c37c2c3fe9ae46e3bbbc46654eba0c2672e6;p=collection4.git src/graph.[ch]: Implement "graph_inst_foreach". --- diff --git a/src/graph.c b/src/graph.c index d314bcc..a503bfe 100644 --- a/src/graph.c +++ b/src/graph.c @@ -269,6 +269,12 @@ static int graph_search_submit (graph_instance_t *inst, /* {{{ */ return ((*data->callback) (data->cfg, inst, data->user_data)); } /* }}} int graph_search_submit */ +int graph_inst_foreach (graph_config_t *cfg, /* {{{ */ + inst_callback_t cb, void *user_data) +{ + return (inst_foreach (cfg->instances, cb, user_data)); +} /* }}} int graph_inst_foreach */ + int graph_search (graph_config_t *cfg, const char *term, /* {{{ */ graph_inst_callback_t callback, void *user_data) diff --git a/src/graph.h b/src/graph.h index 57a866f..98014c5 100644 --- a/src/graph.h +++ b/src/graph.h @@ -29,6 +29,9 @@ int graph_add_def (graph_config_t *cfg, graph_def_t *def); _Bool graph_matches (graph_config_t *cfg, const graph_ident_t *ident); +int graph_inst_foreach (graph_config_t *cfg, + inst_callback_t cb, void *user_data); + int graph_search (graph_config_t *cfg, const char *term, graph_inst_callback_t callback, void *user_data);