openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/dbus-broker/19-r0/dbus-broker-19/subprojects/c-rbtree/src/c-rbtree.h
static inline CRBNode* c_rbtree_find_node(CRBTree* t, CRBCompareFunc f,
                                          const void* k)
{
    CRBNode* i;

    assert(t);
    assert(f);

    i = t->root;
    while (i)
    {
        int v = f(t, (void*)k, i);
        if (v < 0)
            i = i->left;
        else if (v > 0)
            i = i->right;
        else
            return i;
    }

    return NULL;
}
/**
 * c_rbtree_find_node() - find node
 * @t:          tree to search through
 * @f:          comparison function
 * @k:          key to search for
 *
 * This searches through @t for a node that compares equal to @k. The function
 * @f must be provided by the caller, which is used to compare nodes to @k. See
 * the documentation of CRBCompareFunc for details.
 *
 * If there are multiple entries that compare equal to @k, this will return a
 * pseudo-randomly picked node. If you need stable lookup functions for trees
 * where duplicate entries are allowed, you better code your own lookup.
 *
 * Return: Pointer to matching node, or NULL.
 */
find node
@t:          tree to search through
@f:          comparison function
@k:          key to search for

This searches through @t for a node that compares equal to @k. The function
@f must be provided by the caller, which is used to compare nodes to @k. See
the documentation of CRBCompareFunc for details.

If there are multiple entries that compare equal to @k, this will return a
pseudo-randomly picked node. If you need stable lookup functions for trees
where duplicate entries are allowed, you better code your own lookup.

Pointer to matching node, or NULL.
find node @t : tree to search through @f : comparison function @k : key to search for This searches through @t for a node that compares equal to @k . The function @f must be provided by the caller which is used to compare nodes to @k . See the documentation of CRBCompareFunc for details . If there are multiple entries that compare equal to @k this will return a pseudo - randomly picked node . If you need stable lookup functions for trees where duplicate entries are allowed you better code your own lookup . Pointer to matching node or NULL .
static inline CRBNode* c_rbtree_find_node(CRBTree* t, CRBCompareFunc f,
                                          const void* k)
{
    CRBNode* i;
    assert(t);
    assert(f);
    i = t->root;
    while (i)
    {
        int v = f(t, (void*)k, i);
        if (v < 0)
            i = i->left;
        else if (v > 0)
            i = i->right;
        else
            return i;
    }
    return NULL;
}
static inline CRBNode * c_rbtree_find_node ( CRBTree * t , CRBCompareFunc f , const void * k ) { CRBNode * i ; assert ( t ) ; assert ( f ) ; i = t -> root ; while ( i ) { int v = f ( t , ( void * ) k , i ) ; if ( v < 0 ) i = i -> left ; else if ( v > 0 ) i = i -> right ; else return i ; } return NULL ; }
c_rbtree_find_node() - find node
 @t:          tree to search through
 @f:          comparison function
 @k:          key to search for
c_rbtree_find_node () - find node @t : tree to search through @f : comparison function @k : key to search for