#ifndef _STACK_H #define _STACK_H #include "data.h" // helpful #defines #include "list.h" // stack relies on list to work // (which relies on node) struct stack { List *data; // pointer to list containing data Node *top; // pointer to node at top of stack uli size; // maximum stack size (0 implies }; // an unbounded stack) typedef struct stack Stack; // because we deserve nice things code_t mkstack(Stack **, uli); // create new stack (of max size) code_t cpstack(Stack *, Stack **); // create a copy of an existing stack code_t rmstack(Stack **); // clear and de-allocate an existing stack code_t push(Stack **, Node * ); // put new node on top of stack code_t pop (Stack **, Node **); // get (and disconnect) top node off stack code_t peek(Stack *, Node **); // get (don't disconnect) top node code_t isempty(Stack *); // determine if the stack is empty or not #endif