GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > XLX / V6-4-1

Constituent: parser     Tag: sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

stack.c File Reference

Stack manipulation functions. More...

#include "XLX/stack.h"
#include "XLX/XLX_msgs.h"
#include "MSG/MSG_pubdefs.h"
#include "PBS/MBA.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>

Include dependency graph for stack.c:

Include dependency graph

Functions

unsigned XLX_initStack (XLX_stack *this, unsigned limit)
 Initialise a stack by allocating memory to hold the contents and setting limit and used.

void XLX_endStack (XLX_stack *this)
 Free the memory allocated to the stack.

void XLX_destroyStack (XLX_stack *this, XLX_pDelete dFn)
 Free the memory allocated to the stack.

unsigned XLX_push (XLX_stack *this, void *ptr)
 Put a new item on the top of the stack and increment the counter, doubling the size of the stack if the stack is already full.

void * XLX_pop (XLX_stack *this)
 Remove and return the top item on the stack.

void * XLX_peek (XLX_stack *this)
 Look at the item on the top of the stack without removing it.

void XLX_dump (XLX_stack *this)
 Print out the stack information.


Detailed Description

Stack manipulation functions.

Author:
James Swain -- jswain@slac.stanford.edu
history : 12 Nov 2004 : Added history block

Function Documentation

void XLX_destroyStack XLX_stack this,
XLX_pDelete  dFn
 

Free the memory allocated to the stack.

Parameters:
this Stack to end
dFn Function to call to delete objects on the stack

Here is the call graph for this function:

void XLX_dump XLX_stack this  ) 
 

Print out the stack information.

Parameters:
this Stack to dump

void XLX_endStack XLX_stack this  ) 
 

Free the memory allocated to the stack.

Parameters:
this Stack to end

unsigned XLX_initStack XLX_stack this,
unsigned  limit
 

Initialise a stack by allocating memory to hold the contents and setting limit and used.

Parameters:
this Stack to initialise
limit Size of the stack
Returns:
One of XLX_msgs, XLX_SUCCESS if all goes well

void * XLX_peek XLX_stack this  ) 
 

Look at the item on the top of the stack without removing it.

Parameters:
this Stack to peek at
Returns:
Item on the top of the stack

void * XLX_pop XLX_stack this  ) 
 

Remove and return the top item on the stack.

Parameters:
this Stack to pop item off
Returns:
Item popped off the top of the stack

unsigned XLX_push XLX_stack this,
void *  ptr
 

Put a new item on the top of the stack and increment the counter, doubling the size of the stack if the stack is already full.

Parameters:
this Stack to push ptr onto
ptr Pointer to push onto stack
Returns:
One of XLX_msgs, XLX_SUCCESS if all goes well.


Generated on Wed Aug 3 21:14:29 2005 by doxygen 1.3.3