Functions | |
size_t | cucon_frame_depth (void *frame) |
void * | cucon_frame_push (void *frame, size_t size) |
void * | cucon_frame_pop (void *frame) |
void * | cucon_frame_at (void *frame, size_t depth) |
This implements a stack with constructive operations. The time and space complexity are logarithmic in the number of stack levels.
void* cucon_frame_at | ( | void * | frame, | |
size_t | depth | |||
) |
Equivalent to the composition of depth calls to cucon_frame_pop, except that the time complexity is logarithmic in depth.
size_t cucon_frame_depth | ( | void * | frame | ) |
The depth of frame, where NULL
has depth 0.
void* cucon_frame_pop | ( | void * | frame | ) |
The parent frame of frame, where frame is a pointer which was obtained with cucon_frame_push.
void* cucon_frame_push | ( | void * | frame, | |
size_t | size | |||
) |
Push a subframe of frame with size bytes of data. Pass frame = NULL
to create a top level frame. The returned pointer points into the allocated memory where the user data starts.