#include <stddef.h>
#include <parserutils/errors.h>
#include <parserutils/functypes.h>
Go to the source code of this file.
◆ parserutils_stack
◆ parserutils_stack_create()
Create a stack
- Parameters
-
| item_size | Length, in bytes, of an item in the stack |
| chunk_size | Number of stack slots in a chunk |
| stack | Pointer to location to receive stack instance |
- Returns
- PARSERUTILS_OK on success, PARSERUTILS_BADPARM on bad parameters PARSERUTILS_NOMEM on memory exhaustion
◆ parserutils_stack_destroy()
Destroy a stack instance
- Parameters
-
| stack | The stack to destroy |
- Returns
- PARSERUTILS_OK on success, appropriate error otherwise.
◆ parserutils_stack_get_current()
Retrieve a pointer to the current item on the stack
- Parameters
-
| stack | The stack to inspect |
- Returns
- Pointer to item on stack, or NULL if none
◆ parserutils_stack_pop()
Pop an item off a stack
- Parameters
-
| stack | The stack to pop from |
| item | Pointer to location to receive popped item, or NULL |
- Returns
- PARSERUTILS_OK on success, appropriate error otherwise.
◆ parserutils_stack_push()
Push an item onto the stack
- Parameters
-
| stack | The stack to push onto |
| item | The item to push |
- Returns
- PARSERUTILS_OK on success, appropriate error otherwise