/* stacku.h */ #ifndef STACKU_H #define STACKU_H #define TOS 100 #define CHAR 1 #define DOUBLE 2 struct Type { int tag; union { char cval; double dval; }item; }; typedef struct Type Type; struct Stack { int top; Type val[TOS]; }; typedef struct Stack Stack; Stack * stack_new(); void stack_init(Stack *); void stack_delete(Stack*); int stack_isempty(Stack); void stack_push(Stack *, Type); Type stack_pop(Stack *); Type stack_top(Stack); void stack_print(Stack); #endif