stack.h File Reference

#include <dbLkList.h>

Include dependency graph for stack.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _Stack_
 this is the stack structure, its just a double linked list we insert tail and remove tail. More...

Typedefs

typedef StackStackP
 function pointers
typedef void() StDestroyFunction (StackP st, void *object)
typedef _Stack_ Stack
 this is the stack structure, its just a double linked list we insert tail and remove tail.

Enumerations

enum  StDestroyMode { ST_DM_KEEP = 0, ST_DM_FREE }

Functions

StackstCreate ()
 creates an empty stack return the stack created
void stDestroy (Stack **stackAddress, StDestroyMode mode)
 destroys the stack, mode defines if objects will be destroyed too
int stPush (Stack *st, void *object)
 inserts an element to the stack
int stPop (Stack *st, void **objectAddress)
 fill object with the top of the stack, which is removed
int stGetTop (Stack *st, void **objectAddress)
 get stack top, but does not remove it
int stNumElements (Stack *st)
 returns the number of elements in the stack
int stRegisterDestroyFunction (Stack *st, StDestroyFunction *destroyFunction)
 register functions


Typedef Documentation

typedef struct _Stack_ Stack
 

this is the stack structure, its just a double linked list we insert tail and remove tail.

typedef struct Stack* StackP
 

function pointers

Definition at line 7 of file stack.h.

typedef void() StDestroyFunction(StackP st, void *object)
 

Definition at line 8 of file stack.h.


Enumeration Type Documentation

enum StDestroyMode
 

Enumerator:
ST_DM_KEEP 
ST_DM_FREE 

Definition at line 21 of file stack.h.


Function Documentation

Stack* stCreate  ) 
 

creates an empty stack return the stack created

Definition at line 5 of file stack.c.

References _Stack_::destroyFunction, _Stack_::elements, and listCreate().

Referenced by trcCreateData().

Here is the call graph for this function:

void stDestroy Stack **  stackAddress,
StDestroyMode  mode
 

destroys the stack, mode defines if objects will be destroyed too

Parameters:
stackAddress the address of the stack, which will be freed and NULLed
mode how we destroy the stack

Definition at line 13 of file stack.c.

References DBLIST_DM_KEEP, DBLIST_TM_FROM_HEAD, _Stack_::destroyFunction, _Stack_::elements, listDestroy(), listGetNext(), listPrepare(), and ST_DM_KEEP.

Here is the call graph for this function:

int stGetTop Stack st,
void **  objectAddress
 

get stack top, but does not remove it

Definition at line 42 of file stack.c.

References _Stack_::elements, and listGetTail().

Here is the call graph for this function:

int stNumElements Stack st  ) 
 

returns the number of elements in the stack

Definition at line 46 of file stack.c.

References _Stack_::elements, and _DbLkList::numElements.

int stPop Stack st,
void **  objectAddress
 

fill object with the top of the stack, which is removed

Definition at line 38 of file stack.c.

References _Stack_::elements, and listRemoveTail().

Referenced by instLeaveState(), and trcLeaveState().

Here is the call graph for this function:

int stPush Stack st,
void *  object
 

inserts an element to the stack

Definition at line 34 of file stack.c.

References _Stack_::elements, and listInsertTail().

Referenced by instEnterState().

Here is the call graph for this function:

int stRegisterDestroyFunction Stack st,
StDestroyFunction destroyFunction
 

register functions

Definition at line 50 of file stack.c.

References _Stack_::destroyFunction.


Generated on Tue Jan 17 19:25:57 2006 for Void by  doxygen 1.4.6