Code

Move the timeseries serialize to the timeseries module.
[sysdb.git] / src / include / core / timeseries.h
index 1a8e48e47dc4db49cfb243d825bd33910f9125f4..b19625d1ca21166e5eb75bcb65571f06c8286051 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "sysdb.h"
 #include "core/time.h"
+#include "utils/strbuf.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -90,6 +91,17 @@ sdb_timeseries_create(size_t data_names_len, const char * const *data_names,
 void
 sdb_timeseries_destroy(sdb_timeseries_t *ts);
 
+/*
+ * sdb_timeseries_tojson:
+ * Serialize a time-series to JSON written to the specified string buffer.
+ *
+ * Returns:
+ *  - 0 on success
+ *  - a negative value else
+ */
+int
+sdb_timeseries_tojson(sdb_timeseries_t *ts, sdb_strbuf_t *buf);
+
 #ifdef __cplusplus
 } /* extern "C" */
 #endif