Lines Matching refs:parent

322 #define RB_SET(elm, parent, field) do {					\  argument
323 RB_PARENT(elm, field) = parent; \
395 struct type *parent, *gparent, *tmp; \
396 while ((parent = RB_PARENT(elm, field)) && \
397 RB_COLOR(parent, field) == RB_RED) { \
398 gparent = RB_PARENT(parent, field); \
399 if (parent == RB_LEFT(gparent, field)) { \
403 RB_SET_BLACKRED(parent, gparent, field);\
407 if (RB_RIGHT(parent, field) == elm) { \
408 RB_ROTATE_LEFT(head, parent, tmp, field);\
409 tmp = parent; \
410 parent = elm; \
413 RB_SET_BLACKRED(parent, gparent, field); \
419 RB_SET_BLACKRED(parent, gparent, field);\
423 if (RB_LEFT(parent, field) == elm) { \
424 RB_ROTATE_RIGHT(head, parent, tmp, field);\
425 tmp = parent; \
426 parent = elm; \
429 RB_SET_BLACKRED(parent, gparent, field); \
437 name##_RB_REMOVE_COLOR(struct name *head, struct type *parent, struct type *elm) \
442 if (RB_LEFT(parent, field) == elm) { \
443 tmp = RB_RIGHT(parent, field); \
445 RB_SET_BLACKRED(tmp, parent, field); \
446 RB_ROTATE_LEFT(head, parent, tmp, field);\
447 tmp = RB_RIGHT(parent, field); \
454 elm = parent; \
455 parent = RB_PARENT(elm, field); \
464 tmp = RB_RIGHT(parent, field); \
466 RB_COLOR(tmp, field) = RB_COLOR(parent, field);\
467 RB_COLOR(parent, field) = RB_BLACK; \
470 RB_ROTATE_LEFT(head, parent, tmp, field);\
475 tmp = RB_LEFT(parent, field); \
477 RB_SET_BLACKRED(tmp, parent, field); \
478 RB_ROTATE_RIGHT(head, parent, tmp, field);\
479 tmp = RB_LEFT(parent, field); \
486 elm = parent; \
487 parent = RB_PARENT(elm, field); \
496 tmp = RB_LEFT(parent, field); \
498 RB_COLOR(tmp, field) = RB_COLOR(parent, field);\
499 RB_COLOR(parent, field) = RB_BLACK; \
502 RB_ROTATE_RIGHT(head, parent, tmp, field);\
515 struct type *child, *parent, *old = elm; \
527 parent = RB_PARENT(elm, field); \
530 RB_PARENT(child, field) = parent; \
531 if (parent) { \
532 if (RB_LEFT(parent, field) == elm) \
533 RB_LEFT(parent, field) = child; \
535 RB_RIGHT(parent, field) = child; \
536 RB_AUGMENT(parent); \
540 parent = elm; \
553 if (parent) { \
554 left = parent; \
561 parent = RB_PARENT(elm, field); \
564 RB_PARENT(child, field) = parent; \
565 if (parent) { \
566 if (RB_LEFT(parent, field) == elm) \
567 RB_LEFT(parent, field) = child; \
569 RB_RIGHT(parent, field) = child; \
570 RB_AUGMENT(parent); \
575 name##_RB_REMOVE_COLOR(head, parent, child); \
584 struct type *parent = NULL; \
588 parent = tmp; \
589 comp = (cmp)(elm, parent); \
597 RB_SET(elm, parent, field); \
598 if (parent != NULL) { \
600 RB_LEFT(parent, field) = elm; \
602 RB_RIGHT(parent, field) = elm; \
603 RB_AUGMENT(parent); \
653 struct type *parent = NULL; \
655 parent = tmp; \
661 return (parent); \