GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> XLX / V10-0-3 > parser / rhel6-64
#include <XLX_p.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
Functions | |
| int | XLX_initStack (XLX_stack *stack, unsigned int limit) |
| Initialise a stack. | |
| void | XLX_endStack (XLX_stack *stack) |
| Free the memory allocated to a stack. | |
| void | XLX_destroyStack (XLX_stack *stack, XLX_pDelete dFn) |
| Free the memory allocated to a stack and its elements. | |
| int | XLX_push (XLX_stack *stack, void *ptr) |
| Put a new item on the top of a stack. | |
| void * | XLX_pop (XLX_stack *stack) |
| Remove and return the top item on a stack. | |
| void * | XLX_peek (XLX_stack *stack, unsigned int depth) |
| Look at an item on a stack without removing it. | |
| void | XLX_dump (XLX_stack *stack) |
| Print out the stack information. | |
| void XLX_destroyStack | ( | XLX_stack * | stack, | |
| XLX_pDelete | dFn | |||
| ) |
Free the memory allocated to a stack and its elements.
| stack | Stack to end | |
| dFn | Function to call to delete objects on the stack |
References XLX_endStack(), and XLX_pop().
| void XLX_dump | ( | XLX_stack * | stack | ) |
Print out the stack information.
| stack | Stack to dump |
References _XLX_stack::base, _XLX_stack::limit, and _XLX_stack::used.
| void XLX_endStack | ( | XLX_stack * | stack | ) |
Free the memory allocated to a stack.
| stack | Stack to free |
References _XLX_stack::base, _XLX_stack::limit, and _XLX_stack::used.
Referenced by XLX_destroyStack().
| int XLX_initStack | ( | XLX_stack * | stack, | |
| unsigned int | limit | |||
| ) |
Initialise a stack.
This routine allocates memory to hold the stack contents and sets the limit and used values.
| stack | Stack to initialise | |
| limit | Size of the stack |
| 0 | If the stack was successfully initialised | |
| -1 | If there was an error allocating memory for the stack |
References _XLX_stack::base, _XLX_stack::limit, and _XLX_stack::used.
Referenced by XLX_initState().
| void* XLX_peek | ( | XLX_stack * | stack, | |
| unsigned int | depth | |||
| ) |
Look at an item on a stack without removing it.
| stack | Stack to peek at | |
| depth | Depth from the top of the stack of item to peek at |
References _XLX_stack::base, and _XLX_stack::used.
Referenced by XLX_character(), XLX_character_tag(), and XLX_start().
| void* XLX_pop | ( | XLX_stack * | stack | ) |
Remove and return the top item on a stack.
| stack | Stack to pop item off |
References _XLX_stack::base, and _XLX_stack::used.
Referenced by XLX_character_tag(), XLX_destroyStack(), and XLX_end().
| int XLX_push | ( | XLX_stack * | stack, | |
| void * | ptr | |||
| ) |
Put a new item on the top of a stack.
If the stack is already full, its size is doubled.
| stack | Stack to push item onto | |
| ptr | Pointer to push onto stack |
| 0 | If the item is added successfully | |
| -1 | If the stack needs to be extended to accomodate the new item and the memory allocation failed |
References _XLX_stack::base, _XLX_stack::limit, and _XLX_stack::used.
Referenced by XLX_character_tag(), XLX_initState(), and XLX_start().
1.5.8