/*-------------------------------------------------------------------*/ /* stack.h (Version 2: Function Modules) */ /*-------------------------------------------------------------------*/ #ifndef STACK_INCLUDED #define STACK_INCLUDED extern void Stack_push(double pdStackArray[], int *piStackTop, int iMaxStackSize, double dItem); /* Push dItem onto the top of the stack represented by pdStackArray and piStackTop. iMaxStackSize indicates the maximum number of items that the stack can contain. */ extern double Stack_pop(double pdStackArray[], int *piStackTop); /* Pop and return the top item from the stack represented by pdStackArray and piStackTop. */ /* Checked runtime errors: Call any function with pdStackArray = NULL. Call any function with piStackTop == NULL. Call any function with *piStackTop < 0. Call any function with *piStackTop > iMaxStackSize. Call Stack_push with *piStackTop == iMaxStackSize. Call Stack_pop with *piStackTop == 0. */ #endif