Lines Matching refs:parent

80 #define RB_SET(elm, parent, field) do {                                       \  argument
81 RB_PARENT(elm, field) = parent; \
163 struct type *parent, *gparent, *tmp; \
164 while ((parent = RB_PARENT(elm, field)) != NULL && \
165 RB_COLOR(parent, field) == RB_RED) { \
166 gparent = RB_PARENT(parent, field); \
167 if (parent == RB_LEFT(gparent, field)) { \
171 RB_SET_BLACKRED(parent, gparent, field); \
175 if (RB_RIGHT(parent, field) == elm) { \
176 RB_ROTATE_LEFT(head, parent, tmp, field); \
177 tmp = parent; \
178 parent = elm; \
181 RB_SET_BLACKRED(parent, gparent, field); \
187 RB_SET_BLACKRED(parent, gparent, field); \
191 if (RB_LEFT(parent, field) == elm) { \
192 RB_ROTATE_RIGHT(head, parent, tmp, field); \
193 tmp = parent; \
194 parent = elm; \
197 RB_SET_BLACKRED(parent, gparent, field); \
205 name##_RB_REMOVE_COLOR(struct name *head, struct type *parent, \
211 if (RB_LEFT(parent, field) == elm) { \
212 tmp = RB_RIGHT(parent, field); \
214 RB_SET_BLACKRED(tmp, parent, field); \
215 RB_ROTATE_LEFT(head, parent, tmp, field); \
216 tmp = RB_RIGHT(parent, field); \
223 elm = parent; \
224 parent = RB_PARENT(elm, field); \
234 tmp = RB_RIGHT(parent, field); \
236 RB_COLOR(tmp, field) = RB_COLOR(parent, field); \
237 RB_COLOR(parent, field) = RB_BLACK; \
240 RB_ROTATE_LEFT(head, parent, tmp, field); \
245 tmp = RB_LEFT(parent, field); \
247 RB_SET_BLACKRED(tmp, parent, field); \
248 RB_ROTATE_RIGHT(head, parent, tmp, field); \
249 tmp = RB_LEFT(parent, field); \
256 elm = parent; \
257 parent = RB_PARENT(elm, field); \
267 tmp = RB_LEFT(parent, field); \
269 RB_COLOR(tmp, field) = RB_COLOR(parent, field); \
270 RB_COLOR(parent, field) = RB_BLACK; \
273 RB_ROTATE_RIGHT(head, parent, tmp, field); \
286 struct type *child, *parent, *old = elm; \
298 parent = RB_PARENT(elm, field); \
301 RB_PARENT(child, field) = parent; \
302 if (parent) { \
303 if (RB_LEFT(parent, field) == elm) \
304 RB_LEFT(parent, field) = child; \
306 RB_RIGHT(parent, field) = child; \
307 RB_AUGMENT(parent); \
311 parent = elm; \
324 if (parent) { \
325 left = parent; \
332 parent = RB_PARENT(elm, field); \
335 RB_PARENT(child, field) = parent; \
336 if (parent) { \
337 if (RB_LEFT(parent, field) == elm) \
338 RB_LEFT(parent, field) = child; \
340 RB_RIGHT(parent, field) = child; \
341 RB_AUGMENT(parent); \
346 name##_RB_REMOVE_COLOR(head, parent, child); \
355 struct type *parent = NULL; \
359 parent = tmp; \
360 comp = (cmp)(elm, parent); \
368 RB_SET(elm, parent, field); \
369 if (parent != NULL) { \
371 RB_LEFT(parent, field) = elm; \
373 RB_RIGHT(parent, field) = elm; \
374 RB_AUGMENT(parent); \
468 struct type *parent = NULL; \
470 parent = tmp; \
476 return (parent); \