summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f32297a)
raw | patch | inline | side by side (parent: f32297a)
author | Florian Forster <ff@octo.it> | |
Mon, 12 Jul 2010 09:28:04 +0000 (11:28 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Mon, 12 Jul 2010 09:28:04 +0000 (11:28 +0200) |
src/graph.c | patch | blob | history | |
src/graph.h | patch | blob | history |
diff --git a/src/graph.c b/src/graph.c
index 845bbb7a02f7abedb13261c17e5621100d5cbb79..75c83b1b92240c27ca685d2105542663b7023242 100644 (file)
--- a/src/graph.c
+++ b/src/graph.c
@@ -307,6 +307,17 @@ _Bool graph_ident_matches (graph_config_t *cfg, const graph_ident_t *ident) /* {
return (ident_matches (cfg->select, ident));
} /* }}} _Bool graph_ident_matches */
+_Bool graph_matches_ident (graph_config_t *cfg, /* {{{ */
+ const graph_ident_t *selector)
+{
+#if C4_DEBUG
+ if ((cfg == NULL) || (selector == NULL))
+ return (0);
+#endif
+
+ return (ident_matches (selector, cfg->select));
+} /* }}} _Bool graph_matches_ident */
+
_Bool graph_matches_field (graph_config_t *cfg, /* {{{ */
graph_ident_field_t field, const char *field_value)
{
diff --git a/src/graph.h b/src/graph.h
index 7a433f19e2cd620fa6d76119031b53f9adb6f4dc..69a3fbef2ebf84aa4346748652bc0541cf228a3b 100644 (file)
--- a/src/graph.h
+++ b/src/graph.h
int graph_add_def (graph_config_t *cfg, graph_def_t *def);
+/* Returns true if the given "ident" matches the (more general) selector of
+ * the graph "cfg". */
_Bool graph_ident_matches (graph_config_t *cfg, const graph_ident_t *ident);
+/* Returns true if the selector of the graph "cfg" matches the more general
+ * ident "selector". */
+_Bool graph_matches_ident (graph_config_t *cfg,
+ const graph_ident_t *selector);
+
/* Compares the given string with the appropriate field of the selector. If the
* selector field is "/all/" or "/any/", returns true without checking the
* instances. See "graph_inst_search_field" for finding all matching instances.