Lines Matching defs:root
49 FTSENT* root; \
258 search(FTSENT* e, FTSENT* root, int(*comparf)(FTSENT* const*, FTSENT* const*), int insert)
268 while (root)
270 if (!(cmp = (*comparf)(&e, &root)) && !insert)
278 if (root->left && (cmp = (*comparf)(&e, &root->left)) <= 0)
280 RROTATE(root);
290 right->left = root;
292 rroot = root;
293 right = root;
294 root = root->left;
303 if (root->right && (cmp = (*comparf)(&e, &root->right)) >= 0)
305 LROTATE(root);
315 left->right = root;
317 lroot = root;
318 left = root;
319 root = root->right;
323 if (!root)
324 root = e;
328 right->left = root->right;
330 rroot = root->right;
332 left->right = root->left;
334 lroot = root->left;
336 root->left = lroot;
337 root->right = rroot;
338 return root;
342 * delete the root element from the tree
346 deleteroot(register FTSENT* root)
352 right = root->right;
353 if (!(left = root->left))
354 root = right;
360 root = left;
362 return root;
366 * generate ordered fts_link list from binary tree at root
372 getlist(register FTSENT** top, register FTSENT** bot, register FTSENT* root)
378 if (root->left)
380 root->stack = stack;
381 stack = root;
382 root = root->left;
389 *bot = (*bot)->fts_link = root;
391 *bot = *top = root;
392 if (root->right)
394 root = root->right;
397 if (!(root = stack))
679 register FTSENT* root;
683 top = bot = root = 0;
685 root = search(f, root, fts->comparf, 1);
686 getlist(&top, &bot, root);
866 fts->root = fts->top = fts->bot = 0;
1074 fts->root = search(f, fts->root, fts->comparf, 1);
1104 if (fts->root)
1105 getlist(&fts->top, &fts->bot, fts->root);