cucon/frame.h: Constructive Stack
[Linear Containers (lists, stacks, arrays)]


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)

Detailed Description

This implements a stack with constructive operations. The time and space complexity are logarithmic in the number of stack levels.

See also:
cucon/stack.h: Stacks of Memory

Function Documentation

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.

Generated 2009-11-23 for culibs-0.25 using Doxygen. Maintained by Petter Urkedal.