summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9cf5f9b)
raw | patch | inline | side by side (parent: 9cf5f9b)
author | Florian Forster <ff@octo.it> | |
Wed, 14 Jul 2010 08:18:26 +0000 (10:18 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Wed, 14 Jul 2010 08:18:26 +0000 (10:18 +0200) |
src/utils_search.c | patch | blob | history | |
src/utils_search.h | patch | blob | history |
diff --git a/src/utils_search.c b/src/utils_search.c
index e2a89f30a305896d2aec86620a11e01ac7ab8867..aa157e6df6307d925bd8a173535de22cec9f67dc 100644 (file)
--- a/src/utils_search.c
+++ b/src/utils_search.c
array_destroy (si->terms);
} /* }}} void search_destroy */
+_Bool search_has_selector (search_info_t *si) /* {{{ */
+{
+ if (si == NULL)
+ return (0);
+
+ if ((si->host != NULL)
+ || (si->plugin != NULL) || (si->plugin_instance != NULL)
+ || (si->type != NULL) || (si->type_instance != NULL))
+ return (1);
+
+ return (0);
+} /* }}} _Bool search_has_selector */
+
graph_ident_t *search_to_ident (search_info_t *si) /* {{{ */
{
if (si == NULL)
diff --git a/src/utils_search.h b/src/utils_search.h
index 5e3e2b8e7ea711e658ac0d8d506e9c8a646f880b..746edccd976c007f304d8970ad1387da9e83f469 100644 (file)
--- a/src/utils_search.h
+++ b/src/utils_search.h
search_info_t *search_parse (const char *search);
void search_destroy (search_info_t *si);
+/* Returns true if at least one of the ident fields is defined (not a
+ * wildcard), false otherwise. If no field has been specified, searching is a
+ * lot easier. */
+_Bool search_has_selector (search_info_t *si);
+
graph_ident_t *search_to_ident (search_info_t *si);
_Bool search_graph_title_matches (search_info_t *si, const char *title);