diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-01-09 13:34:01 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-01-11 18:17:33 -0500 |
commit | 502f1733e320b1339beafa949a41db3027c46ec6 (patch) | |
tree | f74b79b7e9d344a5ba2a35d95f209a9cb08c1327 /src/shared | |
parent | 33e1e5a756300e29c74fdc59ea762f9394df8368 (diff) |
shared/list: add LIST_APPEND
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/list.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/shared/list.h b/src/shared/list.h index c020f7e936..f0458b54e2 100644 --- a/src/shared/list.h +++ b/src/shared/list.h @@ -55,6 +55,14 @@ *_head = _item; \ } while(false) +/* Append an item to the list */ +#define LIST_APPEND(name,head,item) \ + do { \ + typeof(*(head)) *_tail; \ + LIST_FIND_TAIL(name,head,_tail); \ + LIST_INSERT_AFTER(name,head,_tail,item); \ + } while(false) + /* Remove an item from the list */ #define LIST_REMOVE(name,head,item) \ do { \ |