aboutsummaryrefslogtreecommitdiff
path: root/node.c
diff options
context:
space:
mode:
Diffstat (limited to 'node.c')
-rw-r--r--node.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/node.c b/node.c
index e1b7920..586ed52 100644
--- a/node.c
+++ b/node.c
@@ -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;
+ }
+}