/*------------------------------------------------------------------*/ /* stackadt.h: A Stack ADT */ /*------------------------------------------------------------------*/ #ifndef STACKADT_INCLUDED #define STACKADT_INCLUDED typedef struct Stack *Stack_T; /* A Stack is a last-in-first-out collection of integers. */ Stack_T Stack_new(void); /* Return a new Stack_T. */ void Stack_free(Stack_T oStack); /* Free oStack. */ void Stack_push(Stack_T oStack, int iItem); /* Push iItem onto oStack. It is a checked runtime error for oStack to be NULL or full. */ int 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. */ int Stack_isFull(Stack_T oStack); /* Return 1 (TRUE) iff oStack is empty. It is a checked runtime error for oStack to be NULL. */ #endif