Logo Search packages:      
Sourcecode: rapple version File versions  Download package

static rpl_reg_item rpl_reg_search_r ( rpl_reg_link  link,
rpl_reg_key  key 
) [static]

Performs recusrive search of the registry looking for the first key that matches the key parameter. This function is invoked by rpl_reg_search which commences the search from the registry root.

Parameters:
link the node from which to base the search.
key the key to match nodes against.

Definition at line 230 of file registry.c.

References rpl_reg_node_s::item, rpl_reg_node_s::left, rpl_reg_node_s::right, rpl_reg_equal(), rpl_reg_get_key(), and rpl_reg_less().

Referenced by rpl_reg_search().

{
      rpl_reg_key t_key;

      assert(key != NULL);

      t_key = rpl_reg_get_key(link->item);
      if(link == RPL_REG_NULL)
            return &RPL_REG_WA_NULL;
      if(rpl_reg_equal(key, t_key))
            return link->item;
      if(rpl_reg_less(key, t_key))
            return rpl_reg_search_r(link->left, key);
      else
            return rpl_reg_search_r(link->right, key);
}


Generated by  Doxygen 1.6.0   Back to index