diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-02-04 18:23:51 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-02-05 18:16:17 +0100 |
commit | 14b33ae9c00f74a24a00aaece88b22af0955379e (patch) | |
tree | cee997634ecb0977e8f63fadfd6d00fdfdf89439 /linked_list.h | |
parent | Normalize and improve INIT & FREE macros. (diff) | |
download | calp-14b33ae9c00f74a24a00aaece88b22af0955379e.tar.gz calp-14b33ae9c00f74a24a00aaece88b22af0955379e.tar.xz |
Fix most memmory errors.
Diffstat (limited to 'linked_list.h')
-rw-r--r-- | linked_list.h | 6 |
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 */ |