This is a simple stack structure with supporting push, pop, and peek functions.
More...
|
#define | OSRTISTK_DEFAULT_CAPACITY 100 |
| This is the default capacity that is used if zero is passed as the capacity argument to rtxIntStackInit.
|
|
#define | rtxIntStackIsEmpty(stack) (OSBOOL)((stack).index == 0) |
| This macro tests if the stack is empty. More...
|
|
This is a simple stack structure with supporting push, pop, and peek functions.
◆ rtxIntStackIsEmpty
#define rtxIntStackIsEmpty |
( |
|
stack | ) |
(OSBOOL)((stack).index == 0) |
This macro tests if the stack is empty.
- Parameters
-
stack | Stack structure variable to be tested. |
Definition at line 122 of file rtxIntStack.h.
◆ rtxIntStackInit()
This function initializes a stack structure.
It allocates the initial amount of memory required to store data and sets all working variables to their initil state.
- Parameters
-
pctxt | A pointer to the context with which the stack is associated. |
pstack | A pointer to a stack structure to be initialized. |
capacity | Initial capacity of the stack. This is the number of integer values that can be stored before the stack is expanded. Each expansion doubles the initial capacity value. |
- Returns
- Completion status of operation:
- 0 (0) = success,
- negative return value is error.
◆ rtxIntStackPeek()
EXTERNRT int rtxIntStackPeek |
( |
OSRTIntStack * |
pstack, |
|
|
OSINT32 * |
pvalue |
|
) |
| |
This functions returns the data item on the top of the stack.
- Parameters
-
pstack | A pointer to the stack structure. |
pvalue | A pointer to a variable to store the integer value of the item at the top of the stack. |
- Returns
- Status of peek operation:
- 0 (0) = success,
- RTERR_ENDOFBUF if stack is empty
◆ rtxIntStackPop()
EXTERNRT int rtxIntStackPop |
( |
OSRTIntStack * |
pstack, |
|
|
OSINT32 * |
pvalue |
|
) |
| |
This functions pops the data item on the top of the stack.
- Parameters
-
pstack | A pointer to the stack structure. |
pvalue | A pointer to a variable to store the integer value of the item at the top of the stack. |
- Returns
- Status of pop operation:
- 0 (0) = success,
- RTERR_ENDOFBUF if stack is empty
◆ rtxIntStackPush()
EXTERNRT int rtxIntStackPush |
( |
OSRTIntStack * |
pstack, |
|
|
OSINT32 |
value |
|
) |
| |
This function pushes an item onto the stack.
- Parameters
-
pstack | A pointer to the stack structure. |
value | A pointer to the data item to be pushed on the stack. |
- Returns
- Completion status of operation:
- 0 (0) = success,
- negative return value is error.