/* Stack header file -- for pushing and popping generic data from a stack */ #include "jval.h" typedef void *Stack; extern Stack new_stack(); /* allocates an empty stack. */ extern void stack_push(Stack s, Jval jv); /* pushes a new piece of data onto the stack */ extern Jval stack_pop(Stack s); /* pops a value off the stack and returns it */ extern void free_stack(Stack s); /* destroy the stack and free memory */ extern Jval stack_top(Stack s); /* return the top value on the stack without popping it */ extern int stack_empty(Stack s); /* return 1 if there are no elements on the stack and 0 otherwise. */ extern int stack_size(Stack s); /* return the number of elements on the stack */