Go to the documentation of this file.
31 #define CIRC_LIST(name, type) \
40 #define CIRC_LIST_PUSH(obj, item) \
42 (obj)->x_head = modulo_add((obj)->x_head, -1, (obj)->x_cap); \
43 (obj)->x_list[(obj)->x_head] = (item); \
44 (obj)->x_size = min_int((obj)->x_size + 1, (obj)->x_cap); \
47 #define CIRC_LIST_SIZE(obj) \
50 #define CIRC_LIST_INDEX(obj, index) \
51 modulo_add((obj)->x_head, \
52 index_verify((index), (obj)->x_size, __FILE__, __LINE__), \
55 #define CIRC_LIST_ITEM(obj, index) \
56 ((obj)->x_list[CIRC_LIST_INDEX((obj), (index))])
58 #define CIRC_LIST_RESET(obj) \
64 #define CIRC_LIST_ALLOC(dest, list_type, size) \
66 const int so = sizeof(list_type) + sizeof((dest)->x_list[0]) * (size); \
67 (dest) = (list_type *) malloc(so); \
68 check_malloc_return(dest); \
69 memset((dest), 0, so); \
70 (dest)->x_cap = size; \
71 (dest)->x_sizeof = so; \
74 #define CIRC_LIST_FREE(dest) \