From 14b33ae9c00f74a24a00aaece88b22af0955379e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 4 Feb 2019 18:23:51 +0100 Subject: Fix most memmory errors. --- linked_list.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'linked_list.h') diff --git a/linked_list.h b/linked_list.h index d1354e02..90a110bf 100644 --- a/linked_list.h +++ b/linked_list.h @@ -25,10 +25,11 @@ typedef struct { } LLIST(TYPE); INIT_F ( LLIST(TYPE) ); -FREE_F( LLIST(TYPE) ); +FREE_F ( LLIST(TYPE) ); INIT_F ( LINK(TYPE) ); INIT_F ( LINK(TYPE), TYPE* val ); +FREE_F ( LINK(TYPE) ); int LLIST_CONS(TYPE) ( LLIST(TYPE)* lst, TYPE* val); @@ -36,4 +37,7 @@ int DEEP_COPY(LLIST(TYPE)) ( LLIST(TYPE)* dest, LLIST(TYPE)* src ); int APPEND(LLIST(TYPE)) ( LLIST(TYPE)* dest, LLIST(TYPE)* new ); +int SIZE(LLIST(TYPE)) ( LLIST(TYPE)* llist ); +int EMPTY(LLIST(TYPE)) ( LLIST(TYPE)* llist ); + #endif /* TYPE */ -- cgit v1.2.3