Go to the documentation of this file.
29 if(stack->
size) free(stack);
32 for(aux1=stack->
top;aux1;)
68 if(value) *value=NULL;
109 if(!stack->
size) result=1;
112 for(aux=stack->
top;aux;aux=aux->
next)
128 for(aux=stack->
top,ctrl=0;aux&&!ctrl;aux=aux->
next)
int stackSize(Stack stack)
Returns the size of a stack.
int stackPop(Stack stack, void **value)
Removes an elements from the top of a stack.
int stackMap(Stack stack, void(*fun)(void *))
Applies a function to the elements of a stack.
struct sStackNode * next
Next node.
void itDelete(Iterator it)
Deletes an iterator.
int itAdd(Iterator it, void *val)
Adds an element to an iterator.
void stackDelete(Stack stack)
Deletes a stack.
Stack newStack(void)
Creates a stack.
void * value
Node's value.
int stackPush(Stack stack, void *value)
Inserts an element at the top of the stack.
Iterator stackIterator(Stack stack)
Creates an iterator from a stack.
StackNode top
Top node of this stack.
int stackTop(Stack stack, void **value)
Provides the value of the element at the top of a stack.
Implementation of a stack as a linked list.
Iterator newIt(int size)
Creates an iterator.
int size
Number of values of this stack.
LibRCG © 2004-2015
Rui Carlos Gonçalves