-static int mr_match (const data_set_t __attribute__((unused)) *ds, /* {{{ */
- const value_list_t *vl,
- notification_meta_t __attribute__((unused)) **meta,
- void **user_data)
-{
- mr_match_t *m;
- int match_value = FC_MATCH_MATCHES;
- int nomatch_value = FC_MATCH_NO_MATCH;
-
- if ((user_data == NULL) || (*user_data == NULL))
- return (-1);
-
- m = *user_data;
-
- if (m->invert)
- {
- match_value = FC_MATCH_NO_MATCH;
- nomatch_value = FC_MATCH_MATCHES;
- }
-
- if (mr_match_regexen (m->host, vl->host) == FC_MATCH_NO_MATCH)
- return (nomatch_value);
- if (mr_match_regexen (m->plugin, vl->plugin) == FC_MATCH_NO_MATCH)
- return (nomatch_value);
- if (mr_match_regexen (m->plugin_instance,
- vl->plugin_instance) == FC_MATCH_NO_MATCH)
- return (nomatch_value);
- if (mr_match_regexen (m->type, vl->type) == FC_MATCH_NO_MATCH)
- return (nomatch_value);
- if (mr_match_regexen (m->type_instance,
- vl->type_instance) == FC_MATCH_NO_MATCH)
- return (nomatch_value);
- if (vl->meta != NULL)
- {
- for (llentry_t *e = llist_head(m->meta); e != NULL; e = e->next)
- {
- mr_regex_t *meta_re = (mr_regex_t *) e->value;
- char *value;
- int status = meta_data_get_string (vl->meta, e->key, &value);
- if (status == (-ENOENT)) /* key is not present */
- return (nomatch_value);
- if (status != 0) /* some other problem */
- continue; /* error will have already been printed. */
- if (mr_match_regexen (meta_re, value) == FC_MATCH_NO_MATCH)
- {
- sfree (value);
- return (nomatch_value);
- }
- sfree (value);
- }
- }
-
- return (match_value);
+static int mr_match(const data_set_t __attribute__((unused)) * ds, /* {{{ */
+ const value_list_t *vl,
+ notification_meta_t __attribute__((unused)) * *meta,
+ void **user_data) {
+ mr_match_t *m;
+ int match_value = FC_MATCH_MATCHES;
+ int nomatch_value = FC_MATCH_NO_MATCH;
+
+ if ((user_data == NULL) || (*user_data == NULL))
+ return -1;
+
+ m = *user_data;
+
+ if (m->invert) {
+ match_value = FC_MATCH_NO_MATCH;
+ nomatch_value = FC_MATCH_MATCHES;
+ }
+
+ if (mr_match_regexen(m->host, vl->host) == FC_MATCH_NO_MATCH)
+ return nomatch_value;
+ if (mr_match_regexen(m->plugin, vl->plugin) == FC_MATCH_NO_MATCH)
+ return nomatch_value;
+ if (mr_match_regexen(m->plugin_instance, vl->plugin_instance) ==
+ FC_MATCH_NO_MATCH)
+ return nomatch_value;
+ if (mr_match_regexen(m->type, vl->type) == FC_MATCH_NO_MATCH)
+ return nomatch_value;
+ if (mr_match_regexen(m->type_instance, vl->type_instance) ==
+ FC_MATCH_NO_MATCH)
+ return nomatch_value;
+ if (vl->meta != NULL) {
+ for (llentry_t *e = llist_head(m->meta); e != NULL; e = e->next) {
+ mr_regex_t *meta_re = (mr_regex_t *)e->value;
+ char *value;
+ int status = meta_data_get_string(vl->meta, e->key, &value);
+ if (status == (-ENOENT)) /* key is not present */
+ return nomatch_value;
+ if (status != 0) /* some other problem */
+ continue; /* error will have already been printed. */
+ if (mr_match_regexen(meta_re, value) == FC_MATCH_NO_MATCH) {
+ sfree(value);
+ return nomatch_value;
+ }
+ sfree(value);
+ }
+ }
+
+ return match_value;