Code

store: Removed unused old sdb_store_attr_matcher().
[sysdb.git] / src / core / store-private.h
index 1633d42c5672e867bec3de21b10153b6c7931274..550668db2ebd1259818411c8a7fe7e769e8012db 100644 (file)
@@ -124,61 +124,31 @@ struct sdb_store_expr {
        sdb_data_t data;
 };
 
-/*
- * conditionals
- */
-
-/* compares an object using the specified conditional and taking the specified
- * filter into account */
-typedef int (*cmp_cb)(sdb_store_obj_t *, sdb_store_cond_t *,
-               sdb_store_matcher_t *);
-
-struct sdb_store_cond {
-       sdb_object_t super;
-       cmp_cb cmp;
-};
-
-typedef struct {
-       sdb_store_cond_t super;
-       char *name;
-       sdb_store_expr_t *expr;
-} attr_cond_t;
-#define ATTR_C(obj) ((attr_cond_t *)(obj))
-
-typedef struct {
-       sdb_store_cond_t super;
-       int field;
-       sdb_store_expr_t *expr;
-} obj_cond_t;
-#define OBJ_C(obj) ((obj_cond_t *)(obj))
-
 /*
  * matchers
  */
 
-/* when adding to this, also update 'MATCHER_SYM' below as well as 'matchers'
- * and 'matchers_tostring' in store_lookup.c */
+/* when adding to this, also update 'MATCHER_SYM' below and 'matchers' in
+ * store_lookup.c */
 enum {
        MATCHER_OR,
        MATCHER_AND,
        MATCHER_NOT,
        MATCHER_NAME,
-       MATCHER_ATTR,
        MATCHER_SERVICE,
        MATCHER_METRIC,
        MATCHER_ATTRIBUTE,
        MATCHER_LT,
        MATCHER_LE,
        MATCHER_EQ,
+       MATCHER_NE,
        MATCHER_GE,
        MATCHER_GT,
-       MATCHER_CMP_LT,
-       MATCHER_CMP_LE,
-       MATCHER_CMP_EQ,
-       MATCHER_CMP_GE,
-       MATCHER_CMP_GT,
+       MATCHER_IN,
        MATCHER_REGEX,
+       MATCHER_NREGEX,
        MATCHER_ISNULL,
+       MATCHER_ISNNULL,
 };
 
 #define MATCHER_SYM(t) \
@@ -186,17 +156,20 @@ enum {
                : ((t) == MATCHER_AND) ? "AND" \
                : ((t) == MATCHER_NOT) ? "NOT" \
                : ((t) == MATCHER_NAME) ? "NAME" \
-               : ((t) == MATCHER_ATTR) ? "ATTR" \
                : ((t) == MATCHER_SERVICE) ? "SERVICE" \
                : ((t) == MATCHER_METRIC) ? "METRIC" \
                : ((t) == MATCHER_ATTRIBUTE) ? "ATTRIBUTE" \
                : ((t) == MATCHER_LT) ? "<" \
                : ((t) == MATCHER_LE) ? "<=" \
                : ((t) == MATCHER_EQ) ? "=" \
+               : ((t) == MATCHER_NE) ? "!=" \
                : ((t) == MATCHER_GE) ? ">=" \
                : ((t) == MATCHER_GT) ? ">" \
+               : ((t) == MATCHER_IN) ? "IN" \
                : ((t) == MATCHER_REGEX) ? "=~" \
+               : ((t) == MATCHER_NREGEX) ? "!~" \
                : ((t) == MATCHER_ISNULL) ? "IS NULL" \
+               : ((t) == MATCHER_ISNNULL) ? "IS NOT NULL" \
                : "UNKNOWN")
 
 /* match the name of something */
@@ -258,27 +231,12 @@ typedef struct {
 } name_matcher_t;
 #define NAME_M(m) ((name_matcher_t *)(m))
 
-/* match attributes */
-typedef struct {
-       sdb_store_matcher_t super;
-       char *name;
-       string_matcher_t value;
-} attr_matcher_t;
-#define ATTR_M(m) ((attr_matcher_t *)(m))
-
 typedef struct {
        sdb_store_matcher_t super;
-       char *attr_name; /* we only support matching attributes */
+       sdb_store_expr_t *expr;
 } isnull_matcher_t;
 #define ISNULL_M(m) ((isnull_matcher_t *)(m))
 
-/* match using conditionals */
-typedef struct {
-       sdb_store_matcher_t super;
-       sdb_store_cond_t *cond;
-} cond_matcher_t;
-#define COND_M(m) ((cond_matcher_t *)(m))
-
 #ifdef __cplusplus
 } /* extern "C" */
 #endif