コード例 #1
0
ファイル: pcu_aa.c プロジェクト: matthb2/core
pcu_aa_node* pcu_aa_find(pcu_aa_node* x, pcu_aa_tree t, pcu_aa_less* less)
{
  if (t == &pcu_aa_bottom)
    return 0;
  if (less(x,t))
    return pcu_aa_find(x,t->left,less);
  else if (less(t,x))
    return pcu_aa_find(x,t->right,less);
  else
    return t;
}
コード例 #2
0
ファイル: pcu_msg.c プロジェクト: BijanZarif/core
static pcu_msg_peer* find_peer(pcu_aa_tree t, int id)
{
  pcu_msg_peer key;
  key.message.peer = id;
  return (pcu_msg_peer*) pcu_aa_find(&(key.node),t,peer_less);
}