From dc45c37c2c3fe9ae46e3bbbc46654eba0c2672e6 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Mon, 21 Jun 2010 12:30:07 +0200 Subject: [PATCH] src/graph.[ch]: Implement "graph_inst_foreach". --- src/graph.c | 6 ++++++ src/graph.h | 3 +++ 2 files changed, 9 insertions(+) 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); -- 2.11.0