Functions | |
| cx_deque * | cx_deque_new (void) |
| Create a new deque without any elements. | |
| void | cx_deque_push_back (cx_deque *d, cxptr data) |
| Append data at the end of a deque. | |
| void | cx_deque_push_front (cx_deque *d, cxptr data) |
| Insert data at the beginning of a deque. | |
| cxptr | cx_deque_get (const cx_deque *d, cx_deque_const_iterator indx) |
| Retrive an element from the deque. | |
| cx_deque_iterator | cx_deque_erase (cx_deque *d, cx_deque_iterator indx, cx_free_func deallocate) |
| Erase a deque element. | |
| void | cx_deque_insert (cx_deque *d, cx_deque_iterator indx, cxptr data) |
| Insert data into a deque at a given iterator position. | |
| cxsize | cx_deque_size (const cx_deque *d) |
| Get the actual number of deque elements. | |
| void | cx_deque_destroy (cx_deque *d, cx_free_func deallocate) |
| Destroy a deque and all its elements. | |
| cxbool | cx_deque_empty (const cx_deque *d) |
| Check whether a deque is empty. | |
| cx_deque_iterator | cx_deque_begin (const cx_deque *d) |
| Get an iterator for the first deque element. | |
| cx_deque_iterator | cx_deque_end (const cx_deque *d) |
| Get an iterator for the position after the last deque element. | |
| cx_deque_iterator | cx_deque_next (const cx_deque *d, cx_deque_const_iterator i) |
| Get an iterator for the next deque element. | |
| void | cx_deque_sort (cx_deque *d, cx_deque_compare compare) |
| Sort all elements of a deque using the given comparison function. | |
#include <cxdeque.h>
| cx_deque_iterator cx_deque_begin | ( | const cx_deque * | d | ) |
Get an iterator for the first deque element.
| d | A deque. |
| void cx_deque_destroy | ( | cx_deque * | d, | |
| cx_free_func | deallocate | |||
| ) |
Destroy a deque and all its elements.
| d | Deque container to destroy. | |
| deallocate | Data deallocator. |
| cxbool cx_deque_empty | ( | const cx_deque * | d | ) |
Check whether a deque is empty.
| d | A deque. |
TRUE if the deque is empty, and FALSE otherwise.| cx_deque_iterator cx_deque_end | ( | const cx_deque * | d | ) |
Get an iterator for the position after the last deque element.
| d | A deque. |
| cx_deque_iterator cx_deque_erase | ( | cx_deque * | d, | |
| cx_deque_iterator | indx, | |||
| cx_free_func | deallocate | |||
| ) |
Erase a deque element.
| d | The deque to update. | |
| indx | Deque iterator position. | |
| deallocate | Data deallocator. |
| cxptr cx_deque_get | ( | const cx_deque * | d, | |
| cx_deque_const_iterator | indx | |||
| ) |
Retrive an element from the deque.
| d | The deque to query. | |
| indx | The position of the element to get. |
| void cx_deque_insert | ( | cx_deque * | d, | |
| cx_deque_iterator | indx, | |||
| cxptr | data | |||
| ) |
Insert data into a deque at a given iterator position.
| d | The deque to update. | |
| indx | List iterator position. | |
| data | Data item to insert. |
| cx_deque* cx_deque_new | ( | void | ) |
Create a new deque without any elements.
| cx_deque_iterator cx_deque_next | ( | const cx_deque * | d, | |
| cx_deque_const_iterator | i | |||
| ) |
Get an iterator for the next deque element.
| d | A deque. | |
| i | Current iterator position. |
| void cx_deque_push_back | ( | cx_deque * | d, | |
| cxptr | data | |||
| ) |
Append data at the end of a deque.
| d | The deque to update. | |
| data | Data to append. |
It is equivalent to the statement
cx_deque_insert(d, cx_deque_end(d), data);
| void cx_deque_push_front | ( | cx_deque * | d, | |
| cxptr | data | |||
| ) |
Insert data at the beginning of a deque.
| d | The deque to update. | |
| data | Data to add to the deque. |
It is equivalent to the statement
cx_deque_insert(d, cx_deque_begin(d), data);
| cxsize cx_deque_size | ( | const cx_deque * | d | ) |
Get the actual number of deque elements.
| d | A deque. |
| void cx_deque_sort | ( | cx_deque * | d, | |
| cx_deque_compare | compare | |||
| ) |
Sort all elements of a deque using the given comparison function.
| d | The deque to sort. | |
| compare | Function comparing the list elements. |
1.5.1