[reposting from freebsd-arch@ - was probably the wrong list]

Hi all,

I've had use for these a few times now when wanting to restart a loop at
a previously found element, and wonder if there are any thoughts about
sticking them (and equivalents for other list types) in <sys/queue.h>?

Cheers,
Lawrence

#define TAILQ_FOREACH_CONTINUE(var, head, field)                \
        for ((var) = ((var) ? (var) : TAILQ_FIRST((head)));     \
        (var);                                                  \
        (var) = TAILQ_NEXT((var), field))


#define SLIST_FOREACH_CONTINUE(var, head, field)                \
        for ((var) = ((var) ? (var) : SLIST_FIRST((head)));     \
        (var);                                                  \
        (var) = SLIST_NEXT((var), field))
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[email protected]"

Reply via email to