aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/list.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/list.c')
-rw-r--r--src/utils/list.c14
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;