X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fgraph_instance.h;h=b1d2df9c043301ec89838117e2b351cdeb8d8a63;hb=c3e2812ad41146fc003f8a74dd8495e88047b873;hp=f0425d21a5dda3f945cf64bdfe5fc9c9805f314d;hpb=7b68199fab8170cb1c383652379f4b41f1ecf0af;p=collection4.git diff --git a/src/graph_instance.h b/src/graph_instance.h index f0425d2..b1d2df9 100644 --- a/src/graph_instance.h +++ b/src/graph_instance.h @@ -4,6 +4,7 @@ #include #include "graph_types.h" +#include "graph_ident.h" #include "utils_array.h" /* @@ -33,6 +34,14 @@ _Bool inst_matches_ident (graph_instance_t *inst, const graph_ident_t *ident); _Bool inst_matches_string (graph_config_t *cfg, graph_instance_t *inst, const char *term); +/* Compares the given string with the appropriate field of the selector or, if + * the selector field is "/all/", iterates over all the files of the instance + * and checks the appropriate field. Returns true if the field of the selector + * or of one of the files matches. The string must match entirely but + * comparison is done case-insensitive. */ +_Bool inst_matches_field (graph_instance_t *inst, + graph_ident_field_t field, const char *field_value); + int inst_describe (graph_config_t *cfg, graph_instance_t *inst, char *buffer, size_t buffer_size);