Esempio n. 1
0
/**
 * Tests if the two hash_set are equal.
 */
bool_t hash_set_equal(const hash_set_t* cphset_first, const hash_set_t* cphset_second)
{
    assert(cphset_first != NULL);
    assert(cphset_second != NULL);

    return _hashtable_equal(&cphset_first->_t_hashtable, &cphset_second->_t_hashtable);
}
Esempio n. 2
0
/**
 * Tests if the two hash_multimap are equal.
 */
bool_t hash_multimap_equal(const hash_multimap_t* cphmmap_first, const hash_multimap_t* cphmmap_second)
{
    assert(cphmmap_first != NULL);
    assert(cphmmap_second != NULL);
    assert(_pair_is_inited(&cphmmap_first->_pair_temp));
    assert(_pair_is_inited(&cphmmap_second->_pair_temp));

    if (cphmmap_first->_bfun_keycompare != cphmmap_second->_bfun_keycompare) {
        return false;
    }

    /* test hashtable */
    return _hashtable_equal(&cphmmap_first->_t_hashtable, &cphmmap_second->_t_hashtable);
}
Esempio n. 3
0
/**
 * Swap the datas of first hashtable and second hashtable.
 */
void _hashtable_swap(_hashtable_t* pt_first, _hashtable_t* pt_second)
{
    _hashtable_t t_swap;

    assert(pt_first != NULL);
    assert(pt_second != NULL);
    assert(_hashtable_is_inited(pt_first));
    assert(_hashtable_is_inited(pt_second));
    assert(_hashtable_same_type_ex(pt_first, pt_second));

    if (_hashtable_equal(pt_first, pt_second)) {
        return;
    }

    t_swap = *pt_first;
    *pt_first = *pt_second;
    *pt_second = t_swap;
}
Esempio n. 4
0
/**
 * Tests if the first rb tree is greater than or equal to the second rb tree.
 */
bool_t _hashtable_greater_equal(const _hashtable_t* cpt_first, const _hashtable_t* cpt_second)
{
    return (_hashtable_greater(cpt_first, cpt_second) || _hashtable_equal(cpt_first, cpt_second)) ? true : false;
}
Esempio n. 5
0
/**
 * Tests if the two rb tree are not equal.
 */
bool_t _hashtable_not_equal(const _hashtable_t* cpt_first, const _hashtable_t* cpt_second)
{
    return !_hashtable_equal(cpt_first, cpt_second);
}