| 2611 | } |
| 2612 | |
| 2613 | static int matches(const char *key, const char *value, |
| 2614 | const struct config_store_data *store) |
| 2615 | { |
| 2616 | if (strcmp(key, store->key)) |
| 2617 | return 0; /* not ours */ |
| 2618 | if (store->fixed_value && value) |
| 2619 | return !strcmp(store->fixed_value, value); |
| 2620 | if (!store->value_pattern) |
| 2621 | return 1; /* always matches */ |
| 2622 | if (store->value_pattern == CONFIG_REGEX_NONE) |
| 2623 | return 0; /* never matches */ |
| 2624 | |
| 2625 | return store->do_not_match ^ |
| 2626 | (value && !regexec(store->value_pattern, value, 0, NULL, 0)); |
| 2627 | } |
| 2628 | |
| 2629 | static int store_aux_event(enum config_event_t type, size_t begin, size_t end, |
| 2630 | struct config_source *cs, void *data) |