Lines Matching full:parent
50 * - each red node (except for the root) has a black parent,
309 struct type *rbe_parent; /* parent element */ \
320 #define RB_SET(elm, parent, field) do { \ argument
321 RB_PARENT(elm, field) = parent; \
393 struct type *parent, *gparent, *tmp; \
394 while ((parent = RB_PARENT(elm, field)) && \
395 RB_COLOR(parent, field) == RB_RED) { \
396 gparent = RB_PARENT(parent, field); \
397 if (parent == RB_LEFT(gparent, field)) { \
401 RB_SET_BLACKRED(parent, gparent, field);\
405 if (RB_RIGHT(parent, field) == elm) { \
406 RB_ROTATE_LEFT(head, parent, tmp, field);\
407 tmp = parent; \
408 parent = elm; \
411 RB_SET_BLACKRED(parent, gparent, field); \
417 RB_SET_BLACKRED(parent, gparent, field);\
421 if (RB_LEFT(parent, field) == elm) { \
422 RB_ROTATE_RIGHT(head, parent, tmp, field);\
423 tmp = parent; \
424 parent = elm; \
427 RB_SET_BLACKRED(parent, gparent, field); \
435 name##_RB_REMOVE_COLOR(struct name *head, struct type *parent, struct type *elm) \
440 if (RB_LEFT(parent, field) == elm) { \
441 tmp = RB_RIGHT(parent, field); \
443 RB_SET_BLACKRED(tmp, parent, field); \
444 RB_ROTATE_LEFT(head, parent, tmp, field);\
445 tmp = RB_RIGHT(parent, field); \
452 elm = parent; \
453 parent = RB_PARENT(elm, field); \
462 tmp = RB_RIGHT(parent, field); \
464 RB_COLOR(tmp, field) = RB_COLOR(parent, field);\
465 RB_COLOR(parent, field) = RB_BLACK; \
468 RB_ROTATE_LEFT(head, parent, tmp, field);\
473 tmp = RB_LEFT(parent, field); \
475 RB_SET_BLACKRED(tmp, parent, field); \
476 RB_ROTATE_RIGHT(head, parent, tmp, field);\
477 tmp = RB_LEFT(parent, field); \
484 elm = parent; \
485 parent = RB_PARENT(elm, field); \
494 tmp = RB_LEFT(parent, field); \
496 RB_COLOR(tmp, field) = RB_COLOR(parent, field);\
497 RB_COLOR(parent, field) = RB_BLACK; \
500 RB_ROTATE_RIGHT(head, parent, tmp, field);\
513 struct type *child, *parent, *old = elm; \
525 parent = RB_PARENT(elm, field); \
528 RB_PARENT(child, field) = parent; \
529 if (parent) { \
530 if (RB_LEFT(parent, field) == elm) \
531 RB_LEFT(parent, field) = child; \
533 RB_RIGHT(parent, field) = child; \
534 RB_AUGMENT(parent); \
538 parent = elm; \
551 if (parent) { \
552 left = parent; \
559 parent = RB_PARENT(elm, field); \
562 RB_PARENT(child, field) = parent; \
563 if (parent) { \
564 if (RB_LEFT(parent, field) == elm) \
565 RB_LEFT(parent, field) = child; \
567 RB_RIGHT(parent, field) = child; \
568 RB_AUGMENT(parent); \
573 name##_RB_REMOVE_COLOR(head, parent, child); \
582 struct type *parent = NULL; \
586 parent = tmp; \
587 comp = (cmp)(elm, parent); \
595 RB_SET(elm, parent, field); \
596 if (parent != NULL) { \
598 RB_LEFT(parent, field) = elm; \
600 RB_RIGHT(parent, field) = elm; \
601 RB_AUGMENT(parent); \
651 struct type *parent = NULL; \
653 parent = tmp; \
659 return (parent); \