xref: /plan9/sys/src/cmd/gs/src/iestack.h (revision 593dc095aefb2a85c828727bbfa9da139a49bdf4)
1 /* Copyright (C) 1989, 1992, 1993, 1994, 1996, 1997, 1998, 1999 Aladdin Enterprises.  All rights reserved.
2 
3   This software is provided AS-IS with no warranty, either express or
4   implied.
5 
6   This software is distributed under license and may not be copied,
7   modified or distributed except as expressly authorized under the terms
8   of the license contained in the file LICENSE in this distribution.
9 
10   For more information about licensing, please refer to
11   http://www.ghostscript.com/licensing/. For information on
12   commercial licensing, go to http://www.artifex.com/licensing/ or
13   contact Artifex Software, Inc., 101 Lucas Valley Road #110,
14   San Rafael, CA  94903, U.S.A., +1(415)492-9861.
15 */
16 
17 /* $Id: iestack.h,v 1.4 2002/02/21 22:24:53 giles Exp $ */
18 /* Generic execution stack API */
19 
20 #ifndef iestack_INCLUDED
21 #  define iestack_INCLUDED
22 
23 #include "iesdata.h"
24 #include "istack.h"
25 
26 /* Define pointers into the execution stack. */
27 typedef s_ptr es_ptr;
28 typedef const_s_ptr const_es_ptr;
29 
30 /* Manage the current_file cache. */
31 #define estack_clear_cache(pes) ((pes)->current_file = 0)
32 #define estack_set_cache(pes,pref) ((pes)->current_file = (pref))
33 #define estack_check_cache(pes)\
34   BEGIN\
35     if (r_has_type_attrs((pes)->stack.p, t_file, a_executable))\
36       estack_set_cache(pes, (pes)->stack.p);\
37   END
38 
39 #endif /* iestack_INCLUDED */
40