aboutsummaryrefslogtreecommitdiff
path: root/linked_list.h
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2019-02-05 23:17:08 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2019-02-05 23:17:08 +0100
commita514490dcbb4aaaca3a5e4fc71ef194fea18b37f (patch)
tree16b8c4923fafbbe9e6e43e88beff08eb3f0674ae /linked_list.h
parentAdd support for NL without preceeding CR. (diff)
downloadcalp-a514490dcbb4aaaca3a5e4fc71ef194fea18b37f.tar.gz
calp-a514490dcbb4aaaca3a5e4fc71ef194fea18b37f.tar.xz
Add llist FIRST & LAST, rewrote code to use them.
Diffstat (limited to 'linked_list.h')
-rw-r--r--linked_list.h3
1 files changed, 3 insertions, 0 deletions
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) );