|
|
1 # include "swap.h"
2
3 typedef struct {
4 uindex oindex; /* inherited object */
5 uindex funcoffset; /* function call offset */
6 unsigned short varoffset; /* variable offset */
7 bool priv; /* privately inherited? */
8 } dinherit;
9
10 typedef struct {
11 Uint index; /* index in control block */
12 ssizet len; /* string length */
13 } dstrconst;
14
15 # define DSTR_LAYOUT "it"
16
17 typedef struct _dfuncdef_ {
18 char class; /* function class */
19 char inherit; /* function name inherit index */
20 unsigned short index; /* function name index */
21 Uint offset; /* offset in program text */
22 } dfuncdef;
23
24 # define DF_LAYOUT "ccsi"
25
26 typedef struct {
27 char class; /* variable class */
28 char inherit; /* variable name inherit index */
29 unsigned short index; /* variable name index */
30 unsigned short type; /* variable type */
31 } dvardef;
32
33 # define DV_LAYOUT "ccss"
34
35 typedef struct {
36 char inherit; /* function object index */
37 char index; /* function index */
38 unsigned short next; /* next in hash table */
39 } dsymbol;
40
41 # define DSYM_LAYOUT "ccs"
42
43 struct _control_ {
44 control *prev, *next;
45 uindex ndata; /* # of data blocks using this control block */
46
47 sector nsectors; /* o # of sectors */
48 sector *sectors; /* o vector with sectors */
49
50 uindex oindex; /* i object */
51
52 short flags; /* various bitflags */
53
54 short ninherits; /* i/o # inherited objects */
55 dinherit *inherits; /* i/o inherit objects */
56
57 Uint compiled; /* time of compilation */
58
59 char *prog; /* i program text */
60 Uint progsize; /* i/o program text size */
61 Uint progoffset; /* o program text offset */
62
63 unsigned short nstrings; /* i/o # strings */
64 string **strings; /* i/o? string table */
65 dstrconst *sstrings; /* o sstrings */
66 char *stext; /* o sstrings text */
67 Uint strsize; /* o sstrings text size */
68 Uint stroffset; /* o offset of string index table */
69
70 unsigned short nfuncdefs; /* i/o # function definitions */
71 dfuncdef *funcdefs; /* i/o? function definition table */
72 Uint funcdoffset; /* o offset of function definition table */
73
74 unsigned short nvardefs; /* i/o # variable definitions */
75 dvardef *vardefs; /* i/o? variable definitions */
76 Uint vardoffset; /* o offset of variable definition table */
77
78 uindex nfuncalls; /* i/o # function calls */
79 char *funcalls; /* i/o? function calls */
80 Uint funccoffset; /* o offset of function call table */
81
82 unsigned short nsymbols; /* i/o # symbols */
83 dsymbol *symbols; /* i/o? symbol table */
84 Uint symboffset; /* o offset of symbol table */
85
86 unsigned short nvariables; /* i/o # variables */
87 unsigned short nifdefs; /* i/o # int/float definitions */
88 unsigned short nvinit; /* i/o # variables requiring initialization */
89
90 unsigned short vmapsize; /* i/o size of variable mapping */
91 unsigned short *vmap; /* variable mapping */
92 };
93
94 # define NEW_INT ((unsigned short) -1)
95 # define NEW_FLOAT ((unsigned short) -2)
96 # define NEW_POINTER ((unsigned short) -3)
97 # define NEW_VAR(x) ((x) >= NEW_POINTER)
98
99 typedef struct _strref_ {
100 string *str; /* string value */
101 dataspace *data; /* dataspace this string is in */
102 Uint ref; /* # of refs */
103 } strref;
104
105 typedef struct _arrref_ {
106 array *arr; /* array value */
107 dataplane *plane; /* value plane this array is in */
108 dataspace *data; /* dataspace this array is in */
109 short state; /* state of mapping */
110 Uint ref; /* # of refs */
111 } arrref;
112
113 struct _dataplane_ {
114 Int level; /* dataplane level */
115
116 short flags; /* modification flags */
117 long schange; /* # string changes */
118 long achange; /* # array changes */
119 long imports; /* # array imports */
120
121 value *original; /* original variables */
122 arrref alocal; /* primary of new local arrays */
123 arrref *arrays; /* i/o? arrays */
124 abchunk *achunk; /* chunk of array backup info */
125 strref *strings; /* i/o? string constant table */
126 struct _coptable_ *coptab; /* callout patch table */
127
128 dataplane *prev; /* previous in per-dataspace linked list */
129 dataplane *plist; /* next in per-level linked list */
130 };
131
132 struct _dataspace_ {
133 dataspace *prev, *next;
134
135 dataspace *iprev; /* previous in import list */
136 dataspace *inext; /* next in import list */
137
138 sector *sectors; /* o vector of sectors */
139 sector nsectors; /* o # sectors */
140
141 short flags; /* various bitflags */
142 control *ctrl; /* control block */
143 uindex oindex; /* object this dataspace belongs to */
144
145 unsigned short nvariables; /* o # variables */
146 value *variables; /* i/o variables */
147 struct _svalue_ *svariables;/* o svariables */
148 Uint varoffset; /* o offset of variables in data space */
149
150 Uint narrays; /* i/o # arrays */
151 Uint eltsize; /* o total size of array elements */
152 struct _sarray_ *sarrays; /* o sarrays */
153 struct _svalue_ *selts; /* o sarray elements */
154 Uint arroffset; /* o offset of array table in data space */
155
156 Uint nstrings; /* i/o # strings */
157 Uint strsize; /* o total size of string text */
158 struct _sstring_ *sstrings; /* o sstrings */
159 char *stext; /* o sstrings text */
160 Uint stroffset; /* o offset of string table */
161
162 uindex ncallouts; /* # callouts */
163 uindex fcallouts; /* free callout list */
164 struct _dcallout_ *callouts;/* callouts */
165 Uint cooffset; /* offset of callout table */
166
167 dataplane base; /* basic value plane */
168 dataplane *plane; /* current value plane */
169
170 struct _parser_ *parser; /* parse_string data */
171 };
172
173 # define THISPLANE(a) ((a)->plane == (a)->data->plane)
174 # define SAMEPLANE(d1, d2) ((d1)->plane->level == (d2)->plane->level)
175
176 extern void d_init P((int));
177 extern control *d_new_control P((void));
178 extern dataspace *d_new_dataspace P((object*));
179 extern control *d_load_control P((object*));
180 extern dataspace *d_load_dataspace P((object*));
181 extern void d_ref_control P((control*));
182 extern void d_ref_dataspace P((dataspace*));
183
184 extern void d_varmap P((control*, unsigned int,
185 unsigned short*));
186
187 extern char *d_get_prog P((control*));
188 extern string *d_get_strconst P((control*, int, unsigned int));
189 extern dfuncdef *d_get_funcdefs P((control*));
190 extern dvardef *d_get_vardefs P((control*));
191 extern char *d_get_funcalls P((control*));
192 extern dsymbol *d_get_symbols P((control*));
193 extern Uint d_get_progsize P((control*));
194
195 extern value *d_get_variable P((dataspace*, unsigned int));
196 extern value *d_get_elts P((array*));
197
198 extern void d_new_plane P((dataspace*, Int));
199 extern void d_commit_plane P((Int, value*));
200 extern void d_discard_plane P((Int));
201 extern abchunk **d_commit_arr P((array*, dataplane*, dataplane*));
202 extern void d_discard_arr P((array*, dataplane*));
203
204 extern void d_ref_imports P((array*));
205 extern void d_assign_var P((dataspace*, value*, value*));
206 extern value *d_get_extravar P((dataspace*));
207 extern void d_set_extravar P((dataspace*, value*));
208 extern void d_wipe_extravar P((dataspace*));
209 extern void d_assign_elt P((dataspace*, array*, value*, value*));
210 extern void d_change_map P((array*));
211
212 extern uindex d_new_call_out P((dataspace*, string*, Int,
213 unsigned int, frame*, int));
214 extern Int d_del_call_out P((dataspace*, Uint));
215 extern string *d_get_call_out P((dataspace*, unsigned int, frame*,
216 int*));
217 extern array *d_list_callouts P((dataspace*, dataspace*));
218
219 extern void d_export P((void));
220 extern void d_upgrade_all P((object*, object*));
221 extern sector d_swapout P((unsigned int));
222 extern void d_swapsync P((void));
223 extern void d_conv_control P((unsigned int));
224 extern void d_conv_dataspace P((object*, Uint*));
225
226 extern void d_del_control P((control*));
227 extern void d_del_dataspace P((dataspace*));
228
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.