Deleting a TRB Node Step 1 - Search - GNU libavl 2.0.2
Author: Ben Pfaff

9.4.1 Step 1: Search |

There's nothing new or interesting in the search code.

    350. <Step 1: Search TRB tree for item to delete 350> =
    if (tree->trb_root == NULL)
      return NULL;

    p = (struct trb_node *) &tree->trb_root;
    for (cmp = -1; cmp != 0;
         cmp = tree->trb_compare (item, p->trb_data, tree->trb_param))
      {
        dir = cmp > 0;
        pa[k] = p;
        da[k++] = dir;

        if (p->trb_tag[dir] == TRB_THREAD)
          return NULL;
        p = p->trb_link[dir];
      }
    item = p->trb_data;

This code is included in 349 and 659.