14887Schin 24887Schin /* : : generated by proto : : */ 34887Schin /*********************************************************************** 44887Schin * * 54887Schin * This software is part of the ast package * 6*12068SRoger.Faulkner@Oracle.COM * Copyright (c) 1985-2010 AT&T Intellectual Property * 74887Schin * and is licensed under the * 84887Schin * Common Public License, Version 1.0 * 98462SApril.Chin@Sun.COM * by AT&T Intellectual Property * 104887Schin * * 114887Schin * A copy of the License is available at * 124887Schin * http://www.opensource.org/licenses/cpl1.0.txt * 134887Schin * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) * 144887Schin * * 154887Schin * Information and Software Systems Research * 164887Schin * AT&T Research * 174887Schin * Florham Park NJ * 184887Schin * * 194887Schin * Glenn Fowler <gsf@research.att.com> * 204887Schin * David Korn <dgk@research.att.com> * 214887Schin * Phong Vo <kpv@research.att.com> * 224887Schin * * 234887Schin ***********************************************************************/ 244887Schin 254887Schin /* 264887Schin * Glenn Fowler 274887Schin * AT&T Research 284887Schin * 294887Schin * homogenous stack routine definitions 304887Schin */ 314887Schin 324887Schin #ifndef _STACK_H 334887Schin #if !defined(__PROTO__) 344887Schin #include <prototyped.h> 354887Schin #endif 364887Schin #if !defined(__LINKAGE__) 374887Schin #define __LINKAGE__ /* 2004-08-11 transition */ 384887Schin #endif 394887Schin 404887Schin #define _STACK_H 414887Schin 424887Schin typedef struct stacktable* STACK; /* stack pointer */ 434887Schin typedef struct stackposition STACKPOS; /* stack position */ 444887Schin 454887Schin struct stackblock /* stack block cell */ 464887Schin { 474887Schin __V_** stack; /* actual stack */ 484887Schin struct stackblock* prev; /* previous block in list */ 494887Schin struct stackblock* next; /* next block in list */ 504887Schin }; 514887Schin 524887Schin struct stackposition /* stack position */ 534887Schin { 544887Schin struct stackblock* block; /* current block pointer */ 554887Schin int index; /* index within current block */ 564887Schin }; 574887Schin 584887Schin struct stacktable /* stack information */ 594887Schin { 604887Schin struct stackblock* blocks; /* stack table blocks */ 614887Schin __V_* error; /* error return value */ 624887Schin int size; /* size of each block */ 634887Schin STACKPOS position; /* current stack position */ 644887Schin }; 654887Schin 664887Schin /* 674887Schin * map old names to new 684887Schin */ 694887Schin 704887Schin #define mkstack stackalloc 714887Schin #define rmstack stackfree 724887Schin #define clrstack stackclear 734887Schin #define getstack stackget 744887Schin #define pushstack stackpush 754887Schin #define popstack stackpop 764887Schin #define posstack stacktell 774887Schin 784887Schin #if _BLD_ast && defined(__EXPORT__) 794887Schin #undef __MANGLE__ 804887Schin #define __MANGLE__ __LINKAGE__ __EXPORT__ 814887Schin #endif 824887Schin 834887Schin extern __MANGLE__ STACK stackalloc __PROTO__((int, __V_*)); 844887Schin extern __MANGLE__ void stackfree __PROTO__((STACK)); 854887Schin extern __MANGLE__ void stackclear __PROTO__((STACK)); 864887Schin extern __MANGLE__ __V_* stackget __PROTO__((STACK)); 874887Schin extern __MANGLE__ int stackpush __PROTO__((STACK, __V_*)); 884887Schin extern __MANGLE__ int stackpop __PROTO__((STACK)); 894887Schin extern __MANGLE__ void stacktell __PROTO__((STACK, int, STACKPOS*)); 904887Schin 914887Schin #undef __MANGLE__ 924887Schin #define __MANGLE__ __LINKAGE__ 934887Schin 944887Schin #endif 95