--- stack/stack.c 2002/01/07 23:35:37 1.4 +++ stack/stack.c 2002/01/08 00:03:16 1.5 @@ -236,12 +236,20 @@ if((*stack_head)==NULL) return; - if((*stack_head)->type==value) + switch((*stack_head)->type){ + case value: printf("%d", (*stack_head)->content.val); - else if((*stack_head)->type==string) + break; + case string: printf("%s", (char*)(*stack_head)->content.ptr); - else + break; + case symbol: + printf("%s", (*stack_head)->id); + case ref: + default: printf("%p", (*stack_head)->content.ptr); + break; + } toss(stack_head); } @@ -251,6 +259,11 @@ printf("\n"); } +extern void quit() +{ + exit(EXIT_SUCCESS); +} + int main() { stackitem* s= NULL;