Skip to content

Commit

Permalink
added a create() function
Browse files Browse the repository at this point in the history
  • Loading branch information
MrTyton committed Nov 14, 2012
1 parent 6093c9e commit ec69aae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions linkedlist.c
Expand Up @@ -3,6 +3,12 @@
#include <malloc.h>
#include "linkedlist.h"

linkedListHolder create() {
linkedListHolder ans = (linkedListHolder)malloc(sizeof(struct llholder));
ans->head = 0;
return ans;
}

void add(linkedListHolder list, void * data, int key) {
linkedList insert = (linkedList)malloc(sizeof(struct ll));
insert->key = key;
Expand Down
2 changes: 2 additions & 0 deletions linkedlist.h
Expand Up @@ -16,6 +16,8 @@ struct llholder {
};
typedef struct llholder * linkedListHolder;

linkedListHolder create();

void add(linkedListHolder list, void * data, int key);

void * get(linkedListHolder list, int key);
Expand Down

0 comments on commit ec69aae

Please sign in to comment.