regfi
|
This is a very simple implementation of a stack which stores chunks of memory of any type. More...
Go to the source code of this file.
Data Structures | |
struct | void_stack |
XXX: document this. More... | |
struct | void_stack_iterator |
XXX: document this. More... | |
Functions | |
void_stack * | void_stack_new (unsigned short max_size) |
Allocates a new void_stack. More... | |
void_stack * | void_stack_copy (const void_stack *v) |
Makes a shallow copy of void_stack. More... | |
void_stack * | void_stack_copy_reverse (const void_stack *v) |
Makes a shallow copy of void_stack in reverse order. More... | |
void | void_stack_free (void_stack *stack) |
Frees the memory associated with a void_stack, but not the elements held on the stack. More... | |
void | void_stack_free_deep (void_stack *stack) |
Frees the memory associated with a void_stack and the elements referenced by the stack. More... | |
unsigned short | void_stack_size (const void_stack *stack) |
Query the current number of elements on a void_stack() More... | |
void * | void_stack_pop (void_stack *stack) |
Removes the top element on a void_stack and returns a reference to it. More... | |
bool | void_stack_push (void_stack *stack, void *e) |
Puts a new element on the top of a void_stack. More... | |
const void * | void_stack_cur (const void_stack *stack) |
Returns a pointer to the current element on the top of the stack. More... | |
void_stack_iterator * | void_stack_iterator_new (const void_stack *stack) |
Creates a new iterator for the specified void_stack. More... | |
void | void_stack_iterator_free (void_stack_iterator *iter) |
Frees a void_stack_iterator. More... | |
const void * | void_stack_iterator_next (void_stack_iterator *iter) |
Returns a pointer to the the next element in the stack. More... | |
This is a very simple implementation of a stack which stores chunks of memory of any type.
void_stack* void_stack_new | ( | unsigned short | max_size | ) |
Allocates a new void_stack.
max_size | the maxiumum number of elements which may be pushed onto the stack. |
Referenced by regfi_iterator_new(), void_stack_copy(), and void_stack_copy_reverse().
void_stack* void_stack_copy | ( | const void_stack * | v | ) |
Makes a shallow copy of void_stack.
v | the stack to make a copy of. |
References void_stack_new().
void_stack* void_stack_copy_reverse | ( | const void_stack * | v | ) |
Makes a shallow copy of void_stack in reverse order.
v | the stack to make a copy of. |
References void_stack_new().
void void_stack_free | ( | void_stack * | stack | ) |
Frees the memory associated with a void_stack, but not the elements held on the stack.
stack | the stack to be free()d. |
void void_stack_free_deep | ( | void_stack * | stack | ) |
Frees the memory associated with a void_stack and the elements referenced by the stack.
Do not use this function if the elements of the stack are also free()d elsewhere, or contain pointers to other memory which cannot be otherwise free()d.
stack | the stack to be free()d. |
unsigned short void_stack_size | ( | const void_stack * | stack | ) |
Query the current number of elements on a void_stack()
stack | the void_stack to query |
Referenced by regfi_iterator_ancestry().
void* void_stack_pop | ( | void_stack * | stack | ) |
Removes the top element on a void_stack and returns a reference to it.
stack | the void_stack to pop |
Referenced by regfi_iterator_up().
bool void_stack_push | ( | void_stack * | stack, |
void * | e | ||
) |
Puts a new element on the top of a void_stack.
stack | the void_stack being modified. |
e | the element to be added |
Referenced by regfi_iterator_down().
const void* void_stack_cur | ( | const void_stack * | stack | ) |
Returns a pointer to the current element on the top of the stack.
stack | the void_stack being queried. |
void_stack_iterator* void_stack_iterator_new | ( | const void_stack * | stack | ) |
Creates a new iterator for the specified void_stack.
stack | the void_stack to be referenced by the new iterator |
Referenced by regfi_iterator_ancestry().
void void_stack_iterator_free | ( | void_stack_iterator * | iter | ) |
Frees a void_stack_iterator.
Does not affect the void_stack referenced by the iterator.
iter | the void_stack_iterator to be free()d. |
Referenced by regfi_iterator_ancestry().
const void* void_stack_iterator_next | ( | void_stack_iterator * | iter | ) |
Returns a pointer to the the next element in the stack.
Iterates over elements starting in order from the oldest element (bottom of the stack).
iter | the void_stack_iterator used to lookup the next element. |
Referenced by regfi_iterator_ancestry().