示例#1
0
/**
 * Tests if the two queues are equal.
 */
bool_t queue_equal(const queue_t* cpque_first, const queue_t* cpque_second)
{
    assert(cpque_first != NULL);
    assert(cpque_second != NULL);

#ifdef CSTL_QUEUE_LIST_SEQUENCE
    return list_equal(&cpque_first->_t_sequence, &cpque_second->_t_sequence);
#else
    return deque_equal(&cpque_first->_t_sequence, &cpque_second->_t_sequence);
#endif
}
示例#2
0
/**
 * Tests if the two stacks are equal.
 */
bool_t stack_equal(const cstl_stack_t* cpsk_first, const cstl_stack_t* cpsk_second)
{
    assert(cpsk_first != NULL);
    assert(cpsk_second != NULL);

#if defined (CSTL_STACK_VECTOR_SEQUENCE)
    return vector_equal(&cpsk_first->_t_sequence, &cpsk_second->_t_sequence);
#elif defined (CSTL_STACK_LIST_SEQUENCE)
    return list_equal(&cpsk_first->_t_sequence, &cpsk_second->_t_sequence);
#else
    return deque_equal(&cpsk_first->_t_sequence, &cpsk_second->_t_sequence);
#endif
}