Code

store: Added sdb_store_get_attr().
[sysdb.git] / src / include / core / store.h
index 7aeb2875e9cbe302ad0311fc352e824eba8435a1..df4d853106bac891ae96e887a24354e58895a726 100644 (file)
@@ -253,6 +253,20 @@ sdb_store_fetch_timeseries(const char *hostname, const char *metric,
 int
 sdb_store_get_field(sdb_store_obj_t *obj, int field, sdb_data_t *res);
 
+/*
+ * sdb_store_get_attr:
+ * Get the value of a stored object's attribute. The caller is responsible for
+ * freeing any dynamically allocated memory possibly stored in the returned
+ * value.If 'res' is NULL, the function will return whether the attribute
+ * exists.
+ *
+ * Returns:
+ *  - 0 if the attribute exists
+ *  - a negative value else
+ */
+int
+sdb_store_get_attr(sdb_store_obj_t *obj, const char *name, sdb_data_t *res);
+
 /*
  * Expressions specify arithmetic expressions.
  *