2 /* : : generated by proto : : */
3 /***********************************************************************
5 * This software is part of the ast package *
6 * Copyright (c) 1985-2010 AT&T Intellectual Property *
7 * and is licensed under the *
8 * Common Public License, Version 1.0 *
9 * by AT&T Intellectual Property *
11 * A copy of the License is available at *
12 * http://www.opensource.org/licenses/cpl1.0.txt *
13 * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
15 * Information and Software Systems Research *
19 * Glenn Fowler <gsf@research.att.com> *
20 * David Korn <dgk@research.att.com> *
21 * Phong Vo <kpv@research.att.com> *
23 ***********************************************************************/
29 * homogenous stack routine definitions
33 #if !defined(__PROTO__)
34 #include <prototyped.h>
36 #if !defined(__LINKAGE__)
37 #define __LINKAGE__ /* 2004-08-11 transition */
42 typedef struct stacktable
* STACK
; /* stack pointer */
43 typedef struct stackposition STACKPOS
; /* stack position */
45 struct stackblock
/* stack block cell */
47 __V_
** stack
; /* actual stack */
48 struct stackblock
* prev
; /* previous block in list */
49 struct stackblock
* next
; /* next block in list */
52 struct stackposition
/* stack position */
54 struct stackblock
* block
; /* current block pointer */
55 int index
; /* index within current block */
58 struct stacktable
/* stack information */
60 struct stackblock
* blocks
; /* stack table blocks */
61 __V_
* error
; /* error return value */
62 int size
; /* size of each block */
63 STACKPOS position
; /* current stack position */
67 * map old names to new
70 #define mkstack stackalloc
71 #define rmstack stackfree
72 #define clrstack stackclear
73 #define getstack stackget
74 #define pushstack stackpush
75 #define popstack stackpop
76 #define posstack stacktell
78 #if _BLD_ast && defined(__EXPORT__)
80 #define __MANGLE__ __LINKAGE__ __EXPORT__
83 extern __MANGLE__ STACK stackalloc
__PROTO__((int, __V_
*));
84 extern __MANGLE__
void stackfree
__PROTO__((STACK
));
85 extern __MANGLE__
void stackclear
__PROTO__((STACK
));
86 extern __MANGLE__ __V_
* stackget
__PROTO__((STACK
));
87 extern __MANGLE__
int stackpush
__PROTO__((STACK
, __V_
*));
88 extern __MANGLE__
int stackpop
__PROTO__((STACK
));
89 extern __MANGLE__
void stacktell
__PROTO__((STACK
, int, STACKPOS
*));
92 #define __MANGLE__ __LINKAGE__