00001
00002
00003
00004
00005
00006
00007 #ifndef string_stack_TYPE
00008 #define string_stack_TYPE
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "mit-copyright.h"
00019
00020 #ifndef NULL
00021 #define NULL 0
00022 #endif
00023
00024 typedef struct _string_stack {
00025 struct _string_stack *next;
00026 string data;
00027 } *string_stack;
00028
00029 #define string_stack_create() ((struct _string_stack *) NULL)
00030
00031 #define string_stack_empty(stack) (!(stack))
00032
00033 #define string_stack_top(stack) ((stack)->data)
00034
00035 #define string_stack_pop(stack) { string_stack old = (stack);\
00036 (stack) = old->next;\
00037 free(old); }
00038
00039 #define string_stack_push(stack,object) \
00040 { string_stack new = (struct _string_stack *)\
00041 malloc(sizeof (struct _string_stack));\
00042 new->next = (stack);\
00043 new->data = object;\
00044 (stack) = new; }
00045
00046 #endif