+int graph_inst_search_field (graph_config_t *cfg, /* {{{ */
+ graph_ident_field_t field, const char *field_value,
+ graph_inst_callback_t callback, void *user_data)
+{
+ size_t i;
+
+ if ((cfg == NULL) || (field_value == NULL) || (callback == NULL))
+ return (EINVAL);
+
+ if (!graph_matches_field (cfg, field, field_value))
+ return (0);
+
+ for (i = 0; i < cfg->instances_num; i++)
+ {
+ if (inst_matches_field (cfg->instances[i], field, field_value))
+ {
+ int status;
+
+ status = (*callback) (cfg, cfg->instances[i], user_data);
+ if (status != 0)
+ return (status);
+ }
+ }
+
+ return (0);
+} /* }}} int graph_inst_search_field */
+