*/
+extern GQuark
+ LTTV_FILTER_TRACE,
+ LTTV_FILTER_TRACESET,
+ LTTV_FILTER_TRACEFILE,
+ LTTV_FILTER_STATE,
+ LTTV_FILTER_EVENT;
+
/**
* @enum lttv_expression_op
*/
char *value;
} lttv_simple_expression;
-
-//typedef union _tmp {
-// struct lttv_expression *e;
-// lttv_field_relation *se;
-//} tmp;
+typedef enum _lttv_logical_op {
+ OR = 1,
+ AND = 1<<1,
+ NOT = 1<<2,
+ XOR = 1<<3
+} lttv_logical_op;
+
/*
+ * Ah .. that's my tree
+ */
typedef struct _lttv_expression
{
- gboolean or;
- gboolean not;
- gboolean and;
- gboolean xor;
- gboolean simple_expression;
-// tmp e;
+// gboolean or;
+// gboolean not;
+// gboolean and;
+// gboolean xor;
+// gboolean simple_expression;
+ lttv_logical_op op;
+ lttv_expression_type type;
+ union {
+ struct lttv_expression *e;
+ // lttv_field_relation *se; /* --> simple expression */
+ } e;
} lttv_expression;
-*/
-typedef union _lttv_expression {
- lttv_simple_expression se;
-
-} lttv_expression;
+
+//typedef union _lttv_expression {
+// lttv_simple_expression se;
+//
+//} lttv_expression;
typedef struct _lttv_filter_tree {
lttv_expression* node;
lttv_filter_tree* tree;
} lttv_filter;
+gboolean parse_field_path(GList* fp);
+
gboolean parse_simple_expression(GString* expression);
/* Compile the filter expression into an efficient data structure */
-
lttv_filter *lttv_filter_new(char *expression, LttvTraceState *tfs);
/* Check if the tracefile or event satisfies the filter. The arguments are
declared as void * to allow these functions to be used as hooks. */
-gboolean lttv_filter_tracefile(lttv_filter *filter, LttvTrace *tracefile);
+gboolean lttv_filter_tracefile(lttv_filter *filter, LttTracefile *tracefile);
+
+gboolean lttv_filter_tracestate(lttv_filter *filter, LttvTraceState *tracestate);
gboolean lttv_filter_event(lttv_filter *filter, LttEvent *event);