Home
last modified time | relevance | path

Searched refs:rootp (Results 1 – 2 of 2) sorted by relevance

/bionic/libc/upstream-openbsd/lib/libc/stdlib/
Dtsearch.c30 node **rootp = (node **)vrootp; in tsearch() local
32 if (rootp == (struct node_t **)0) in tsearch()
34 while (*rootp != (struct node_t *)0) { /* Knuth's T1: */ in tsearch()
37 if ((r = (*compar)(key, (*rootp)->key)) == 0) /* T2: */ in tsearch()
38 return ((void *)*rootp); /* we found it! */ in tsearch()
39 rootp = (r < 0) ? in tsearch()
40 &(*rootp)->left : /* T3: follow left branch */ in tsearch()
41 &(*rootp)->right; /* T4: follow right branch */ in tsearch()
45 *rootp = q; /* link new node to old */ in tsearch()
57 node **rootp = (node **)vrootp; in tdelete() local
[all …]
Dtfind.c28 node **rootp = (node **)vrootp; in tfind() local
30 if (rootp == (struct node_t **)0) in tfind()
32 while (*rootp != (struct node_t *)0) { /* T1: */ in tfind()
34 if ((r = (*compar)(key, (*rootp)->key)) == 0) /* T2: */ in tfind()
35 return (*rootp); /* key found */ in tfind()
36 rootp = (r < 0) ? in tfind()
37 &(*rootp)->llink : /* T3: follow left branch */ in tfind()
38 &(*rootp)->rlink; /* T4: follow right branch */ in tfind()