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.c29 node **rootp = (node **)vrootp; in tsearch() local
31 if (rootp == (struct node_t **)0) in tsearch()
33 while (*rootp != (struct node_t *)0) { /* Knuth's T1: */ in tsearch()
36 if ((r = (*compar)(key, (*rootp)->key)) == 0) /* T2: */ in tsearch()
37 return ((void *)*rootp); /* we found it! */ in tsearch()
38 rootp = (r < 0) ? in tsearch()
39 &(*rootp)->left : /* T3: follow left branch */ in tsearch()
40 &(*rootp)->right; /* T4: follow right branch */ in tsearch()
44 *rootp = q; /* link new node to old */ in tsearch()
56 node **rootp = (node **)vrootp; in tdelete() local
[all …]
Dtfind.c27 node **rootp = (node **)vrootp; in tfind() local
29 if (rootp == (struct node_t **)0) in tfind()
31 while (*rootp != (struct node_t *)0) { /* T1: */ in tfind()
33 if ((r = (*compar)(key, (*rootp)->key)) == 0) /* T2: */ in tfind()
34 return (*rootp); /* key found */ in tfind()
35 rootp = (r < 0) ? in tfind()
36 &(*rootp)->llink : /* T3: follow left branch */ in tfind()
37 &(*rootp)->rlink; /* T4: follow right branch */ in tfind()