C Everything
This is a C repository containing a curated set of generic data structures and algorithm.
|
Contains definitions of routines supported by stack. More...
#include "stack.h"
Go to the source code of this file.
Functions | |
bool | is_stack_full (t_gen d) |
Check stack full More... | |
bool | is_stack_empty (t_gen d) |
Check stack empty More... | |
int | stack_size (t_gen d) |
get stack size More... | |
t_gen | stack_push_arr_up (t_gen d, t_gen data) |
Push an element into up growing stack More... | |
t_gen | stack_pop_arr_up (t_gen d) |
Pop an element from up growing stack More... | |
t_gen | stack_push_arr_down (t_gen d, t_gen data) |
Push an element into down growing stack More... | |
t_gen | stack_pop_arr_down (t_gen d) |
Pop an element from down growing ll stack More... | |
t_gen | stack_push_ll (t_gen d, t_gen data) |
Push an element into a link list based stack More... | |
t_gen | stack_pop_ll (t_gen d) |
Pop an element from a link list based stack More... | |
t_gen | stack_peek (t_gen d, int idx) |
void | stack_print (t_gen d) |
print_stack_info More... | |
void | destroy_stack (t_gen d) |
Destroy instance of the stack More... | |
t_gen | create_stack (char *name, int max_size, e_stacktype stype, t_dparams *prm) |
Create an instance of stack More... | |
Variables | |
f_gen2 | stack_push [] = {stack_push_ll, stack_push_arr_up, stack_push_arr_down} |
Look Up function ptrs for pushing to stack. More... | |
f_gen | stack_pop [] = {stack_pop_ll, stack_pop_arr_up, stack_pop_arr_down} |
Look Up function ptrs for poping to stack. More... | |
Contains definitions of routines supported by stack.
Definition in file stack.c.
t_gen create_stack | ( | char * | name, |
int | max_size, | ||
e_stacktype | stype, | ||
t_dparams * | prm | ||
) |
void destroy_stack | ( | t_gen | d | ) |
bool is_stack_empty | ( | t_gen | d | ) |
bool is_stack_full | ( | t_gen | d | ) |
void stack_print | ( | t_gen | d | ) |
int stack_size | ( | t_gen | d | ) |
f_gen stack_pop[] = {stack_pop_ll, stack_pop_arr_up, stack_pop_arr_down} |
f_gen2 stack_push[] = {stack_push_ll, stack_push_arr_up, stack_push_arr_down} |