index b8f27e25e20ff0f7af2c34f7a98ba9df93f4728c..1633d42c5672e867bec3de21b10153b6c7931274 100644 (file)
--- a/src/core/store-private.h
+++ b/src/core/store-private.h
#define _last_update super.last_update
#define _interval super.interval
#define _last_update super.last_update
#define _interval super.interval
+/*
+ * expressions
+ */
+enum {
+ ATTR_VALUE = -2, /* attr name stored in data.data.string */
+ FIELD_VALUE = -1, /* field type stored in data.data.integer */
+ /* 0: const value (stored in data) */
+ /* >0: operator id */
+};
+
+struct sdb_store_expr {
+ sdb_object_t super;
+
+ int type; /* see above */
+
+ sdb_store_expr_t *left;
+ sdb_store_expr_t *right;
+
+ sdb_data_t data;
+};
+
/*
* conditionals
*/
/*
* conditionals
*/
* matchers
*/
* matchers
*/
-/* when adding to this, also update 'matchers' and 'matchers_tostring'
- * in store_lookup.c */
+/* when adding to this, also update 'MATCHER_SYM' below as well as 'matchers'
+ * and 'matchers_tostring' in store_lookup.c */
enum {
MATCHER_OR,
MATCHER_AND,
enum {
MATCHER_OR,
MATCHER_AND,
MATCHER_CMP_EQ,
MATCHER_CMP_GE,
MATCHER_CMP_GT,
MATCHER_CMP_EQ,
MATCHER_CMP_GE,
MATCHER_CMP_GT,
+ MATCHER_REGEX,
MATCHER_ISNULL,
};
MATCHER_ISNULL,
};
: ((t) == MATCHER_EQ) ? "=" \
: ((t) == MATCHER_GE) ? ">=" \
: ((t) == MATCHER_GT) ? ">" \
: ((t) == MATCHER_EQ) ? "=" \
: ((t) == MATCHER_GE) ? ">=" \
: ((t) == MATCHER_GT) ? ">" \
+ : ((t) == MATCHER_REGEX) ? "=~" \
: ((t) == MATCHER_ISNULL) ? "IS NULL" \
: "UNKNOWN")
: ((t) == MATCHER_ISNULL) ? "IS NULL" \
: "UNKNOWN")