diff options
Diffstat (limited to 'node.c')
-rw-r--r-- | node.c | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -19,7 +19,7 @@ char *str; } /* helpers */ -node* search(root, str) +node* list_search(root, str) node *root; char *str; { @@ -33,7 +33,7 @@ char *str; return NULL; } -node* insert(root, str) /*TODO change to accept double pointer*/ +node* list_insert(root, str) /*TODO change to accept double pointer*/ node *root; char * str; { @@ -41,3 +41,16 @@ char * str; p->next = root; return p; } + +void free_list(n) +node *n; +{ + node *tmp; + + for(tmp = n; tmp;) { + n = tmp->next; + free(tmp); + tmp = NULL; + tmp = n; + } +} |