/* stak.h 4.1 82/05/07 */
* Bell Telephone Laboratories
/* To use stack as temporary workspace across
* possible storage allocation (eg name lookup)
* a) get ptr from `relstak'
* b) can now use `pushstak'
* c) then reset with `setstak'
* d) `absstak' gives real address if needed
#define relstak() (staktop-stakbot)
#define absstak(x) (stakbot+Rcheat(x))
#define setstak(x) (staktop=absstak(x))
#define pushstak(c) (*staktop++=(c))
#define zerostak() (*staktop=0)
/* Used to address an item left on the top of
* the stack (very temporary)
#define curstak() (staktop)
/* `usestak' before `pushstak' then `fixstak'
* These routines are safe against heap
#define usestak() {locstak();}
/* for local use only since it hands
* out a real address for the stack top
/* Will allocate the item being used and return its
#define fixstak() endstak(staktop)
/* For use after `locstak' to hand back
* new stack top and then allocate item
/* Copy a string onto the stack and
/* Allocate given ammount of stack space */
/* A chain of ptrs of stack blocks that
* have become covered by heap allocation.
* `tdystak' will return them to the heap.
/* Base of the entire stack */
/* Top of entire stack */
/* Base of current item */
/* Top of current item */