/*------------------------------------------------------------------*/ /* stack.h */ /* Author: Bob Dondero */ /* A Stack ADT interface */ /*------------------------------------------------------------------*/ #ifndef STACK_INCLUDED #define STACK_INCLUDED typedef struct Stack *Stack_T; /* A Stack_T is a last-in-first-out collection of doubles. */ Stack_T Stack_new(void); /* Return a new Stack_T. */ void Stack_free(Stack_T oStack); /* Free oStack. */ void Stack_push(Stack_T oStack, double dItem); /* Push dItem onto oStack. It is a checked runtime error for oStack to be NULL. */ double Stack_pop(Stack_T oStack); /* Pop oStack, and return the popped item. It is a checked runtime error for oStack to be NULL or empty. */ int Stack_isEmpty(Stack_T oStack); /* Return 1 (TRUE) iff oStack is empty. It is a checked runtime error for oStack to be NULL. */ #endif