Lines Matching refs:parent

324 #define RB_SET(elm, parent, field) do {					\  argument
325 RB_PARENT(elm, field) = parent; \
394 struct type *parent, *gparent, *tmp; \
395 while ((parent = RB_PARENT(elm, field)) && \
396 RB_COLOR(parent, field) == RB_RED) { \
397 gparent = RB_PARENT(parent, field); \
398 if (parent == RB_LEFT(gparent, field)) { \
402 RB_SET_BLACKRED(parent, gparent, field);\
406 if (RB_RIGHT(parent, field) == elm) { \
407 RB_ROTATE_LEFT(head, parent, tmp, field);\
408 tmp = parent; \
409 parent = elm; \
412 RB_SET_BLACKRED(parent, gparent, field); \
418 RB_SET_BLACKRED(parent, gparent, field);\
422 if (RB_LEFT(parent, field) == elm) { \
423 RB_ROTATE_RIGHT(head, parent, tmp, field);\
424 tmp = parent; \
425 parent = elm; \
428 RB_SET_BLACKRED(parent, gparent, field); \
436 name##_RB_REMOVE_COLOR(struct name *head, struct type *parent, struct type *elm) \
441 if (RB_LEFT(parent, field) == elm) { \
442 tmp = RB_RIGHT(parent, field); \
444 RB_SET_BLACKRED(tmp, parent, field); \
445 RB_ROTATE_LEFT(head, parent, tmp, field);\
446 tmp = RB_RIGHT(parent, field); \
453 elm = parent; \
454 parent = RB_PARENT(elm, field); \
463 tmp = RB_RIGHT(parent, field); \
465 RB_COLOR(tmp, field) = RB_COLOR(parent, field);\
466 RB_COLOR(parent, field) = RB_BLACK; \
469 RB_ROTATE_LEFT(head, parent, tmp, field);\
474 tmp = RB_LEFT(parent, field); \
476 RB_SET_BLACKRED(tmp, parent, field); \
477 RB_ROTATE_RIGHT(head, parent, tmp, field);\
478 tmp = RB_LEFT(parent, field); \
485 elm = parent; \
486 parent = RB_PARENT(elm, field); \
495 tmp = RB_LEFT(parent, field); \
497 RB_COLOR(tmp, field) = RB_COLOR(parent, field);\
498 RB_COLOR(parent, field) = RB_BLACK; \
501 RB_ROTATE_RIGHT(head, parent, tmp, field);\
514 struct type *child, *parent, *old = elm; \
526 parent = RB_PARENT(elm, field); \
529 RB_PARENT(child, field) = parent; \
530 if (parent) { \
531 if (RB_LEFT(parent, field) == elm) \
532 RB_LEFT(parent, field) = child; \
534 RB_RIGHT(parent, field) = child; \
535 RB_AUGMENT(parent); \
539 parent = elm; \
552 if (parent) { \
553 left = parent; \
560 parent = RB_PARENT(elm, field); \
563 RB_PARENT(child, field) = parent; \
564 if (parent) { \
565 if (RB_LEFT(parent, field) == elm) \
566 RB_LEFT(parent, field) = child; \
568 RB_RIGHT(parent, field) = child; \
569 RB_AUGMENT(parent); \
574 name##_RB_REMOVE_COLOR(head, parent, child); \
583 struct type *parent = NULL; \
587 parent = tmp; \
588 comp = (cmp)(elm, parent); \
596 RB_SET(elm, parent, field); \
597 if (parent != NULL) { \
599 RB_LEFT(parent, field) = elm; \
601 RB_RIGHT(parent, field) = elm; \
602 RB_AUGMENT(parent); \
652 struct type *parent = NULL; \
654 parent = tmp; \
660 return (parent); \