21 lines
440 B
C
21 lines
440 B
C
/****** llist.c
|
|
This file contains the functions for accessing and manipulating the linked list struct, LList.
|
|
******/
|
|
#include <stdlib.h>
|
|
#include "llist.h"
|
|
|
|
struct LList *newLList() {
|
|
struct LList *llist = malloc(sizeof(struct LList));
|
|
llist->size = 0;
|
|
llist->next = NULL;
|
|
llist->data = NULL;
|
|
return llist;
|
|
}
|
|
|
|
int freeLList(struct LList *llist) {
|
|
if (llist->data != NULL)
|
|
free(llist->data);
|
|
free(llist);
|
|
return 0;
|
|
}
|