_Bool graph_matches_ident (graph_config_t *cfg, const graph_ident_t *ident) /* {{{ */
{
+#if C4_DEBUG
if ((cfg == NULL) || (ident == NULL))
return (0);
+#endif
return (ident_matches (cfg->select, ident));
} /* }}} _Bool graph_matches_ident */
static _Bool part_matches (const char *selector, /* {{{ */
const char *part)
{
+#if C4_DEBUG
if ((selector == NULL) && (part == NULL))
return (1);
+#endif
if (selector == NULL) /* && (part != NULL) */
return (0);
_Bool ident_matches (const graph_ident_t *selector, /* {{{ */
const graph_ident_t *ident)
{
+#if C4_DEBUG
if ((selector == NULL) || (ident == NULL))
return (0);
+#endif
if (!part_matches (selector->host, ident->host))
return (0);
_Bool inst_ident_matches (graph_instance_t *inst, /* {{{ */
const graph_ident_t *ident)
{
+#if C4_DEBUG
if ((inst == NULL) || (ident == NULL))
return (0);
+#endif
return (ident_matches (inst->select, ident));
} /* }}} _Bool inst_ident_matches */