diff options
Diffstat (limited to 'sway/criteria.c')
-rw-r--r-- | sway/criteria.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sway/criteria.c b/sway/criteria.c index ee6d4d1c..1ea8311e 100644 --- a/sway/criteria.c +++ b/sway/criteria.c | |||
@@ -359,6 +359,16 @@ void free_criteria(struct criteria *crit) { | |||
359 | free(crit); | 359 | free(crit); |
360 | } | 360 | } |
361 | 361 | ||
362 | bool criteria_any(swayc_t *cont, list_t *criteria) { | ||
363 | for (int i = 0; i < criteria->length; i++) { | ||
364 | struct criteria *bc = criteria->items[i]; | ||
365 | if (criteria_test(cont, bc->tokens)) { | ||
366 | return true; | ||
367 | } | ||
368 | } | ||
369 | return false; | ||
370 | } | ||
371 | |||
362 | list_t *criteria_for(swayc_t *cont) { | 372 | list_t *criteria_for(swayc_t *cont) { |
363 | list_t *criteria = config->criteria, *matches = create_list(); | 373 | list_t *criteria = config->criteria, *matches = create_list(); |
364 | for (int i = 0; i < criteria->length; i++) { | 374 | for (int i = 0; i < criteria->length; i++) { |