/*--------------------------------------------------------------------*/ /* stackao.h */ /* Author: Bob Dondero */ /* A Stack abstract object interface */ /*--------------------------------------------------------------------*/ #ifndef STACKAO_INCLUDED #define STACKAO_INCLUDED /* The Stack is a last-in-first-out collection of doubles. */ void Stack_init(void); /* Initialize the Stack. It is a checked runtime error for the Stack to be initialized. */ void Stack_free(void); /* Free the resources consumed by the Stack. It is a checked runtime error for the Stack to be uninitialized. */ void Stack_push(double dItem); /* Push dItem onto the Stack. It is a checked runtime error for the Stack to be uninitialized. */ double Stack_top(void); /* Return the top item of the Stack. It is a checked runtime error for the Stack to be uninitialized or empty. */ void Stack_pop(void); /* Pop the Stack, and discard the popped item. It is a checked runtime error for the Stack to be uninitialized or empty. */ int Stack_isEmpty(void); /* Return 1 (TRUE) iff the Stack is empty. It is a checked runtime error for the Stack to be uninitialized. */ #endif