diff options
Diffstat (limited to 'lib/stack.h')
-rw-r--r-- | lib/stack.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/stack.h b/lib/stack.h new file mode 100644 index 0000000..a354ab5 --- /dev/null +++ b/lib/stack.h @@ -0,0 +1,26 @@ + +#pragma once + +#include <inttypes.h> +#include <stdbool.h> +#include <stdlib.h> +#include <string.h> + +#include "types.h" + +typedef struct ll_tag { + v_t x; + struct ll_tag *next; +} ll_t; + +typedef struct dll_tag { + double x; + struct dll_tag *next; +} dll_t; + +void stack_push(ll_t **q, v_t x); +void stack_push_d(dll_t **q, double x); + +v_t stack_pop(ll_t **q); +double stack_pop_d(dll_t **q); + |