From: Ian Jackson Date: Tue, 1 Jun 2010 18:57:47 +0000 (+0100) Subject: Make FOR_LIST_NODE and use it for FOR_CONN X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=innduct.git;a=commitdiff_plain;h=e5fb267af59e9beea66c88e32d9809824c062886;ds=sidebyside Make FOR_LIST_NODE and use it for FOR_CONN --- diff --git a/innduct.h b/innduct.h index ddd17e6..273fb5e 100644 --- a/innduct.h +++ b/innduct.h @@ -84,8 +84,10 @@ #define DUMPV(fmt,pfx,v) fprintf(f, " " #v "=" fmt, pfx v); -#define FOR_CONN(conn) \ - for ((conn)=LIST_HEAD(conns); (conn); (conn)=LIST_NEXT((conn))) +#define FOR_LIST_NODE(nodevar, list) \ + for ((nodevar)=LIST_HEAD(list); (nodevar); (nodevar)=LIST_NEXT((nodevar))) + +#define FOR_CONN(conn) FOR_LIST_NODE(conn, conns) /*----- doubly linked lists -----*/