From a514490dcbb4aaaca3a5e4fc71ef194fea18b37f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 5 Feb 2019 23:17:08 +0100 Subject: Add llist FIRST & LAST, rewrote code to use them. --- linked_list.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'linked_list.h') diff --git a/linked_list.h b/linked_list.h index 5bf3db15..515fa4af 100644 --- a/linked_list.h +++ b/linked_list.h @@ -22,6 +22,9 @@ typedef struct { int length; } LLIST(TYPE); +#define FIRST(lst) (lst)->head->after +#define LAST(lst) (lst)->tail->before + INIT_F ( LLIST(TYPE) ); FREE_F ( LLIST(TYPE) ); -- cgit v1.2.3