Tino Hager
2018-06-27 8a504c737d2bc3b9b37cb79cb50fbf7eecda07df
src/list.c
@@ -1,6 +1,7 @@
#include <stdlib.h>
#include <string.h>
#include "list.h"
#include "option_list.h"
list *make_list()
{
@@ -11,6 +12,7 @@
   return l;
}
/*
void transfer_node(list *s, list *d, node *n)
{
    node *prev, *next;
@@ -22,6 +24,7 @@
    if(s->front == n) s->front = next;
    if(s->back == n) s->back = prev;
}
*/
void *list_pop(list *l){
    if(!l->back) return 0;
@@ -77,6 +80,17 @@
   }
}
void free_list_contents_kvp(list *l)
{
   node *n = l->front;
   while (n) {
      kvp *p = n->val;
      free(p->key);
      free(n->val);
      n = n->next;
   }
}
void **list_to_array(list *l)
{
    void **a = calloc(l->size, sizeof(void*));