Lines Matching refs:tmp

95 #define RB_ROTATE_LEFT(head, elm, tmp, field) do {                            \  argument
96 (tmp) = RB_RIGHT(elm, field); \
97 if ((RB_RIGHT(elm, field) = RB_LEFT(tmp, field)) != NULL) { \
98 RB_PARENT(RB_LEFT(tmp, field), field) = (elm); \
101 if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) { \
103 RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \
105 RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \
107 (head)->rbh_root = (tmp); \
108 RB_LEFT(tmp, field) = (elm); \
109 RB_PARENT(elm, field) = (tmp); \
110 RB_AUGMENT(tmp); \
111 if ((RB_PARENT(tmp, field))) \
112 RB_AUGMENT(RB_PARENT(tmp, field)); \
115 #define RB_ROTATE_RIGHT(head, elm, tmp, field) do { \ argument
116 (tmp) = RB_LEFT(elm, field); \
117 if ((RB_LEFT(elm, field) = RB_RIGHT(tmp, field)) != NULL) { \
118 RB_PARENT(RB_RIGHT(tmp, field), field) = (elm); \
121 if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) { \
123 RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \
125 RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \
127 (head)->rbh_root = (tmp); \
128 RB_RIGHT(tmp, field) = (elm); \
129 RB_PARENT(elm, field) = (tmp); \
130 RB_AUGMENT(tmp); \
131 if ((RB_PARENT(tmp, field))) \
132 RB_AUGMENT(RB_PARENT(tmp, field)); \
163 struct type *parent, *gparent, *tmp; \
168 tmp = RB_RIGHT(gparent, field); \
169 if (tmp && RB_COLOR(tmp, field) == RB_RED) { \
170 RB_COLOR(tmp, field) = RB_BLACK; \
176 RB_ROTATE_LEFT(head, parent, tmp, field); \
177 tmp = parent; \
179 elm = tmp; \
182 RB_ROTATE_RIGHT(head, gparent, tmp, field); \
184 tmp = RB_LEFT(gparent, field); \
185 if (tmp && RB_COLOR(tmp, field) == RB_RED) { \
186 RB_COLOR(tmp, field) = RB_BLACK; \
192 RB_ROTATE_RIGHT(head, parent, tmp, field); \
193 tmp = parent; \
195 elm = tmp; \
198 RB_ROTATE_LEFT(head, gparent, tmp, field); \
208 struct type *tmp; \
212 tmp = RB_RIGHT(parent, field); \
213 if (RB_COLOR(tmp, field) == RB_RED) { \
214 RB_SET_BLACKRED(tmp, parent, field); \
215 RB_ROTATE_LEFT(head, parent, tmp, field); \
216 tmp = RB_RIGHT(parent, field); \
218 if ((RB_LEFT(tmp, field) == NULL || \
219 RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) && \
220 (RB_RIGHT(tmp, field) == NULL || \
221 RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) { \
222 RB_COLOR(tmp, field) = RB_RED; \
226 if (RB_RIGHT(tmp, field) == NULL || \
227 RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK) { \
229 if ((oleft = RB_LEFT(tmp, field)) \
232 RB_COLOR(tmp, field) = RB_RED; \
233 RB_ROTATE_RIGHT(head, tmp, oleft, field); \
234 tmp = RB_RIGHT(parent, field); \
236 RB_COLOR(tmp, field) = RB_COLOR(parent, field); \
238 if (RB_RIGHT(tmp, field)) \
239 RB_COLOR(RB_RIGHT(tmp, field), field) = RB_BLACK; \
240 RB_ROTATE_LEFT(head, parent, tmp, field); \
245 tmp = RB_LEFT(parent, field); \
246 if (RB_COLOR(tmp, field) == RB_RED) { \
247 RB_SET_BLACKRED(tmp, parent, field); \
248 RB_ROTATE_RIGHT(head, parent, tmp, field); \
249 tmp = RB_LEFT(parent, field); \
251 if ((RB_LEFT(tmp, field) == NULL || \
252 RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) && \
253 (RB_RIGHT(tmp, field) == NULL || \
254 RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) { \
255 RB_COLOR(tmp, field) = RB_RED; \
259 if (RB_LEFT(tmp, field) == NULL || \
260 RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) { \
262 if ((oright = RB_RIGHT(tmp, field)) \
265 RB_COLOR(tmp, field) = RB_RED; \
266 RB_ROTATE_LEFT(head, tmp, oright, field); \
267 tmp = RB_LEFT(parent, field); \
269 RB_COLOR(tmp, field) = RB_COLOR(parent, field); \
271 if (RB_LEFT(tmp, field)) \
272 RB_COLOR(RB_LEFT(tmp, field), field) = RB_BLACK; \
273 RB_ROTATE_RIGHT(head, parent, tmp, field); \
354 struct type *tmp; \
357 tmp = RB_ROOT(head); \
358 while (tmp) { \
359 parent = tmp; \
362 tmp = RB_LEFT(tmp, field); \
364 tmp = RB_RIGHT(tmp, field); \
366 return (tmp); \
385 struct type *tmp = RB_ROOT(head); \
387 while (tmp) { \
388 comp = cmp(elm, tmp); \
390 tmp = RB_LEFT(tmp, field); \
392 tmp = RB_RIGHT(tmp, field); \
394 return (tmp); \
403 struct type *tmp = RB_ROOT(head); \
406 while (tmp) { \
407 comp = cmp(elm, tmp); \
409 res = tmp; \
410 tmp = RB_LEFT(tmp, field); \
413 tmp = RB_RIGHT(tmp, field); \
415 return (tmp); \
467 struct type *tmp = RB_ROOT(head); \
469 while (tmp) { \
470 parent = tmp; \
472 tmp = RB_LEFT(tmp, field); \
474 tmp = RB_RIGHT(tmp, field); \