Code

store: Let sdb_store_scan() support other object types besides hosts.
[sysdb.git] / src / include / core / data.h
index cfdf48db8ea7d63fd1c2ef718901706bd10ca2e0..9ab5cdabf50936d33f5a494a64456bad3502c6c9 100644 (file)
@@ -157,6 +157,15 @@ sdb_data_strcmp(const sdb_data_t *d1, const sdb_data_t *d2);
 _Bool
 sdb_data_isnull(const sdb_data_t *datum);
 
+/*
+ * sdb_data_inarray:
+ * Determine whether a datum is included in an array based on the usual
+ * comparison function of the value's type. The element type of the array has
+ * to match the type of the value.
+ */
+_Bool
+sdb_data_inarray(const sdb_data_t *value, const sdb_data_t *array);
+
 /*
  * Operators supported by sdb_data_eval_expr.
  */
@@ -211,6 +220,23 @@ int
 sdb_data_expr_eval(int op, const sdb_data_t *d1, const sdb_data_t *d2,
                sdb_data_t *res);
 
+/*
+ * sdb_data_expr_type:
+ * Determine the type of the expression when applying the specified operator
+ * to the specified types. Note that if an actual value is a typed NULL value
+ * (e.g. a NULL string value), the return value of this function does not
+ * match the return type of sdb_data_expr_eval.
+ *
+ * See the documentation of sdb_data_expr_eval() for a description of which
+ * operations are supported.
+ *
+ * Returns:
+ *  - the type id on success
+ *  - a negative value else
+ */
+int
+sdb_data_expr_type(int op, int type1, int type2);
+
 /*
  * sdb_data_strlen:
  * Returns a (worst-case) estimate for the number of bytes required to format