X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Finclude%2Fcore%2Ftimeseries.h;h=1a8e48e47dc4db49cfb243d825bd33910f9125f4;hb=6a09adcd03cbb0ee7f32a523c6d9d4895979c8d9;hp=52848a71d948954f3a9bceebe970f2520f6d68c9;hpb=b3c5403f90933d3d63ebaf9174524fa018a50f4f;p=sysdb.git diff --git a/src/include/core/timeseries.h b/src/include/core/timeseries.h index 52848a7..1a8e48e 100644 --- a/src/include/core/timeseries.h +++ b/src/include/core/timeseries.h @@ -56,8 +56,9 @@ typedef struct { sdb_time_t end; sdb_data_point_t **data; - char **data_names; size_t data_len; + char **data_names; + size_t data_names_len; } sdb_timeseries_t; /* @@ -69,6 +70,19 @@ typedef struct { sdb_time_t end; } sdb_timeseries_opts_t; +/* + * sdb_timeseries_create: + * Allocate a time-series object, pre-populating the data_names information + * and allocating the data field. + * + * Returns: + * - a newly allocated time-series object on success + * - NULL else + */ +sdb_timeseries_t * +sdb_timeseries_create(size_t data_names_len, const char * const *data_names, + size_t data_len); + /* * sdb_timeseries_destroy: * Destroy a time-series object, freeing all of its memory.