Code

store: Removed unused, old conditional matchers.
[sysdb.git] / src / include / core / store.h
index 147d74555c4d68a979e01d3f96249c65b6da3212..cef3d063cf0f41f18aad997eedf92971d7cf93ac 100644 (file)
@@ -320,7 +320,8 @@ sdb_store_expr_fieldvalue(int field);
 /*
  * sdb_store_expr_attrvalue:
  * Creates an expression which evaluates to the value of the specified
- * attribute of a stored object.
+ * attribute of a stored object. Evaluates to a NULL value if the attribute
+ * does not exist.
  *
  * Returns:
  *  - an expression object on success
@@ -357,35 +358,6 @@ int
 sdb_store_expr_eval(sdb_store_expr_t *expr, sdb_store_obj_t *obj,
                sdb_data_t *res, sdb_store_matcher_t *filter);
 
-/*
- * Conditionals may be used to lookup hosts from the store based on a
- * conditional expression.
- *
- * A conditional object inherits from sdb_object_t and, thus, may safely be
- * cast to a generic object.
- */
-struct sdb_store_cond;
-typedef struct sdb_store_cond sdb_store_cond_t;
-#define SDB_STORE_COND(obj) ((sdb_store_cond_t *)(obj))
-
-/*
- * sdb_store_attr_cond:
- * Creates a conditional based on attribute values. The value of stored
- * attributes is compared against the value the expression evaluates to. See
- * sdb_data_cmp for details about the comparison.
- */
-sdb_store_cond_t *
-sdb_store_attr_cond(const char *name, sdb_store_expr_t *expr);
-
-/*
- * sdb_store_obj_cond:
- * Creates a conditional based on queryable object fields. The respective
- * field of *any* object type is compared against the value the expression
- * evaluates to.
- */
-sdb_store_cond_t *
-sdb_store_obj_cond(int field, sdb_store_expr_t *expr);
-
 /*
  * sdb_store_name_matcher:
  * Creates a matcher matching by the specified object type's name. If 're' is
@@ -406,10 +378,17 @@ sdb_store_attr_matcher(const char *name, const char *value, _Bool re);
 
 /*
  * sdb_store_isnull_matcher:
- * Creates a matcher matching "missing" attributes.
+ * Creates a matcher matching NULL values.
  */
 sdb_store_matcher_t *
-sdb_store_isnull_matcher(const char *attr_name);
+sdb_store_isnull_matcher(sdb_store_expr_t *expr);
+
+/*
+ * sdb_store_isnnull_matcher:
+ * Creates a matcher matching non-NULL values.
+ */
+sdb_store_matcher_t *
+sdb_store_isnnull_matcher(sdb_store_expr_t *expr);
 
 /*
  * sdb_store_child_matcher:
@@ -427,17 +406,6 @@ sdb_store_child_matcher(int type, sdb_store_matcher_t *m);
  * equal, equal, greater or equal, or greater than the conditional's value
  * repsectively.
  */
-sdb_store_matcher_t *
-sdb_store_lt_matcher(sdb_store_cond_t *cond);
-sdb_store_matcher_t *
-sdb_store_le_matcher(sdb_store_cond_t *cond);
-sdb_store_matcher_t *
-sdb_store_eq_matcher(sdb_store_cond_t *cond);
-sdb_store_matcher_t *
-sdb_store_ge_matcher(sdb_store_cond_t *cond);
-sdb_store_matcher_t *
-sdb_store_gt_matcher(sdb_store_cond_t *cond);
-
 sdb_store_matcher_t *
 sdb_store_cmp_lt(sdb_store_expr_t *left, sdb_store_expr_t *right);
 sdb_store_matcher_t *
@@ -451,6 +419,15 @@ sdb_store_cmp_ge(sdb_store_expr_t *left, sdb_store_expr_t *right);
 sdb_store_matcher_t *
 sdb_store_cmp_gt(sdb_store_expr_t *left, sdb_store_expr_t *right);
 
+/*
+ * sdb_store_in_matcher:
+ * Creates a matcher which matches if the right value evaluates to an array
+ * value and the left value is included in that array. See sdb_data_inarray
+ * for more details.
+ */
+sdb_store_matcher_t *
+sdb_store_in_matcher(sdb_store_expr_t *left, sdb_store_expr_t *right);
+
 /*
  * sdb_store_regex_matcher:
  * Creates a matcher which matches the string value the left expression
@@ -513,29 +490,16 @@ sdb_store_parse_field_name(const char *name);
 
 /*
  * sdb_store_matcher_parse_cmp:
- * Parse a simple compare expression (<obj_type>.<attr> <op> <expression>).
+ * Parse a simple compare expression (<obj_type> <op> <expression>).
  *
  * Returns:
  *  - a matcher object on success
  *  - NULL else
  */
 sdb_store_matcher_t *
-sdb_store_matcher_parse_cmp(const char *obj_type, const char *attr,
+sdb_store_matcher_parse_cmp(const char *obj_type,
                const char *op, sdb_store_expr_t *expr);
 
-/*
- * sdb_store_matcher_parse_field_cmp:
- * Parse a simple compare expression for queryable object fields (<field> <op>
- * <expression>).
- *
- * Returns:
- *  - a matcher object on success
- *  - NULL else
- */
-sdb_store_matcher_t *
-sdb_store_matcher_parse_field_cmp(const char *name, const char *op,
-               sdb_store_expr_t *expr);
-
 /*
  * sdb_store_dis_matcher:
  * Creates a matcher matching the disjunction (logical OR) of two matchers.
@@ -576,14 +540,6 @@ int
 sdb_store_matcher_matches(sdb_store_matcher_t *m, sdb_store_obj_t *obj,
                sdb_store_matcher_t *filter);
 
-/*
- * sdb_store_matcher_tostring:
- * Format a matcher object as string. This is meant for logging or debugging
- * purposes.
- */
-char *
-sdb_store_matcher_tostring(sdb_store_matcher_t *m, char *buf, size_t buflen);
-
 /*
  * sdb_store_lookup_cb:
  * Lookup callback. It is called for each matching object when looking up data