/*-------------------------------------------------------------------*/ /* stack.h (Version 3: Data Modules) */ /*-------------------------------------------------------------------*/ #ifndef STACK_INCLUDED #define STACK_INCLUDED extern void Stack_new(int iMaxSize); /* Create a new Stack that is able to store iMaxSize items, each of type double. */ extern void Stack_free(); /* Free the Stack. */ extern void Stack_push(double dItem); /* Push dItem onto the Stack. */ extern double Stack_pop(); /* Pop the Stack, and return the popped item. */ extern int Stack_empty(); /* Return 1 (TRUE) iff the Stack is empty. */ extern int Stack_full(); /* Return 1 (TRUE) iff the Stack is full. */ /* Checked runtime errors: Call Stack_new with iMaxSize <= 0. Call Stack_push with *psStack full. Call Stack_pop with *psStack empty. */ #endif