/*--------------------------------------------------------------------*/ /* stackao.h */ /* Author: Bob Dondero */ /* A Stack abstract object interface */ /*--------------------------------------------------------------------*/ #ifndef STACKAO_INCLUDED #define STACKAO_INCLUDED /* The Stack object is a last-in-first-out collection of doubles. */ int Stack_init(void); /* Initialize the Stack object. Return 1 (TRUE) if successful, or 0 (FALSE) if insufficient memory is available. */ void Stack_free(void); /* Free the resources consumed by the Stack object, and uninitialize it. */ int Stack_push(double dItem); /* Push dItem onto the Stack object. Return 1 (TRUE) if successful, or 0 (FALSE) is insufficient memory is available. */ double Stack_top(void); /* Return the top item of the Stack object. */ void Stack_pop(void); /* Pop and discard the top item of the Stack object. */ int Stack_isEmpty(void); /* Return 1 (TRUE) if the Stack object is empty, or 0 (FALSE) otherwise. */ #endif