Lines Matching refs:_f
22 # define RBI_CODE(_n, _t, _f, _cmp) \
31 .rbto_node_offset = offsetof(_t, _f), \
88 #define RBI_CODE(_n, _t, _f, _cmp) \
105 parent = node->_f.parent; \
106 tmp1 = node->_f.right; \
107 tmp2 = tmp1->_f.left; \
108 node->_f.right = tmp2; \
110 tmp2->_f.parent = node; \
112 head->top._f.right = tmp1; \
113 else if (parent->_f.right == node) \
114 parent->_f.right = tmp1; \
116 parent->_f.left = tmp1; \
117 tmp1->_f.left = node; \
118 tmp1->_f.parent = parent; \
119 node->_f.parent = tmp1; \
127 parent = node->_f.parent; \
128 tmp1 = node->_f.left; \
129 tmp2 = tmp1->_f.right; \
130 node->_f.left = tmp2; \
132 tmp2->_f.parent = node; \
134 head->top._f.right = tmp1; \
135 else if (parent->_f.right == node) \
136 parent->_f.right = tmp1; \
138 parent->_f.left = tmp1; \
139 tmp1->_f.right = node; \
140 tmp1->_f.parent = parent; \
141 node->_f.parent = tmp1; \
150 node->_f.left = &_n##_rb_zero; \
151 node->_f.right = &_n##_rb_zero; \
152 p = &head->top._f.right; \
155 p = &n->_f.left; \
157 p = &n->_f.right; \
161 node->_f.colour = C_RED; \
162 node->_f.parent = parent; \
164 while ((node != &_n##_rb_zero) && (parent->_f.colour == C_RED)){\
165 gparent = parent->_f.parent; \
166 if (parent == gparent->_f.left) { \
167 tmp1 = gparent->_f.right; \
168 if (tmp1->_f.colour == C_RED) { \
169 parent->_f.colour = C_BLACK; \
170 tmp1->_f.colour = C_BLACK; \
171 gparent->_f.colour = C_RED; \
174 if (node == parent->_f.right) { \
177 parent = node->_f.parent; \
179 parent->_f.colour = C_BLACK; \
180 gparent->_f.colour = C_RED; \
184 tmp1 = gparent->_f.left; \
185 if (tmp1->_f.colour == C_RED) { \
186 parent->_f.colour = C_BLACK; \
187 tmp1->_f.colour = C_BLACK; \
188 gparent->_f.colour = C_RED; \
191 if (node == parent->_f.left) { \
194 parent = node->_f.parent; \
196 parent->_f.colour = C_BLACK; \
197 gparent->_f.colour = C_RED; \
198 rotate_left(head, parent->_f.parent); \
201 parent = node->_f.parent; \
203 head->top._f.right->_f.colour = C_BLACK; \
212 while ((node == &_n##_rb_zero || node->_f.colour == C_BLACK) && \
214 if (parent->_f.left == node) { \
215 tmp = parent->_f.right; \
216 if (tmp->_f.colour == C_RED) { \
217 tmp->_f.colour = C_BLACK; \
218 parent->_f.colour = C_RED; \
220 tmp = parent->_f.right; \
222 if ((tmp->_f.left == &_n##_rb_zero || \
223 tmp->_f.left->_f.colour == C_BLACK) && \
224 (tmp->_f.right == &_n##_rb_zero || \
225 tmp->_f.right->_f.colour == C_BLACK)) { \
226 tmp->_f.colour = C_RED; \
228 parent = node->_f.parent; \
230 if (tmp->_f.right == &_n##_rb_zero || \
231 tmp->_f.right->_f.colour == C_BLACK) {\
232 _t *tmp2 = tmp->_f.left; \
235 tmp2->_f.colour = C_BLACK;\
236 tmp->_f.colour = C_RED; \
238 tmp = parent->_f.right; \
240 tmp->_f.colour = parent->_f.colour; \
241 parent->_f.colour = C_BLACK; \
242 if (tmp->_f.right != &_n##_rb_zero) \
243 tmp->_f.right->_f.colour = C_BLACK;\
245 node = head->top._f.right; \
248 tmp = parent->_f.left; \
249 if (tmp->_f.colour == C_RED) { \
250 tmp->_f.colour = C_BLACK; \
251 parent->_f.colour = C_RED; \
253 tmp = parent->_f.left; \
255 if ((tmp->_f.left == &_n##_rb_zero || \
256 tmp->_f.left->_f.colour == C_BLACK) && \
257 (tmp->_f.right == &_n##_rb_zero || \
258 tmp->_f.right->_f.colour == C_BLACK)) { \
259 tmp->_f.colour = C_RED; \
261 parent = node->_f.parent; \
263 if (tmp->_f.left == &_n##_rb_zero || \
264 tmp->_f.left->_f.colour == C_BLACK) {\
265 _t *tmp2 = tmp->_f.right; \
268 tmp2->_f.colour = C_BLACK;\
269 tmp->_f.colour = C_RED; \
271 tmp = parent->_f.left; \
273 tmp->_f.colour = parent->_f.colour; \
274 parent->_f.colour = C_BLACK; \
275 if (tmp->_f.left != &_n##_rb_zero) \
276 tmp->_f.left->_f.colour = C_BLACK;\
278 node = head->top._f.right; \
284 node->_f.colour = C_BLACK; \
293 if (node->_f.left == &_n##_rb_zero) { \
294 child = node->_f.right; \
295 } else if (node->_f.right == &_n##_rb_zero) { \
296 child = node->_f.left; \
298 node = node->_f.right; \
299 while ((left = node->_f.left) != &_n##_rb_zero) \
301 child = node->_f.right; \
302 parent = node->_f.parent; \
303 color = node->_f.colour; \
305 child->_f.parent = parent; \
307 if (parent->_f.left == node) \
308 parent->_f.left = child; \
310 parent->_f.right = child; \
312 head->top._f.right = child; \
314 if (node->_f.parent == old) \
317 if (old->_f.parent != &_n##_rb_zero) { \
318 if (old->_f.parent->_f.left == old) \
319 old->_f.parent->_f.left = node; \
321 old->_f.parent->_f.right = node; \
323 head->top._f.right = child; \
325 old->_f.left->_f.parent = node; \
326 if (old->_f.right != &_n##_rb_zero) \
327 old->_f.right->_f.parent = node; \
333 parent = node->_f.parent; \
334 color= node->_f.colour; \
336 child->_f.parent = parent; \
338 if (parent->_f.left == node) \
339 parent->_f.left = child; \
341 parent->_f.right = child; \
343 head->top._f.right = child; \
356 head->top._f.left = &_n##_rb_zero; \
357 head->top._f.right = &_n##_rb_zero; \
358 head->top._f.parent = &head->top; \
359 _n##_rb_zero._f.left = &_n##_rb_zero; \
360 _n##_rb_zero._f.right = &_n##_rb_zero; \
361 _n##_rb_zero._f.parent = &_n##_rb_zero; \
369 _t *node = head->top._f.right; \
373 node = node->_f.left; \
378 while ((node->_f.parent->_f.right == node) && \
381 node = node->_f.parent; \
385 for (node = node->_f.parent->_f.right; node != &_n##_rb_zero;\
386 node = node->_f.left) \
404 node = head->top._f.right; \
410 node = node->_f.left; \
412 node = node->_f.right; \