#define TR_MAX_FILTERS 5
#define TR_MAX_FILTER_LINES 8
#define TR_MAX_FILTER_SPECS 8
+#define TR_MAX_FILTER_SPEC_MATCHES 8
/* Filter actions */
typedef enum {
TR_FILTER_TYPE_UNKNOWN
} TR_FILTER_TYPE;
-extern const size_t tr_num_filter_types;
-const char *tr_filter_type_to_string(TR_FILTER_TYPE t);
-TR_FILTER_TYPE tr_filter_type_from_string(const char *s);
-
typedef struct tr_fspec {
TR_NAME *field;
- TR_NAME *match;
+ TR_NAME *match[TR_MAX_FILTER_SPEC_MATCHES];
} TR_FSPEC;
typedef struct tr_fline {
void tr_fspec_free(TR_FSPEC *fspec);
-void tr_fspec_set_match(TR_FSPEC *fspec, TR_NAME *match);
+void tr_fspec_add_match(TR_FSPEC *fspec, TR_NAME *match);
int tr_fspec_matches(TR_FSPEC *fspec, TR_FILTER_TYPE ftype, void *target);
TR_CONSTRAINT_SET *tr_constraint_set_from_fline(TR_FLINE *fline);
+int tr_filter_validate(TR_FILTER *filt);
+int tr_filter_validate_spec_field(TR_FILTER_TYPE ftype, TR_FSPEC *fspec);
+
#endif