• Home
  • Raw
  • Download

Lines Matching full:parent

57  *	- each red node (except for the root) has a black parent,
316 struct type *rbe_parent; /* parent element */ \
327 #define RB_SET(elm, parent, field) do { \ argument
328 RB_PARENT(elm, field) = parent; \
410 struct type *parent, *gparent, *tmp; \
411 while ((parent = RB_PARENT(elm, field)) && \
412 RB_COLOR(parent, field) == RB_RED) { \
413 gparent = RB_PARENT(parent, field); \
414 if (parent == RB_LEFT(gparent, field)) { \
418 RB_SET_BLACKRED(parent, gparent, field);\
422 if (RB_RIGHT(parent, field) == elm) { \
423 RB_ROTATE_LEFT(head, parent, tmp, field);\
424 tmp = parent; \
425 parent = elm; \
428 RB_SET_BLACKRED(parent, gparent, field); \
434 RB_SET_BLACKRED(parent, gparent, field);\
438 if (RB_LEFT(parent, field) == elm) { \
439 RB_ROTATE_RIGHT(head, parent, tmp, field);\
440 tmp = parent; \
441 parent = elm; \
444 RB_SET_BLACKRED(parent, gparent, field); \
452 name##_RB_REMOVE_COLOR(struct name *head, struct type *parent, struct type *elm) \
457 if (RB_LEFT(parent, field) == elm) { \
458 tmp = RB_RIGHT(parent, field); \
460 RB_SET_BLACKRED(tmp, parent, field); \
461 RB_ROTATE_LEFT(head, parent, tmp, field);\
462 tmp = RB_RIGHT(parent, field); \
469 elm = parent; \
470 parent = RB_PARENT(elm, field); \
479 tmp = RB_RIGHT(parent, field); \
481 RB_COLOR(tmp, field) = RB_COLOR(parent, field);\
482 RB_COLOR(parent, field) = RB_BLACK; \
485 RB_ROTATE_LEFT(head, parent, tmp, field);\
490 tmp = RB_LEFT(parent, field); \
492 RB_SET_BLACKRED(tmp, parent, field); \
493 RB_ROTATE_RIGHT(head, parent, tmp, field);\
494 tmp = RB_LEFT(parent, field); \
501 elm = parent; \
502 parent = RB_PARENT(elm, field); \
511 tmp = RB_LEFT(parent, field); \
513 RB_COLOR(tmp, field) = RB_COLOR(parent, field);\
514 RB_COLOR(parent, field) = RB_BLACK; \
517 RB_ROTATE_RIGHT(head, parent, tmp, field);\
530 struct type *child, *parent, *old = elm; \
542 parent = RB_PARENT(elm, field); \
545 RB_PARENT(child, field) = parent; \
546 if (parent) { \
547 if (RB_LEFT(parent, field) == elm) \
548 RB_LEFT(parent, field) = child; \
550 RB_RIGHT(parent, field) = child; \
551 RB_AUGMENT(parent); \
555 parent = elm; \
568 if (parent) { \
569 left = parent; \
576 parent = RB_PARENT(elm, field); \
579 RB_PARENT(child, field) = parent; \
580 if (parent) { \
581 if (RB_LEFT(parent, field) == elm) \
582 RB_LEFT(parent, field) = child; \
584 RB_RIGHT(parent, field) = child; \
585 RB_AUGMENT(parent); \
590 name##_RB_REMOVE_COLOR(head, parent, child); \
599 struct type *parent = NULL; \
603 parent = tmp; \
604 comp = (cmp)(elm, parent); \
612 RB_SET(elm, parent, field); \
613 if (parent != NULL) { \
615 RB_LEFT(parent, field) = elm; \
617 RB_RIGHT(parent, field) = elm; \
618 RB_AUGMENT(parent); \
712 struct type *parent = NULL; \
714 parent = tmp; \
720 return (parent); \