#include <apr_pools.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 | bs_stack |
Functions | |
bs_stack * | new_stack (apr_pool_t *mp) |
void | delete_stack (bs_stack *stack) |
void | stack_push (bs_stack *stack, void *data) |
void * | stack_pop (bs_stack *stack) |
void * | stack_top (const bs_stack *stack) |
int | stack_empty (const bs_stack *stack) |
void * | stack_index (const bs_stack *stack, unsigned index) |
unsigned | stack_size (const bs_stack *stack) |
void delete_stack | ( | bs_stack * | stack | ) |
Delete the given stack. Also destroy its memory pool.
stack | Stack to delete |
Definition at line 64 of file stack.c.
References bs_stack::pool.
bs_stack* new_stack | ( | apr_pool_t * | mp | ) |
Create a new stack from the given memory pool.
mp | Memory pool to allocate from |
Definition at line 43 of file stack.c.
References bs_stack::allocated, bs_stack::data, INITIAL_STACK_SIZE, bs_stack::pool, pool, runtestsuite::rv, and bs_stack::size.
int stack_empty | ( | const bs_stack * | stack | ) |
Determine if the stack is empty or not
stack | Stack to examine |
Definition at line 113 of file stack.c.
References bs_stack::size.
void* stack_index | ( | const bs_stack * | stack, | |
unsigned | index | |||
) |
Random access to the stack.
stack | Stack to get index from index Index of the element to retrieve |
Definition at line 120 of file stack.c.
References bs_stack::data.
void* stack_pop | ( | bs_stack * | stack | ) |
Pop the top element from the stack.
stack | Stack to pop from |
Definition at line 91 of file stack.c.
References bs_stack::size, and stack_top().
Here is the call graph for this function:
void stack_push | ( | bs_stack * | stack, | |
void * | data | |||
) |
Push a data object on the stack.
Definition at line 74 of file stack.c.
References bs_stack::allocated, bs_stack::data, bs_stack::pool, pool_realloc(), and bs_stack::size.
Here is the call graph for this function:
unsigned stack_size | ( | const bs_stack * | stack | ) | [inline] |
Returns the size of the stack.
stack | The stack to get the size from. |
Definition at line 127 of file stack.c.
References bs_stack::size.
void* stack_top | ( | const bs_stack * | stack | ) |
Get the top element from the stack.
stack | Stack to retrieve top element from |
Definition at line 105 of file stack.c.
References bs_stack::data, and bs_stack::size.
Referenced by stack_pop().