1
/* Copyright (C) 2001-2006 Artifex Software, Inc.
4
This software is provided AS-IS with no warranty, either express or
7
This software is distributed under license and may not be copied, modified
8
or distributed except as expressly authorized under the terms of that
9
license. Refer to licensing information at http://www.artifex.com/
10
or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
11
San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
14
/* $Id: idsdata.h 9043 2008-08-28 22:48:19Z giles $ */
15
/* Generic dictionary stack structure definition */
17
#ifndef idsdata_INCLUDED
18
# define idsdata_INCLUDED
22
/* Define the dictionary stack structure. */
23
#ifndef dict_stack_DEFINED
24
# define dict_stack_DEFINED
25
typedef struct dict_stack_s dict_stack_t;
29
ref_stack_t stack; /* the actual stack of dictionaries */
32
* Switching between Level 1 and Level 2 involves inserting and removing
33
* globaldict on the dictionary stack. Instead of truly inserting and
34
* removing entries, we replace globaldict by a copy of systemdict in
35
* Level 1 mode. min_dstack_size, the minimum number of entries, does not
36
* change depending on language level; the countdictstack and dictstack
37
* operators must take this into account.
39
uint min_size; /* size of stack after clearing */
41
int userdict_index; /* index of userdict on stack */
44
* Cache a value for fast checking of def operations.
45
* If the top entry on the dictionary stack is a writable dictionary,
46
* dsspace is the space of the dictionary; if it is a non-writable
47
* dictionary, dsspace = -1. Then def is legal precisely if
48
* r_space(pvalue) <= dsspace. Note that in order for this trick to work,
49
* the result of r_space must be a signed integer; some compilers treat
50
* enums as unsigned, probably in violation of the ANSI standard.
55
* Cache values for fast name lookup. If the top entry on the dictionary
56
* stack is a readable dictionary with packed keys, dtop_keys, dtop_npairs,
57
* and dtop_values are keys.value.packed, npairs, and values.value.refs
58
* for that dictionary; otherwise, these variables point to a dummy
61
const ref_packed *top_keys;
66
* Cache a copy of the bottom entry on the stack, which is never deleted.
73
* The top-entry pointers are recomputed after garbage collection, so we
74
* don't declare them as pointers.
76
#define public_st_dict_stack() /* in interp.c */\
77
gs_public_st_suffix_add0(st_dict_stack, dict_stack_t, "dict_stack_t",\
78
dict_stack_enum_ptrs, dict_stack_reloc_ptrs, st_ref_stack)
79
#define st_dict_stack_num_ptrs st_ref_stack_num_ptrs
81
#endif /* idsdata_INCLUDED */