X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Flist.h;fp=src%2Fshared%2Flist.h;h=f0458b54e24d0d5235aa736428c12e9dfa6c0d60;hb=502f1733e320b1339beafa949a41db3027c46ec6;hp=c020f7e9369abe4eb89bb9d02d06722c0be5eecb;hpb=33e1e5a756300e29c74fdc59ea762f9394df8368;p=elogind.git diff --git a/src/shared/list.h b/src/shared/list.h index c020f7e93..f0458b54e 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 { \