LO41/List/List.c

24 lines
383 B
C

//
// Created by Antoine Bartuccio on 22/05/2018.
//
#include "List.h"
GETTER(List, Element*, head)
GETTER(List, Element*, tail)
GETTER(List, int, size)
void $_free__List(THIS(List)){
free(this);
}
List *$_init_List(){
List *l = (List*) malloc_or_die(sizeof(List));
l->size = 0;
l->head = NULL;
l->tail = NULL;
LINK_ALL(List, l, get_head, get_tail, get_size)
return l;
}