Lines Matching refs:t

41                              struct Curl_tree *t)  in Curl_splay()  argument
46 if(t == NULL) in Curl_splay()
47 return t; in Curl_splay()
52 comp = compare(i, t->key); in Curl_splay()
54 if(t->smaller == NULL) in Curl_splay()
56 if(compare(i, t->smaller->key) < 0) { in Curl_splay()
57 y = t->smaller; /* rotate smaller */ in Curl_splay()
58 t->smaller = y->larger; in Curl_splay()
59 y->larger = t; in Curl_splay()
60 t = y; in Curl_splay()
61 if(t->smaller == NULL) in Curl_splay()
64 r->smaller = t; /* link smaller */ in Curl_splay()
65 r = t; in Curl_splay()
66 t = t->smaller; in Curl_splay()
69 if(t->larger == NULL) in Curl_splay()
71 if(compare(i, t->larger->key) > 0) { in Curl_splay()
72 y = t->larger; /* rotate larger */ in Curl_splay()
73 t->larger = y->smaller; in Curl_splay()
74 y->smaller = t; in Curl_splay()
75 t = y; in Curl_splay()
76 if(t->larger == NULL) in Curl_splay()
79 l->larger = t; /* link larger */ in Curl_splay()
80 l = t; in Curl_splay()
81 t = t->larger; in Curl_splay()
87 l->larger = t->smaller; /* assemble */ in Curl_splay()
88 r->smaller = t->larger; in Curl_splay()
89 t->smaller = N.larger; in Curl_splay()
90 t->larger = N.smaller; in Curl_splay()
92 return t; in Curl_splay()
101 struct Curl_tree *t, in Curl_splayinsert() argument
107 return t; in Curl_splayinsert()
109 if(t != NULL) { in Curl_splayinsert()
110 t = Curl_splay(i, t); in Curl_splayinsert()
111 if(compare(i, t->key)==0) { in Curl_splayinsert()
116 node->same = t; in Curl_splayinsert()
118 node->smaller = t->smaller; in Curl_splayinsert()
119 node->larger = t->larger; in Curl_splayinsert()
121 t->smaller = node; /* in the sub node for this same key, we use the in Curl_splayinsert()
125 t->key = KEY_NOTUSED; /* and we set the key in the sub node to NOTUSED in Curl_splayinsert()
132 if(t == NULL) { in Curl_splayinsert()
135 else if(compare(i, t->key) < 0) { in Curl_splayinsert()
136 node->smaller = t->smaller; in Curl_splayinsert()
137 node->larger = t; in Curl_splayinsert()
138 t->smaller = NULL; in Curl_splayinsert()
142 node->larger = t->larger; in Curl_splayinsert()
143 node->smaller = t; in Curl_splayinsert()
144 t->larger = NULL; in Curl_splayinsert()
155 struct Curl_tree *t, in Curl_splaygetbest() argument
160 if(!t) { in Curl_splaygetbest()
165 t = Curl_splay(i, t); in Curl_splaygetbest()
166 if(compare(i, t->key) < 0) { in Curl_splaygetbest()
168 if(t->smaller) in Curl_splaygetbest()
169 t=Curl_splay(t->smaller->key, t); in Curl_splaygetbest()
173 return t; in Curl_splaygetbest()
177 if(compare(i, t->key) >= 0) { /* found it */ in Curl_splaygetbest()
179 x = t->same; in Curl_splaygetbest()
185 x->key = t->key; in Curl_splaygetbest()
186 x->larger = t->larger; in Curl_splaygetbest()
187 x->smaller = t->smaller; in Curl_splaygetbest()
189 *removed = t; in Curl_splaygetbest()
193 if(t->smaller == NULL) { in Curl_splaygetbest()
194 x = t->larger; in Curl_splaygetbest()
197 x = Curl_splay(i, t->smaller); in Curl_splaygetbest()
198 x->larger = t->larger; in Curl_splaygetbest()
200 *removed = t; in Curl_splaygetbest()
206 return t; /* It wasn't there */ in Curl_splaygetbest()
222 int Curl_splayremovebyaddr(struct Curl_tree *t, in Curl_splayremovebyaddr() argument
229 if(!t || !removenode) in Curl_splayremovebyaddr()
247 *newroot = t; /* return the same root */ in Curl_splayremovebyaddr()
251 t = Curl_splay(removenode->key, t); in Curl_splayremovebyaddr()
260 if(t != removenode) in Curl_splayremovebyaddr()
265 x = t->same; in Curl_splayremovebyaddr()
270 x->key = t->key; in Curl_splayremovebyaddr()
271 x->larger = t->larger; in Curl_splayremovebyaddr()
272 x->smaller = t->smaller; in Curl_splayremovebyaddr()
276 if(t->smaller == NULL) in Curl_splayremovebyaddr()
277 x = t->larger; in Curl_splayremovebyaddr()
279 x = Curl_splay(removenode->key, t->smaller); in Curl_splayremovebyaddr()
280 x->larger = t->larger; in Curl_splayremovebyaddr()