Пример #1
0
/**
 * Test the first queue is less than or equal to the second queue.
 */
bool_t queue_less_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_less_equal(&cpque_first->_t_sequence, &cpque_second->_t_sequence);
#else
    return deque_less_equal(&cpque_first->_t_sequence, &cpque_second->_t_sequence);
#endif
}
Пример #2
0
/**
 * Test the first stack is less than or equal to the second stack.
 */
bool_t stack_less_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_less_equal(&cpsk_first->_t_sequence, &cpsk_second->_t_sequence);
#elif defined (CSTL_STACK_LIST_SEQUENCE)
    return list_less_equal(&cpsk_first->_t_sequence, &cpsk_second->_t_sequence);
#else
    return deque_less_equal(&cpsk_first->_t_sequence, &cpsk_second->_t_sequence);
#endif
}