|
liba 0.1.15
An algorithm library based on C/C++
|
Data Structures | |
| struct | a_que |
| instance structure for basic queue More... | |
Macros | |
| #define | A_QUE_FORE_(T, ctx) |
| #define | A_QUE_BACK_(T, ctx) |
| #define | A_QUE_FORE(T, ctx) |
| #define | A_QUE_BACK(T, ctx) |
| #define | A_QUE_AT(T, ctx, idx) |
| #define | A_QUE_PUSH_SORT(T, ctx, key, cmp) |
| #define | A_QUE_PUSH_FORE(T, ctx) |
| #define | A_QUE_PUSH_BACK(T, ctx) |
| #define | A_QUE_PULL_FORE(T, ctx) |
| #define | A_QUE_PULL_BACK(T, ctx) |
| #define | A_QUE_INSERT(T, ctx, idx) |
| #define | A_QUE_REMOVE(T, ctx, idx) |
| #define | a_que_foreach(T, S, it, ctx) |
| iterate over a queue | |
| #define | A_QUE_FOREACH(T, it, at, ctx) |
| #define | a_que_foreach_reverse(T, S, it, ctx) |
| iterate over a queue in reverse | |
| #define | A_QUE_FOREACH_REVERSE(T, it, at, ctx) |
Typedefs | |
| typedef struct a_que | a_que |
| instance structure for basic queue | |
Functions | |
| a_size | a_que_siz (a_que const *ctx) |
| access size of a element for a pointer to queue structure | |
| a_size | a_que_num (a_que const *ctx) |
| access number of element for a pointer to queue structure | |
| void * | a_que_fore_ (a_que const *ctx) |
| access foremost element for a pointer to queue structure | |
| void * | a_que_back_ (a_que const *ctx) |
| access backmost element for a pointer to queue structure | |
| void * | a_que_fore (a_que const *ctx) |
| access foremost element for a pointer to queue structure | |
| void * | a_que_back (a_que const *ctx) |
| access backmost element for a pointer to queue structure | |
| void | a_que_swap_ (void *lhs, void *rhs) |
| swap elements lhs and rhs for a pointer to queue structure | |
| a_que * | a_que_new (a_size size) |
| allocate a pointer to queue structure from memory | |
| void | a_que_die (a_que *ctx, void(*dtor)(void *)) |
| deallocate a pointer to queue structure | |
| void | a_que_ctor (a_que *ctx, a_size size) |
| constructor for queue structure | |
| void | a_que_dtor (a_que *ctx, void(*dtor)(void *)) |
| destructor for queue structure | |
| void | a_que_swap (a_que *lhs, a_que *rhs) |
| initialize a pointer to queue structure by moving | |
| int | a_que_drop (a_que *ctx, void(*dtor)(void *)) |
| drop all the elements for a pointer to queue structure | |
| int | a_que_setz (a_que *ctx, a_size siz, void(*dtor)(void *)) |
| set size of a element for a pointer to queue structure | |
| void * | a_que_at (a_que const *ctx, a_diff idx) |
| access specified element for a pointer to queue structure | |
| void | a_que_sort_fore (a_que const *ctx, int(*cmp)(void const *, void const *)) |
| insert sort foremost element for a pointer to queue structure | |
| void | a_que_sort_back (a_que const *ctx, int(*cmp)(void const *, void const *)) |
| insert sort backmost element for a pointer to queue structure | |
| void * | a_que_push_sort (a_que *ctx, void const *key, int(*cmp)(void const *, void const *)) |
| push an element into the queue and sort it | |
| void * | a_que_push_fore (a_que *ctx) |
| push an element into the queue forward | |
| void * | a_que_push_back (a_que *ctx) |
| push an element into the queue backward | |
| void * | a_que_pull_fore (a_que *ctx) |
| pull an element from the queue forward | |
| void * | a_que_pull_back (a_que *ctx) |
| pull an element from the queue backward | |
| void * | a_que_insert (a_que *ctx, a_size idx) |
| insert an element into the queue | |
| void * | a_que_remove (a_que *ctx, a_size idx) |
| remove an element from the queue | |
| #define A_QUE_AT | ( | T, | |
| ctx, | |||
| idx ) |
| #define A_QUE_BACK | ( | T, | |
| ctx ) |
| #define A_QUE_BACK_ | ( | T, | |
| ctx ) |
| #define A_QUE_FORE | ( | T, | |
| ctx ) |
| #define A_QUE_FORE_ | ( | T, | |
| ctx ) |
| #define A_QUE_FOREACH | ( | T, | |
| it, | |||
| at, | |||
| ctx ) |
| #define a_que_foreach | ( | T, | |
| S, | |||
| it, | |||
| ctx ) |
iterate over a queue
| T | the prefix of the element type |
| S | the suffix of the element type |
| it | the &a_que to use as a loop counter |
| ctx | points to an instance of queue structure |
| #define A_QUE_FOREACH_REVERSE | ( | T, | |
| it, | |||
| at, | |||
| ctx ) |
| #define a_que_foreach_reverse | ( | T, | |
| S, | |||
| it, | |||
| ctx ) |
iterate over a queue in reverse
| T | the prefix of the element type |
| S | the suffix of the element type |
| it | the &a_que to use as a loop counter |
| ctx | points to an instance of queue structure |
| #define A_QUE_INSERT | ( | T, | |
| ctx, | |||
| idx ) |
| #define A_QUE_PULL_BACK | ( | T, | |
| ctx ) |
| #define A_QUE_PULL_FORE | ( | T, | |
| ctx ) |
| #define A_QUE_PUSH_BACK | ( | T, | |
| ctx ) |
| #define A_QUE_PUSH_FORE | ( | T, | |
| ctx ) |
| #define A_QUE_PUSH_SORT | ( | T, | |
| ctx, | |||
| key, | |||
| cmp ) |
| #define A_QUE_REMOVE | ( | T, | |
| ctx, | |||
| idx ) |
access specified element for a pointer to queue structure
| [in] | ctx | points to an instance of queue structure |
| [in] | idx | index of element, 0 ~ n-1, -n ~ -1 |
| 0 | out of bounds |
| void * a_que_back | ( | a_que const * | ctx | ) |
access backmost element for a pointer to queue structure
| [in] | ctx | points to an instance of queue structure |
| 0 | empty queue |
| void * a_que_back_ | ( | a_que const * | ctx | ) |
access backmost element for a pointer to queue structure
| [in] | ctx | points to an instance of queue structure |
constructor for queue structure
| [in] | ctx | points to an instance of queue structure |
| [in] | size | size of element |
| void a_que_die | ( | a_que * | ctx, |
| void(* | dtor )(void *) ) |
deallocate a pointer to queue structure
| [in] | ctx | points to an instance of queue structure |
| [in] | dtor | element destructor |
| int a_que_drop | ( | a_que * | ctx, |
| void(* | dtor )(void *) ) |
drop all the elements for a pointer to queue structure
| [in] | ctx | points to an instance of queue structure |
| [in] | dtor | current element destructor |
| 0 | success |
| void a_que_dtor | ( | a_que * | ctx, |
| void(* | dtor )(void *) ) |
destructor for queue structure
| [in] | ctx | points to an instance of queue structure |
| [in] | dtor | element destructor |
| void * a_que_fore | ( | a_que const * | ctx | ) |
access foremost element for a pointer to queue structure
| [in] | ctx | points to an instance of queue structure |
| 0 | empty queue |
| void * a_que_fore_ | ( | a_que const * | ctx | ) |
access foremost element for a pointer to queue structure
| [in] | ctx | points to an instance of queue structure |
insert an element into the queue
| [in] | ctx | points to an instance of queue structure |
| [in] | idx | index of element in this queue
|
| 0 | failure |
allocate a pointer to queue structure from memory
| [in] | size | size of element |
access number of element for a pointer to queue structure
| [in] | ctx | points to an instance of queue structure |
| void * a_que_pull_back | ( | a_que * | ctx | ) |
pull an element from the queue backward
| [in] | ctx | points to an instance of queue structure |
| 0 | failure |
| void * a_que_pull_fore | ( | a_que * | ctx | ) |
pull an element from the queue forward
| [in] | ctx | points to an instance of queue structure |
| 0 | failure |
| void * a_que_push_back | ( | a_que * | ctx | ) |
push an element into the queue backward
| [in] | ctx | points to an instance of queue structure |
| 0 | failure |
| void * a_que_push_fore | ( | a_que * | ctx | ) |
push an element into the queue forward
| [in] | ctx | points to an instance of queue structure |
| 0 | failure |
| void * a_que_push_sort | ( | a_que * | ctx, |
| void const * | key, | ||
| int(* | cmp )(void const *, void const *) ) |
push an element into the queue and sort it
| [in] | ctx | points to an instance of queue structure |
| [in] | key | the key on the right for insertion sort |
| [in] | cmp | a function that compares two elements
|
| 0 | failure |
remove an element from the queue
| [in] | ctx | points to an instance of queue structure |
| [in] | idx | index of element in this queue
|
| 0 | failure |
set size of a element for a pointer to queue structure
| [in] | ctx | points to an instance of queue structure |
| [in] | siz | the size of the new element |
| [in] | dtor | previous element destructor |
| 0 | success |
access size of a element for a pointer to queue structure
| [in] | ctx | points to an instance of queue structure |
| void a_que_sort_back | ( | a_que const * | ctx, |
| int(* | cmp )(void const *, void const *) ) |
insert sort backmost element for a pointer to queue structure
| [in] | ctx | points to an instance of queue structure |
| [in] | cmp | a function that compares two elements
|
| void a_que_sort_fore | ( | a_que const * | ctx, |
| int(* | cmp )(void const *, void const *) ) |
insert sort foremost element for a pointer to queue structure
| [in] | ctx | points to an instance of queue structure |
| [in] | cmp | a function that compares two elements
|
initialize a pointer to queue structure by moving
| [in] | lhs | points to an instance of queue structure |
| [in] | rhs | points to an instance of queue structure |
| void a_que_swap_ | ( | void * | lhs, |
| void * | rhs ) |
swap elements lhs and rhs for a pointer to queue structure
| [in] | lhs | element pointer on the left |
| [in] | rhs | element pointer on the right |