--- libaitio/inc/Attic/atree.h 2012/08/15 08:45:22 1.3.28.1 +++ libaitio/inc/Attic/atree.h 2012/08/17 22:00:03 1.3.28.2 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: atree.h,v 1.3.28.1 2012/08/15 08:45:22 misho Exp $ +* $Id: atree.h,v 1.3.28.2 2012/08/17 22:00:03 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -338,6 +338,13 @@ void name##_SPLAY_MINMAX(struct name *head, int __comp for ((x) = SPLAY_MIN(name, head); \ (x) != NULL; \ (x) = SPLAY_NEXT(name, head, x)) + +#define SPLAY_FOREACH_SAFE(x, name, head, y) \ + for ((x) = SPLAY_MIN(name, head); \ + ((x) != NULL) && \ + ((y) = SPLAY_NEXT(name, head, x), (x) != NULL); \ + (x) = (y)) + /* Macros that define a red-black tree */ #define RB_HEAD(name, type) \