aboutsummaryrefslogtreecommitdiff
path: root/linked_list.h
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2019-02-04 18:23:51 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2019-02-05 18:16:17 +0100
commit14b33ae9c00f74a24a00aaece88b22af0955379e (patch)
treecee997634ecb0977e8f63fadfd6d00fdfdf89439 /linked_list.h
parentNormalize and improve INIT & FREE macros. (diff)
downloadcalp-14b33ae9c00f74a24a00aaece88b22af0955379e.tar.gz
calp-14b33ae9c00f74a24a00aaece88b22af0955379e.tar.xz
Fix most memmory errors.
Diffstat (limited to 'linked_list.h')
-rw-r--r--linked_list.h6
1 files changed, 5 insertions, 1 deletions
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 */