summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7411750)
raw | patch | inline | side by side (parent: 7411750)
author | Florian Forster <ff@octo.it> | |
Fri, 25 Jun 2010 09:30:32 +0000 (11:30 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Fri, 25 Jun 2010 09:30:32 +0000 (11:30 +0200) |
src/graph.c | patch | blob | history | |
src/graph.h | patch | blob | history |
diff --git a/src/graph.c b/src/graph.c
index 4ed2d155c7988e9c24bcfe14dba09d90c0b920d5..0802bee4306f70775e6f7ac34f9fbdb1d8fbe407 100644 (file)
--- a/src/graph.c
+++ b/src/graph.c
return (NULL);
} /* }}} graph_instance_t *graph_inst_find_matching */
+int graph_inst_find_all_matching (graph_config_t *cfg, /* {{{ */
+ const graph_ident_t *ident,
+ graph_inst_callback_t callback, void *user_data)
+{
+ size_t i;
+
+ if ((cfg == NULL) || (ident == NULL) || (callback == NULL))
+ return (EINVAL);
+
+ for (i = 0; i < cfg->instances_num; i++)
+ {
+ int status;
+
+ if (!inst_matches_ident (cfg->instances[i], ident))
+ continue;
+
+ status = (*callback) (cfg, cfg->instances[i], user_data);
+ if (status != 0)
+ return (status);
+ }
+
+ return (0);
+} /* }}} int graph_inst_find_all_matching */
+
int graph_inst_search (graph_config_t *cfg, const char *term, /* {{{ */
graph_inst_callback_t cb,
void *user_data)
diff --git a/src/graph.h b/src/graph.h
index d303a8515e728c9e961bf95c69097473cb98e468..0cb45d7133a579092e2974a1237bc54d1900633c 100644 (file)
--- a/src/graph.h
+++ b/src/graph.h
graph_instance_t *graph_inst_find_matching (graph_config_t *cfg,
const graph_ident_t *ident);
+int graph_inst_find_all_matching (graph_config_t *cfg,
+ const graph_ident_t *ident,
+ graph_inst_callback_t callback, void *user_data);
+
int graph_inst_search (graph_config_t *cfg, const char *term,
graph_inst_callback_t callback, void *user_data);