Lines Matching refs:a_field
33 #define phn_lchild_get(a_type, a_field, a_phn) \ argument
34 (a_phn->a_field.phn_lchild)
35 #define phn_lchild_set(a_type, a_field, a_phn, a_lchild) do { \ argument
36 a_phn->a_field.phn_lchild = a_lchild; \
39 #define phn_next_get(a_type, a_field, a_phn) \ argument
40 (a_phn->a_field.phn_next)
41 #define phn_prev_set(a_type, a_field, a_phn, a_prev) do { \ argument
42 a_phn->a_field.phn_prev = a_prev; \
45 #define phn_prev_get(a_type, a_field, a_phn) \ argument
46 (a_phn->a_field.phn_prev)
47 #define phn_next_set(a_type, a_field, a_phn, a_next) do { \ argument
48 a_phn->a_field.phn_next = a_next; \
51 #define phn_merge_ordered(a_type, a_field, a_phn0, a_phn1, a_cmp) do { \ argument
58 phn_prev_set(a_type, a_field, a_phn1, a_phn0); \
59 phn0child = phn_lchild_get(a_type, a_field, a_phn0); \
60 phn_next_set(a_type, a_field, a_phn1, phn0child); \
62 phn_prev_set(a_type, a_field, phn0child, a_phn1); \
64 phn_lchild_set(a_type, a_field, a_phn0, a_phn1); \
67 #define phn_merge(a_type, a_field, a_phn0, a_phn1, a_cmp, r_phn) do { \ argument
73 phn_merge_ordered(a_type, a_field, a_phn0, a_phn1, \
77 phn_merge_ordered(a_type, a_field, a_phn1, a_phn0, \
83 #define ph_merge_siblings(a_type, a_field, a_phn, a_cmp, r_phn) do { \ argument
87 a_type *phn1 = phn_next_get(a_type, a_field, phn0); \
98 a_type *phnrest = phn_next_get(a_type, a_field, phn1); \
100 phn_prev_set(a_type, a_field, phnrest, NULL); \
102 phn_prev_set(a_type, a_field, phn0, NULL); \
103 phn_next_set(a_type, a_field, phn0, NULL); \
104 phn_prev_set(a_type, a_field, phn1, NULL); \
105 phn_next_set(a_type, a_field, phn1, NULL); \
106 phn_merge(a_type, a_field, phn0, phn1, a_cmp, phn0); \
110 phn1 = phn_next_get(a_type, a_field, phn0); \
112 phnrest = phn_next_get(a_type, a_field, \
115 phn_prev_set(a_type, a_field, \
118 phn_prev_set(a_type, a_field, phn0, \
120 phn_next_set(a_type, a_field, phn0, \
122 phn_prev_set(a_type, a_field, phn1, \
124 phn_next_set(a_type, a_field, phn1, \
126 phn_merge(a_type, a_field, phn0, phn1, \
128 phn_next_set(a_type, a_field, tail, \
133 phn_next_set(a_type, a_field, tail, \
140 phn1 = phn_next_get(a_type, a_field, phn0); \
143 head = phn_next_get(a_type, a_field, \
145 assert(phn_prev_get(a_type, a_field, \
147 phn_next_set(a_type, a_field, phn0, \
149 assert(phn_prev_get(a_type, a_field, \
151 phn_next_set(a_type, a_field, phn1, \
153 phn_merge(a_type, a_field, phn0, phn1, \
158 phn_next_set(a_type, a_field, tail, \
162 phn1 = phn_next_get(a_type, a_field, \
170 #define ph_merge_aux(a_type, a_field, a_ph, a_cmp) do { \ argument
171 a_type *phn = phn_next_get(a_type, a_field, a_ph->ph_root); \
173 phn_prev_set(a_type, a_field, a_ph->ph_root, NULL); \
174 phn_next_set(a_type, a_field, a_ph->ph_root, NULL); \
175 phn_prev_set(a_type, a_field, phn, NULL); \
176 ph_merge_siblings(a_type, a_field, phn, a_cmp, phn); \
177 assert(phn_next_get(a_type, a_field, phn) == NULL); \
178 phn_merge(a_type, a_field, a_ph->ph_root, phn, a_cmp, \
183 #define ph_merge_children(a_type, a_field, a_phn, a_cmp, r_phn) do { \ argument
184 a_type *lchild = phn_lchild_get(a_type, a_field, a_phn); \
188 ph_merge_siblings(a_type, a_field, lchild, a_cmp, \
211 #define ph_gen(a_attr, a_prefix, a_ph_type, a_type, a_field, a_cmp) \ argument
225 ph_merge_aux(a_type, a_field, ph, a_cmp); \
233 a_type *aux = phn_next_get(a_type, a_field, ph->ph_root); \
241 memset(&phn->a_field, 0, sizeof(phn(a_type))); \
254 phn_next_set(a_type, a_field, phn, phn_next_get(a_type, \
255 a_field, ph->ph_root)); \
256 if (phn_next_get(a_type, a_field, ph->ph_root) != \
258 phn_prev_set(a_type, a_field, \
259 phn_next_get(a_type, a_field, ph->ph_root), \
262 phn_prev_set(a_type, a_field, phn, ph->ph_root); \
263 phn_next_set(a_type, a_field, ph->ph_root, phn); \
273 ph_merge_aux(a_type, a_field, ph, a_cmp); \
277 ph_merge_children(a_type, a_field, ph->ph_root, a_cmp, \
294 a_type *ret = phn_next_get(a_type, a_field, ph->ph_root); \
296 a_type *aux = phn_next_get(a_type, a_field, ret); \
297 phn_next_set(a_type, a_field, ph->ph_root, aux); \
299 phn_prev_set(a_type, a_field, aux, \
305 ph_merge_children(a_type, a_field, ph->ph_root, a_cmp, \
319 if (phn_lchild_get(a_type, a_field, phn) == NULL) { \
320 ph->ph_root = phn_next_get(a_type, a_field, \
323 phn_prev_set(a_type, a_field, \
328 ph_merge_aux(a_type, a_field, ph, a_cmp); \
330 ph_merge_children(a_type, a_field, ph->ph_root, \
337 if ((parent = phn_prev_get(a_type, a_field, phn)) != NULL) { \
338 if (phn_lchild_get(a_type, a_field, parent) != phn) { \
343 ph_merge_children(a_type, a_field, phn, a_cmp, replace); \
347 phn_prev_set(a_type, a_field, replace, parent); \
348 phn_lchild_set(a_type, a_field, parent, \
351 phn_prev_set(a_type, a_field, replace, \
352 phn_prev_get(a_type, a_field, phn)); \
353 if (phn_prev_get(a_type, a_field, phn) != \
355 phn_next_set(a_type, a_field, \
356 phn_prev_get(a_type, a_field, phn), \
360 phn_next_set(a_type, a_field, replace, \
361 phn_next_get(a_type, a_field, phn)); \
362 if (phn_next_get(a_type, a_field, phn) != NULL) { \
363 phn_prev_set(a_type, a_field, \
364 phn_next_get(a_type, a_field, phn), \
369 a_type *next = phn_next_get(a_type, a_field, \
371 phn_lchild_set(a_type, a_field, parent, next); \
373 phn_prev_set(a_type, a_field, next, \
377 assert(phn_prev_get(a_type, a_field, phn) != \
379 phn_next_set(a_type, a_field, \
380 phn_prev_get(a_type, a_field, phn), \
381 phn_next_get(a_type, a_field, phn)); \
383 if (phn_next_get(a_type, a_field, phn) != NULL) { \
384 phn_prev_set(a_type, a_field, \
385 phn_next_get(a_type, a_field, phn), \
386 phn_prev_get(a_type, a_field, phn)); \