index 97e8a6c2fcce7fff076b2f0275ead0a2ae42306a..060ec7bccf02c7b19acfccc7a6d29b5058986c01 100644 (file)
--- a/src/core/store-private.h
+++ b/src/core/store-private.h
sdb_data_t data;
};
+#define CONST_EXPR(v) { SDB_OBJECT_INIT, 0, (v).type, NULL, NULL, (v) }
#define EXPR_TO_STRING(e) \
(((e)->type == TYPED_EXPR) ? "<typed>" \
: ((e)->type == ATTR_VALUE) ? "attribute" \
MATCHER_ANY,
MATCHER_ALL,
MATCHER_IN,
+ MATCHER_NIN,
/* unary operators */
MATCHER_ISNULL,
MATCHER_GT,
MATCHER_REGEX,
MATCHER_NREGEX,
+
+ /* a generic query */
+ MATCHER_QUERY,
};
#define MATCHER_SYM(t) \
: ((t) == MATCHER_ANY) ? "ANY" \
: ((t) == MATCHER_ALL) ? "ALL" \
: ((t) == MATCHER_IN) ? "IN" \
+ : ((t) == MATCHER_NIN) ? "NOT IN" \
: ((t) == MATCHER_ISNULL) ? "IS NULL" \
: ((t) == MATCHER_ISNNULL) ? "IS NOT NULL" \
: ((t) == MATCHER_LT) ? "<" \
: ((t) == MATCHER_GT) ? ">" \
: ((t) == MATCHER_REGEX) ? "=~" \
: ((t) == MATCHER_NREGEX) ? "!~" \
+ : ((t) == MATCHER_QUERY) ? "QUERY" \
: "UNKNOWN")
/* matcher base type */
/* iter matcher */
typedef struct {
sdb_store_matcher_t super;
- int type;
+ sdb_store_expr_t *iter;
sdb_store_matcher_t *m;
} iter_matcher_t;
#define ITER_M(m) ((iter_matcher_t *)(m))
} isnull_matcher_t;
#define ISNULL_M(m) ((isnull_matcher_t *)(m))
+typedef struct {
+ sdb_store_matcher_t super;
+ sdb_ast_node_t *ast;
+ sdb_store_matcher_t *matcher;
+ sdb_store_matcher_t *filter;
+} query_matcher_t;
+#define QUERY_M(m) ((query_matcher_t *)(m))
+
#ifdef __cplusplus
} /* extern "C" */
#endif