diff options
author | Maria Matejka <mq@ucw.cz> | 2022-03-02 11:22:01 +0100 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-03-02 12:13:49 +0100 |
commit | 2e8b8bfcc46ec1493f9e0efe9c796b88df85ada4 (patch) | |
tree | 0c09bc46eef1ad4c52a535c339de2200d6e76df0 | |
parent | d071aca7aaf7a4add9e0d1d93029fb9a0fad560a (diff) |
Static list initializer
-rw-r--r-- | lib/lists.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/lists.h b/lib/lists.h index 479f4ed1..7e6d5467 100644 --- a/lib/lists.h +++ b/lib/lists.h @@ -42,6 +42,7 @@ typedef union list { /* In fact two overlayed nodes */ }; } list; +#define STATIC_LIST_INIT(name) name = { .head = &name.tail_node, .tail = &name.head_node, .null = NULL } #define NODE (node *) #define HEAD(list) ((void *)((list).head)) |