Code

store: Added sdb_store_parse_matcher_op().
[sysdb.git] / src / include / core / store.h
index 9304acfa79e1f7761928a76dad17e161d02db09f..147d74555c4d68a979e01d3f96249c65b6da3212 100644 (file)
@@ -445,10 +445,50 @@ sdb_store_cmp_le(sdb_store_expr_t *left, sdb_store_expr_t *right);
 sdb_store_matcher_t *
 sdb_store_cmp_eq(sdb_store_expr_t *left, sdb_store_expr_t *right);
 sdb_store_matcher_t *
+sdb_store_cmp_ne(sdb_store_expr_t *left, sdb_store_expr_t *right);
+sdb_store_matcher_t *
 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_regex_matcher:
+ * Creates a matcher which matches the string value the left expression
+ * evaluates to against the regular expression the right expression evaluates
+ * to. The right expression may either be a constant value regular expression
+ * or string or a dynamic value evaluating to a string. In the latter case,
+ * the string is compiled to a regex every time the matcher is executed.
+ */
+sdb_store_matcher_t *
+sdb_store_regex_matcher(sdb_store_expr_t *left, sdb_store_expr_t *right);
+
+/*
+ * sdb_store_nregex_matcher:
+ * Creates a regex matcher just like sdb_store_regex_matcher except that it
+ * matches in case the regular expression does not match.
+ */
+sdb_store_matcher_t *
+sdb_store_nregex_matcher(sdb_store_expr_t *left, sdb_store_expr_t *right);
+
+/*
+ * sdb_store_matcher_op_cb:
+ * Callback constructing a matcher operator.
+ */
+typedef sdb_store_matcher_t *(*sdb_store_matcher_op_cb)
+       (sdb_store_expr_t *, sdb_store_expr_t *);
+
+/*
+ * sdb_store_parse_matcher_op:
+ * Parse a matcher operator and return a constructor for the respective
+ * matcher.
+ *
+ * Returns:
+ *  - matcher operator constructor on success
+ *  - NULL else
+ */
+sdb_store_matcher_op_cb
+sdb_store_parse_matcher_op(const char *op);
+
 /*
  * sdb_store_parse_object_type_plural:
  * Parse the type name (plural) of a stored object.