X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fgraph.c;h=75c83b1b92240c27ca685d2105542663b7023242;hb=559db522731e674dbdad045d0e65b9376e2f91f4;hp=d3a8d6f850495df772b508439da8030dde7f435d;hpb=b53e616d07cc7b10d1d159d01e20ea4eb8284b5e;p=collection4.git diff --git a/src/graph.c b/src/graph.c index d3a8d6f..75c83b1 100644 --- a/src/graph.c +++ b/src/graph.c @@ -297,7 +297,7 @@ int graph_add_def (graph_config_t *cfg, graph_def_t *def) /* {{{ */ return (def_append (cfg->defs, tmp)); } /* }}} int graph_add_def */ -_Bool graph_matches_ident (graph_config_t *cfg, const graph_ident_t *ident) /* {{{ */ +_Bool graph_ident_matches (graph_config_t *cfg, const graph_ident_t *ident) /* {{{ */ { #if C4_DEBUG if ((cfg == NULL) || (ident == NULL)) @@ -305,6 +305,17 @@ _Bool graph_matches_ident (graph_config_t *cfg, const graph_ident_t *ident) /* { #endif 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, /* {{{ */ @@ -486,10 +497,18 @@ int graph_compare (graph_config_t *cfg, const graph_ident_t *ident) /* {{{ */ static int graph_sort_instances_cb (const void *v0, const void *v1) /* {{{ */ { - return (ident_compare (*(graph_ident_t * const *) v0, - *(graph_ident_t * const *) v1)); + return (inst_compare (*(graph_instance_t * const *) v0, + *(graph_instance_t * const *) v1)); } /* }}} int graph_sort_instances_cb */ +size_t graph_num_instances (graph_config_t *cfg) /* {{{ */ +{ + if (cfg == NULL) + return ((size_t) -1); + + return (cfg->instances_num); +} /* }}} size_t graph_num_instances */ + int graph_sort_instances (graph_config_t *cfg) /* {{{ */ { if (cfg == NULL)