-
-static _Bool part_matches (const char *sel, const char *val) /* {{{ */
-{
- if ((sel == NULL) && (val == NULL))
- return (1);
-
- if (sel == NULL) /* && (val != NULL) */
- return (0);
-
- if ((strcasecmp (ALL_TOKEN, sel) == 0)
- || (strcasecmp (ANY_TOKEN, sel) == 0))
- return (1);
-
- if (val == NULL) /* && (sel != NULL) */
- return (0);
-
- if (strcmp (sel, val) == 0)
- return (1);
-
- return (0);
-} /* }}} _Bool part_matches */
-
-static _Bool file_matches (const graph_ident_t *sel, /* {{{ */
- const graph_ident_t *val)
-{
- if ((sel == NULL) && (val == NULL))
- return (0);
- else if (sel == NULL)
- return (-1);
- else if (val == NULL)
- return (1);
-
- if (!part_matches (sel->host, val->host))
- return (0);
-
- if (!part_matches (sel->plugin, val->plugin))
- return (0);
-
- if (!part_matches (sel->plugin_instance, val->plugin_instance))
- return (0);
-
- if (!part_matches (sel->type, val->type))
- return (0);
-
- if (!part_matches (sel->type_instance, val->type_instance))
- return (0);
-
- return (1);
-} /* }}} _Bool ident_compare */
-
-/* Free all the pointers contained in the graph_ident_t but don't free the
- * graph_ident_t* itself. */
-static void ident_destroy (graph_ident_t *ident) /* {{{ */
-{
- if (ident == NULL)
- return;
-
- free (ident->host);
- ident->host = NULL;
- free (ident->plugin);
- ident->plugin = NULL;
- free (ident->plugin_instance);
- ident->plugin_instance = NULL;
- free (ident->type);
- ident->type = NULL;
- free (ident->type_instance);
- ident->type_instance = NULL;
-} /* }}} void ident_destroy */