Example #1
0
/*
*  Find a Node based on the key, return users data.
*/
void * sfghash_find( SFGHASH * t, void * key)
{
    SFGHASH_NODE * hnode;

    hnode = sfghash_find_node( t, key );

    if( hnode ) return hnode->data;

    return NULL;
}
Example #2
0
/* Returns whether or not the there is an entry in the table with key
 * Sets argument data to data in hash node which could be NULL.
 * This function is used to both make sure there is an entry in the
 * table and get potential data associated with entry */
int sfghash_find2(SFGHASH *t, void *key, void **data)
{
    SFGHASH_NODE * hnode;

    if (t == NULL)
        return 0;

    hnode = sfghash_find_node(t, key);

    if (hnode != NULL)
    {
        *data = hnode->data;
        return 1;
    }

    return 0;
}