diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2018-04-17 18:25:12 +0200 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2018-07-10 23:41:14 +0200 |
commit | f93730e72eeeade82ca72d7a7ad8cde404ef95f1 (patch) | |
tree | 8569e6ab7d62e7d03aebab9442f091175f907558 /src/utils/list.c | |
parent | 4b6d97da2d4bc1a9e328cf861e75f5ee1bb968e3 (diff) |
Handle query result and prepare to forward by API
First draft to be able to read at regular interval the TSDB
InfluxDB. This prepare a JSON object formated to be handled as
an input argument from a regular call to the API verb 'write'
Then it is only needed to call the remote verb to forward all the results
Change-Id: I80076dd9cf00ba43075d37dd4d15180e63e37289
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/utils/list.c')
-rw-r--r-- | src/utils/list.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/utils/list.c b/src/utils/list.c index bd7eeac..d47f761 100644 --- a/src/utils/list.c +++ b/src/utils/list.c @@ -64,6 +64,20 @@ void add_key(struct list **l, const char *key) } } +int set_value(struct list *l, json_object *val, int index) +{ + int i; + + for (i = 0; i < index; i++) { + l = l->next; + if ( l == NULL ) + return -1; + } + + l->value = val; + return 0; +} + struct list *get_elt(struct list *l, int index) { int i; |