50 return a_cast_s(
void *, ctx->
head_.next + 1);
52#define A_QUE_FORE_(T, ctx) a_cast_s(T *, a_que_fore_(ctx))
62 return a_cast_s(
void *, ctx->
head_.prev + 1);
64#define A_QUE_BACK_(T, ctx) a_cast_s(T *, a_que_back_(ctx))
76#define A_QUE_FORE(T, ctx) a_cast_s(T *, a_que_fore(ctx))
88#define A_QUE_BACK(T, ctx) a_cast_s(T *, a_que_back(ctx))
100#if defined(__cplusplus)
146#define A_QUE_AT(T, ctx, idx) a_cast_s(T *, a_que_at(ctx, idx))
230#define A_QUE_PUSH_SORT(T, ctx, key, cmp) a_cast_s(T *, a_que_push_sort(ctx, key, cmp))
239#define A_QUE_PUSH_FORE(T, ctx) a_cast_s(T *, a_que_push_fore(ctx))
248#define A_QUE_PUSH_BACK(T, ctx) a_cast_s(T *, a_que_push_back(ctx))
257#define A_QUE_PULL_FORE(T, ctx) a_cast_s(T *, a_que_pull_fore(ctx))
266#define A_QUE_PULL_BACK(T, ctx) a_cast_s(T *, a_que_pull_back(ctx))
278#define A_QUE_INSERT(T, ctx, idx) a_cast_s(T *, a_que_insert(ctx, idx))
290#define A_QUE_REMOVE(T, ctx, idx) a_cast_s(T *, a_que_remove(ctx, idx))
292#if defined(__cplusplus)
309#define a_que_foreach(T, P, it, ctx) \
310 for (T P it = a_cast_r(T P, (ctx)->head_.next), \
311 P it##_ = a_cast_r(T P, a_list_(*, it)->next); \
312 a_list_(*, it) != &(ctx)->head_ \
313 ? ((void)(it = a_cast_r(T P, a_list_(*, it) + 1)), 1) \
315 it = it##_, it##_ = a_cast_r(T P, a_list_(*, it)->next))
330#define a_que_foreach_reverse(T, P, it, ctx) \
331 for (T P it = a_cast_r(T P, (ctx)->head_.prev), \
332 P it##_ = a_cast_r(T P, a_list_(*, it)->prev); \
333 a_list_(*, it) != &(ctx)->head_ \
334 ? ((void)(it = a_cast_r(T P, a_list_(*, it) + 1)), 1) \
336 it = it##_, it##_ = a_cast_r(T P, a_list_(*, it)->prev))
void a_list_swap_node(a_list *lhs, a_list *rhs)
swap the node lhs and the node rhs
Definition list.h:482
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_push_sort(a_que *ctx, void const *key, int(*cmp)(void const *, void const *))
push an element into the queue and sort it
int a_que_swap(a_que const *ctx, size_t lhs, size_t rhs)
swap elements lhs and rhs for a pointer to queue structure
void * a_que_pull_fore(a_que *ctx)
pull an element from the queue forward
void * a_que_push_back(a_que *ctx)
push an element into the queue backward
void * a_que_back_(a_que const *ctx)
access backmost element for a pointer to queue structure
Definition que.h:60
void a_que_move(a_que *ctx, a_que *obj)
initialize a pointer to queue structure by moving
void * a_que_back(a_que const *ctx)
access backmost element for a pointer to queue structure
Definition que.h:84
void a_que_dtor(a_que *ctx, void(*dtor)(void *))
destructor for queue structure
struct a_que a_que
instance structure for basic queue
void a_que_die(a_que *ctx, void(*dtor)(void *))
deallocate a pointer to queue structure
void * a_que_fore(a_que const *ctx)
access foremost element for a pointer to queue structure
Definition que.h:72
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
int a_que_edit(a_que *ctx, size_t size, void(*dtor)(void *))
edit size of a element for a pointer to queue structure
void * a_que_remove(a_que *ctx, size_t idx)
remove an element from the queue
void * a_que_push_fore(a_que *ctx)
push an element into the queue forward
void * a_que_pull_back(a_que *ctx)
pull an element from the queue backward
void * a_que_fore_(a_que const *ctx)
access foremost element for a pointer to queue structure
Definition que.h:48
void * a_que_at(a_que const *ctx, ptrdiff_t idx)
access specified element for a pointer to queue structure
size_t a_que_siz(a_que const *ctx)
access size of a element for a pointer to queue structure
Definition que.h:34
size_t a_que_num(a_que const *ctx)
access number of element for a pointer to queue structure
Definition que.h:40
void a_que_ctor(a_que *ctx, size_t size)
constructor for queue structure
int a_que_drop(a_que *ctx, void(*dtor)(void *))
drop all the elements for a pointer to queue structure
a_que * a_que_new(size_t size)
allocate a pointer to queue structure from memory
void * a_que_insert(a_que *ctx, size_t idx)
insert an element into the queue
void a_que_swap_(void *lhs, void *rhs)
swap elements lhs and rhs for a pointer to queue structure
Definition que.h:95
#define a_size
Definition a.h:610
#define a_diff
Definition a.h:598
circular doubly linked list implementation
instance structure for circular doubly linked list
Definition list.h:25
instance structure for basic queue
Definition que.h:21
size_t cur_
Definition que.h:26
a_list ** ptr_
Definition que.h:23
size_t siz_
Definition que.h:24
a_list head_
Definition que.h:22
size_t num_
Definition que.h:25
size_t mem_
Definition que.h:27