25 lines
496 B
C
25 lines
496 B
C
#include <ordinary/build.h>
|
|
#include <stdlib.h>
|
|
|
|
void ordinary_list_new(struct ordinary_list *list, uint32_t limit) {
|
|
list->head = NULL;
|
|
list->tail = NULL;
|
|
list->count = 0;
|
|
list->limit = limit;
|
|
}
|
|
|
|
void ordinary_list_delete(struct ordinary_list *list) {
|
|
struct ordinary_node *node = list->head;
|
|
|
|
while(node) {
|
|
struct ordinary_node *next = node->next;
|
|
free(node); // R.I.P.
|
|
node = next;
|
|
}
|
|
|
|
list->head = NULL;
|
|
list->tail = NULL;
|
|
list->count = 0;
|
|
list->limit = 0;
|
|
}
|