flac: Saner EOF handling
[cmus.git] / filters.h
blobe02be4116e2822dd3c034d396177281459bb423e
1 /*
2 * Copyright 2005 Timo Hirvonen
3 */
5 #ifndef FILTERS_H
6 #define FILTERS_H
8 #include "list.h"
9 #include "window.h"
10 #include "search.h"
11 #include "uchar.h"
13 /* factivate foo !bar
15 * foo: FS_YES
16 * bar: FS_NO
17 * baz: FS_IGNORE
19 enum {
20 /* [ ] filter not selected */
21 FS_IGNORE,
22 /* [*] filter selected */
23 FS_YES,
24 /* [!] filter selected and inverted */
25 FS_NO,
28 struct filter_entry {
29 struct list_head node;
31 char *name;
32 char *filter;
33 unsigned visited : 1;
35 /* selected and activated status (FS_* enum) */
36 unsigned sel_stat : 2;
37 unsigned act_stat : 2;
40 static inline struct filter_entry *iter_to_filter_entry(struct iter *iter)
42 return iter->data1;
45 extern struct window *filters_win;
46 extern struct searchable *filters_searchable;
47 extern struct list_head filters_head;
49 void filters_init(void);
50 void filters_exit(void);
52 /* parse filter and expand sub filters */
53 struct expr *parse_filter(const char *val);
55 /* add filter to filter list (replaces old filter with same name)
57 * @keyval "name=value" where value is filter
59 void filters_set_filter(const char *keyval);
61 /* set throwaway filter (not saved to the filter list)
63 * @val filter or NULL to disable filtering
65 void filters_set_anonymous(const char *val);
67 void filters_activate_names(const char *str);
69 void filters_activate(void);
70 void filters_toggle_filter(void);
71 void filters_delete_filter(void);
73 #endif