From: ian Date: Wed, 14 Jun 2006 16:59:46 +0000 (+0000) Subject: add DLIST2_PREPEND X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=17003b2066cf31bba7466f11bbe7228e1c7c4690;p=trains.git add DLIST2_PREPEND --- diff --git a/hostside/dliste.h b/hostside/dliste.h index 72a235c..bade3d4 100644 --- a/hostside/dliste.h +++ b/hostside/dliste.h @@ -61,5 +61,13 @@ : ((list).head= (node))), \ (list).tail= (node))) +#define DLIST2_PREPEND(list,node,link) \ + ((void) \ + ((node)->link.next= (list).head, \ + (node)->link.back= 0, \ + ((list).head ? ((list).head->link.back= (node)) \ + : ((list).tail= (node))), \ + (list).head= (node))) + #endif /*DLIST_H*/