32 #include <string.h> |
32 #include <string.h> |
33 #include <assert.h> |
33 #include <assert.h> |
34 |
34 |
35 /* LOW LEVEL LINKED LIST FUNCTIONS */ |
35 /* LOW LEVEL LINKED LIST FUNCTIONS */ |
36 |
36 |
37 #define CX_LL_PTR(cur, off) (*(void**)(((char*)cur)+off)) |
37 #define CX_LL_PTR(cur, off) (*(void**)(((char*)(cur))+(off))) |
38 #define ll_prev(node) CX_LL_PTR(node, loc_prev) |
38 #define ll_prev(node) CX_LL_PTR(node, loc_prev) |
39 #define ll_next(node) CX_LL_PTR(node, loc_next) |
39 #define ll_next(node) CX_LL_PTR(node, loc_next) |
40 #define ll_advance(node) CX_LL_PTR(node, loc_advance) |
40 #define ll_advance(node) CX_LL_PTR(node, loc_advance) |
41 #define ll_data_f(node, follow_ptr) ((follow_ptr)?CX_LL_PTR(node, loc_data):(((char*)node)+loc_data)) |
41 #define ll_data_f(node, follow_ptr) ((follow_ptr)?CX_LL_PTR(node, loc_data):(((char*)(node))+loc_data)) |
42 #define ll_data(node) ll_data_f(node,follow_ptr) |
42 #define ll_data(node) ll_data_f(node,follow_ptr) |
43 |
43 |
44 void *cx_linked_list_at( |
44 void *cx_linked_list_at( |
45 void const *start, |
45 void const *start, |
46 size_t start_index, |
46 size_t start_index, |