|
|
1.1 ! root 1: /* ! 2: * G. S. Fowler ! 3: * AT&T Bell Laboratories ! 4: * ! 5: * stack routine definitions ! 6: */ ! 7: ! 8: #ifndef __STACK_H ! 9: ! 10: #define __STACK_H ! 11: ! 12: #ifndef VOID ! 13: #define VOID char ! 14: #endif ! 15: ! 16: typedef struct stacktable* STACK; /* stack pointer */ ! 17: typedef struct stackposition STACKPOS; /* stack position */ ! 18: ! 19: struct stackblock /* stack block cell */ ! 20: { ! 21: char** stack; /* actual stack */ ! 22: struct stackblock* prev; /* previous block in list */ ! 23: struct stackblock* next; /* next block in list */ ! 24: }; ! 25: ! 26: struct stackposition /* stack position */ ! 27: { ! 28: struct stackblock* block; /* current block pointer */ ! 29: int index; /* index within current block */ ! 30: }; ! 31: ! 32: struct stacktable /* stack information */ ! 33: { ! 34: struct stackblock* blocks; /* stack table blocks */ ! 35: char* error; /* error return value */ ! 36: int size; /* size of each block */ ! 37: STACKPOS position; /* current stack position */ ! 38: }; ! 39: ! 40: #if __STDC__ || __cplusplus || c_plusplus ! 41: ! 42: #if __cplusplus ! 43: extern "C" { ! 44: #endif ! 45: ! 46: extern STACK mkstack(int size, char* error); ! 47: extern void rmstack(STACK stack); ! 48: extern void clrstack(STACK stack); ! 49: extern char* getstack(STACK stack); ! 50: extern int pushstack(STACK stack, char* value); ! 51: extern int popstack(STACK stack); ! 52: extern void posstack(STACK stack, int set, STACKPOS* position); ! 53: ! 54: #if __cplusplus ! 55: } ! 56: #endif ! 57: ! 58: #else ! 59: ! 60: extern STACK mkstack(); ! 61: extern void rmstack(); ! 62: extern void clrstack(); ! 63: extern char* getstack(); ! 64: extern int pushstack(); ! 65: extern int popstack(); ! 66: extern void posstack(); ! 67: ! 68: #endif ! 69: ! 70: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.