/src/ghostpdl/base/gsstruct.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* Copyright (C) 2001-2023 Artifex Software, Inc. |
2 | | All Rights Reserved. |
3 | | |
4 | | This software is provided AS-IS with no warranty, either express or |
5 | | implied. |
6 | | |
7 | | This software is distributed under license and may not be copied, |
8 | | modified or distributed except as expressly authorized under the terms |
9 | | of the license contained in the file LICENSE in this distribution. |
10 | | |
11 | | Refer to licensing information at http://www.artifex.com or contact |
12 | | Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco, |
13 | | CA 94129, USA, for further information. |
14 | | */ |
15 | | |
16 | | |
17 | | /* Definitions for Ghostscript modules that define allocatable structures */ |
18 | | /* Requires gstypes.h */ |
19 | | |
20 | | #ifndef gsstruct_INCLUDED |
21 | | # define gsstruct_INCLUDED |
22 | | |
23 | | #include "gsstype.h" |
24 | | |
25 | | /* |
26 | | * Ghostscript structures are defined with names of the form (gs_)xxx_s, |
27 | | * with a corresponding typedef of the form (gs_)xxx or (gs_)xxx_t. |
28 | | * By extension, the structure descriptor is named st_[gs_]xxx. |
29 | | * (Note that the descriptor name may omit the gs_ even if the type has it.) |
30 | | * Structure descriptors are always allocated statically and are |
31 | | * always const; they may be either public or private. |
32 | | * |
33 | | * In order to ensure that there is a descriptor for each structure type, |
34 | | * we require, by convention, that the following always appear together |
35 | | * if the structure is defined in a .h file: |
36 | | * - The definition of the structure xxx_s; |
37 | | * - If the descriptor is public, an extern_st(st_xxx); |
38 | | * - The definition of a macro public_st_xxx() or private_st_xxx() |
39 | | * that creates the actual descriptor. |
40 | | * This convention makes the descriptor visible (if public) to any module |
41 | | * that can see the structure definition. This is more liberal than |
42 | | * we would like, but it is a reasonable compromise between restricting |
43 | | * visibility and keeping all the definitional elements of a structure |
44 | | * together. We require that there be no other externs for (public) |
45 | | * structure descriptors; if the definer of a structure wants to make |
46 | | * available the ability to create an instance but does not want to |
47 | | * expose the structure definition, it must export a creator procedure. |
48 | | */ |
49 | | /* |
50 | | * If the structure is defined in a .c file, we require that the following |
51 | | * appear together: |
52 | | * - The definition of the structure xxx_s; |
53 | | * - The gs_private_st_xxx macro that creates the descriptor. |
54 | | * Note that we only allow this if the structure is completely private |
55 | | * to a single file. Again, the file must export a creator procedure |
56 | | * if it wants external clients to be able to create instances. |
57 | | * |
58 | | * Some structures are embedded inside others. In order to be able to |
59 | | * construct the composite pointer enumeration procedures, for such |
60 | | * structures we must define not only the st_xxx descriptor, but also |
61 | | * a st_xxx_max_ptrs constant that gives the maximum number of pointers |
62 | | * the enumeration procedure will return. This is an unfortunate consequence |
63 | | * of the method we have chosen for implementing pointer enumeration. |
64 | | * |
65 | | * Some structures may exist as elements of homogenous arrays. |
66 | | * In order to be able to enumerate and relocate such arrays, we adopt |
67 | | * the convention that the structure representing an element must be |
68 | | * distinguished from the structure per se, and the name of the element |
69 | | * structure always ends with "_element". Element structures cannot be |
70 | | * embedded in other structures. |
71 | | * |
72 | | * Note that the definition of the xxx_s structure may be separate from |
73 | | * the typedef for the type xxx(_t). This still allows us to have full |
74 | | * structure type abstraction. |
75 | | * |
76 | | * Descriptor definitions are not required for structures to which |
77 | | * no traceable pointers from garbage-collectable space will ever exist. |
78 | | * For example, the struct that defines structure types themselves does not |
79 | | * require a descriptor. |
80 | | */ |
81 | | |
82 | | /* An opaque type for an object header. */ |
83 | | typedef struct obj_header_s obj_header_t; |
84 | | |
85 | | /* |
86 | | * Define pointer types, which define how to mark the referent of the |
87 | | * pointer. |
88 | | */ |
89 | | /*typedef struct gs_ptr_procs_s gs_ptr_procs_t;*/ /* in gsmemory.h */ |
90 | | struct gs_ptr_procs_s { |
91 | | |
92 | | /* Unmark the referent of a pointer. */ |
93 | | |
94 | | #define ptr_proc_unmark(proc)\ |
95 | | void proc(enum_ptr_t *, gc_state_t *) |
96 | | ptr_proc_unmark((*unmark)); |
97 | | |
98 | | /* Mark the referent of a pointer. */ |
99 | | /* Return true iff it was unmarked before. */ |
100 | | |
101 | | #define ptr_proc_mark(proc)\ |
102 | | bool proc(enum_ptr_t *, gc_state_t *) |
103 | | ptr_proc_mark((*mark)); |
104 | | |
105 | | /* Relocate a pointer. */ |
106 | | /* Note that the argument is const, but the */ |
107 | | /* return value is not: this shifts the compiler */ |
108 | | /* 'discarding const' warning from the call sites */ |
109 | | /* (the reloc_ptr routines) to the implementations. */ |
110 | | |
111 | | #define ptr_proc_reloc(proc, typ)\ |
112 | | typ *proc(const typ *, gc_state_t *) |
113 | | ptr_proc_reloc((*reloc), void); |
114 | | |
115 | | }; |
116 | | /*typedef const gs_ptr_procs_t *gs_ptr_type_t;*/ /* in gsmemory.h */ |
117 | | |
118 | | /* Define the pointer type for ordinary structure pointers. */ |
119 | | extern const gs_ptr_procs_t ptr_struct_procs; |
120 | 4.11G | #define ptr_struct_type (&ptr_struct_procs) |
121 | | |
122 | | /* Define the pointer types for a pointer to a gs_[const_]string. */ |
123 | | extern const gs_ptr_procs_t ptr_string_procs; |
124 | 9.03M | #define ptr_string_type (&ptr_string_procs) |
125 | | extern const gs_ptr_procs_t ptr_const_string_procs; |
126 | 207M | #define ptr_const_string_type (&ptr_const_string_procs) |
127 | | |
128 | | /* Define the pointer type for name indexes. */ |
129 | | extern const gs_ptr_procs_t ptr_name_index_procs; |
130 | | #define ptr_name_index_type (&ptr_name_index_procs) |
131 | | |
132 | | /* |
133 | | * Define the type for a GC root. |
134 | | */ |
135 | | /*typedef struct gs_gc_root_s gs_gc_root_t;*/ /* in gsmemory.h */ |
136 | | struct gs_gc_root_s { |
137 | | gs_gc_root_t *next; |
138 | | gs_ptr_type_t ptype; |
139 | | void **p; |
140 | | bool free_on_unregister; |
141 | | }; |
142 | | |
143 | | #define public_st_gc_root_t() /* in gsmemory.c */\ |
144 | | gs_public_st_ptrs1(st_gc_root_t, gs_gc_root_t, "gs_gc_root_t",\ |
145 | | gc_root_enum_ptrs, gc_root_reloc_ptrs, next) |
146 | | |
147 | | /* Print a root debugging message. */ |
148 | | #define if_debug_root(c, mem, msg, rp)\ |
149 | 7.15M | if_debug4m(c, mem, "%s "PRI_INTPTR": "PRI_INTPTR" -> "PRI_INTPTR"\n",\ |
150 | 7.15M | msg, (intptr_t)(rp), (intptr_t)(rp)->p, (intptr_t)*(rp)->p) |
151 | | |
152 | | /* |
153 | | * We don't want to tie the allocator to using a single garbage collector, |
154 | | * so we pass all the relevant GC procedures in to the structure pointer |
155 | | * enumeration and relocation procedures. The GC state must begin with |
156 | | * a pointer to the following procedure vector. |
157 | | * |
158 | | * By default, this is all the procedures we know about, but there are |
159 | | * additional procedures defined in the interpreter for dealing with |
160 | | * 'ref' objects. |
161 | | */ |
162 | | #define string_proc_reloc(proc)\ |
163 | | void proc(gs_string *, gc_state_t *) |
164 | | #define const_string_proc_reloc(proc)\ |
165 | | void proc(gs_const_string *, gc_state_t *) |
166 | | #define param_string_proc_reloc(proc)\ |
167 | | void proc(gs_param_string *, gc_state_t *) |
168 | | #define gc_procs_common\ |
169 | | /* Relocate a pointer to an object. */\ |
170 | | ptr_proc_reloc((*reloc_struct_ptr), void /*obj_header_t*/);\ |
171 | | /* Relocate a pointer to a string. */\ |
172 | | string_proc_reloc((*reloc_string));\ |
173 | | /* Relocate a pointer to a const string. */\ |
174 | | const_string_proc_reloc((*reloc_const_string));\ |
175 | | /* Relocate a pointer to a parameter string. */\ |
176 | | param_string_proc_reloc((*reloc_param_string)) |
177 | | typedef struct gc_procs_common_s { |
178 | | gc_procs_common; |
179 | | } gc_procs_common_t; |
180 | | |
181 | 4.65G | #define gc_proc(gcst, proc) ((*(const gc_procs_common_t **)(gcst))->proc) |
182 | | |
183 | | /* Define the accessor for structure type names. */ |
184 | | #define struct_type_name_string(pstype) ((const char *)((pstype)->sname)) |
185 | | |
186 | | /* Default pointer processing */ |
187 | | struct_proc_enum_ptrs(gs_no_struct_enum_ptrs); |
188 | | struct_proc_reloc_ptrs(gs_no_struct_reloc_ptrs); |
189 | | |
190 | | /* Define 'type' descriptors for some standard objects. */ |
191 | | |
192 | | /* Free blocks */ |
193 | | |
194 | | extern_st(st_free); |
195 | | |
196 | | /* Byte objects */ |
197 | | |
198 | | extern_st(st_bytes); |
199 | | |
200 | | /* GC roots */ |
201 | | |
202 | | extern_st(st_gc_root_t); |
203 | | |
204 | | /* Elements and arrays of const strings. */ |
205 | | |
206 | | #define private_st_const_string()\ |
207 | | BASIC_PTRS(const_string_elts) {\ |
208 | | { GC_ELT_CONST_STRING, 0 }\ |
209 | | };\ |
210 | | gs__st_basic(private_st, st_const_string, gs_const_string,\ |
211 | | "gs_const_string", const_string_elts, const_string_sdata) |
212 | | |
213 | | extern_st(st_const_string_element); |
214 | | #define public_st_const_string_element()\ |
215 | | gs_public_st_element(st_const_string_element, gs_const_string,\ |
216 | | "gs_const_string[]", const_string_elt_enum_ptrs,\ |
217 | | const_string_elt_reloc_ptrs, st_const_string) |
218 | | |
219 | | /* ================ Macros for defining structure types ================ */ |
220 | | |
221 | | #define public_st const gs_memory_struct_type_t |
222 | | #define private_st static const gs_memory_struct_type_t |
223 | | |
224 | | /* |
225 | | * As an alternative to defining different enum_ptrs and reloc_ptrs |
226 | | * procedures for basic structure types that only have a fixed number of |
227 | | * pointers and possibly a single supertype, we can define the type's GC |
228 | | * information using stock procedures and a table. Each entry in the table |
229 | | * defines one element of the structure. |
230 | | */ |
231 | | |
232 | | /* Define the pointer types of individual elements. */ |
233 | | |
234 | | typedef enum { |
235 | | GC_ELT_OBJ, /* obj * or const obj * */ |
236 | | GC_ELT_STRING, /* gs_string */ |
237 | | GC_ELT_CONST_STRING /* gs_const_string */ |
238 | | } gc_ptr_type_index_t; |
239 | | |
240 | | typedef struct gc_ptr_element_s { |
241 | | ushort /*gc_ptr_type_index_t */ type; |
242 | | ushort offset; |
243 | | } gc_ptr_element_t; |
244 | | |
245 | | #define GC_OBJ_ELT(typ, elt)\ |
246 | | { GC_ELT_OBJ, offset_of(typ, elt) } |
247 | | #define GC_OBJ_ELT2(typ, e1, e2)\ |
248 | | GC_OBJ_ELT(typ, e1), GC_OBJ_ELT(typ, e2) |
249 | | #define GC_OBJ_ELT3(typ, e1, e2, e3)\ |
250 | | GC_OBJ_ELT(typ, e1), GC_OBJ_ELT(typ, e2), GC_OBJ_ELT(typ, e3) |
251 | | #define GC_STRING_ELT(typ, elt)\ |
252 | | { GC_ELT_STRING, offset_of(typ, elt) } |
253 | | #define GC_CONST_STRING_ELT(typ, elt)\ |
254 | | { GC_ELT_CONST_STRING, offset_of(typ, elt) } |
255 | | |
256 | | /* Define the complete table of descriptor data. */ |
257 | | |
258 | | typedef struct gc_struct_data_s { |
259 | | ushort num_ptrs; |
260 | | ushort super_offset; |
261 | | const gs_memory_struct_type_t *super_type; /* 0 if none */ |
262 | | const gc_ptr_element_t *ptrs; |
263 | | } gc_struct_data_t; |
264 | | |
265 | | /* |
266 | | * Define the enum_ptrs and reloc_ptrs procedures, and the declaration |
267 | | * macros, for table-specified structures. For such structures, the |
268 | | * proc_data points to a gc_struct_data_t. The standard defining form |
269 | | * is: |
270 | | |
271 | | BASIC_PTRS(xxx_ptrs) { |
272 | | ... elements ... |
273 | | }; |
274 | | gs_(private|public)_st_basic_super_final(stname, stype, sname, xxx_ptrs, |
275 | | xxx_data, supst, supoff, pfinal); |
276 | | gs_(private|public)_st_basic_super(stname, stype, sname, xxx_ptrs, xxx_data, |
277 | | supst, supoff); |
278 | | gs_(private|public)_st_basic(stname, stype, sname, xxx_ptrs, xxx_data); |
279 | | |
280 | | */ |
281 | | struct_proc_enum_ptrs(basic_enum_ptrs); |
282 | | struct_proc_reloc_ptrs(basic_reloc_ptrs); |
283 | | |
284 | | #define BASIC_PTRS(elts)\ |
285 | | static const gc_ptr_element_t elts[] = |
286 | | #define gs__st_basic_with_super_final(scope_st, stname, stype, sname, nelts, elts, sdata, supst, supoff, pfinal)\ |
287 | | static const gc_struct_data_t sdata = {\ |
288 | | nelts, supoff, supst, elts\ |
289 | | };\ |
290 | | scope_st stname = {\ |
291 | | sizeof(stype), sname, 0, 0, basic_enum_ptrs, basic_reloc_ptrs,\ |
292 | | pfinal, &sdata\ |
293 | | } |
294 | | /* Basic objects with superclass and finalization. */ |
295 | | #define gs__st_basic_super_final(scope_st, stname, stype, sname, elts, sdata, supst, supoff, pfinal)\ |
296 | | gs__st_basic_with_super_final(scope_st, stname, stype, sname, countof(elts), elts, sdata, supst, supoff, pfinal) |
297 | | #define gs_public_st_basic_super_final(stname, stype, sname, elts, sdata, supst, supoff, pfinal)\ |
298 | | gs__st_basic_super_final(public_st, stname, stype, sname, elts, sdata, supst, supoff, pfinal) |
299 | | #define gs_private_st_basic_super_final(stname, stype, sname, elts, sdata, supst, supoff, pfinal)\ |
300 | | gs__st_basic_super_final(private_st, stname, stype, sname, elts, sdata, supst, supoff, pfinal) |
301 | | /* Basic objects with only superclass. */ |
302 | | #define gs__st_basic_super(scope_st, stname, stype, sname, elts, sdata, supst, supoff)\ |
303 | | gs__st_basic_super_final(scope_st, stname, stype, sname, elts, sdata, supst, supoff, 0) |
304 | | #define gs_public_st_basic_super(stname, stype, sname, elts, sdata, supst, supoff)\ |
305 | | gs__st_basic_super(public_st, stname, stype, sname, elts, sdata, supst, supoff) |
306 | | #define gs_private_st_basic_super(stname, stype, sname, elts, sdata, supst, supoff)\ |
307 | | gs__st_basic_super(private_st, stname, stype, sname, elts, sdata, supst, supoff) |
308 | | /* Basic objects with finalization and no superclass */ |
309 | | #define gs__st_basic_final(scope_st, stname, stype, sname, elts, sdata, pfinal)\ |
310 | | gs__st_basic_super_final(scope_st, stname, stype, sname, elts, sdata, 0, 0, pfinal) |
311 | | #define gs_public_st_basic_final(stname, stype, sname, elts, sdata, pfinal)\ |
312 | | gs__st_basic_final(public_st, stname, stype, sname, elts, sdata, pfinal) |
313 | | #define gs_private_st_basic_final(stname, stype, sname, elts, sdata, pfinal)\ |
314 | | gs__st_basic_final(private_st, stname, stype, sname, elts, sdata, pfinal) |
315 | | /* Basic objects with no frills. */ |
316 | | #define gs__st_basic(scope_st, stname, stype, sname, elts, sdata)\ |
317 | | gs__st_basic_super(scope_st, stname, stype, sname, elts, sdata, 0, 0) |
318 | | #define gs_public_st_basic(stname, stype, sname, elts, sdata)\ |
319 | | gs__st_basic(public_st, stname, stype, sname, elts, sdata) |
320 | | #define gs_private_st_basic(stname, stype, sname, elts, sdata)\ |
321 | | gs__st_basic(private_st, stname, stype, sname, elts, sdata) |
322 | | |
323 | | /* |
324 | | * The simplest kind of composite structure is one with a fixed set of |
325 | | * pointers, each of which points to a struct. We provide macros for |
326 | | * defining this kind of structure conveniently, either all at once in |
327 | | * the structure definition macro, or using the following template: |
328 | | |
329 | | ENUM_PTRS_WITH(xxx_enum_ptrs, stype *const myptr) return 0; |
330 | | ... ENUM_PTR(i, xxx, elt); ... |
331 | | ENUM_PTRS_END |
332 | | RELOC_PTRS_WITH(xxx_reloc_ptrs, stype *const myptr) |
333 | | { |
334 | | ... |
335 | | RELOC_VAR(myptr->elt); |
336 | | ... |
337 | | } |
338 | | |
339 | | */ |
340 | | /* |
341 | | * We have to pull the 'static' keyword outside the ENUM_PTRS_BEGIN and |
342 | | * RELOC_PTRS_BEGIN macros because of a bug in the Borland C++ preprocessor. |
343 | | * We also have to make sure there is more on the line after these |
344 | | * macros, so as not to confuse ansi2knr. |
345 | | */ |
346 | | |
347 | | /* Begin enumeration */ |
348 | | |
349 | | #define ENUM_PTRS_BEGIN_PROC(proc)\ |
350 | | gs_ptr_type_t proc(const gs_memory_t *mem, EV_CONST void *vptr, uint size, int index, enum_ptr_t *pep, const gs_memory_struct_type_t *pstype, gc_state_t *gcst) |
351 | | #define ENUM_PTRS_BEGIN(proc)\ |
352 | 46.6M | ENUM_PTRS_BEGIN_PROC(proc)\ |
353 | 46.6M | { switch ( index ) { default: |
354 | | #define ENUM_PTRS_WITH(proc, stype_ptr)\ |
355 | 1.32G | ENUM_PTRS_BEGIN_PROC(proc)\ |
356 | 1.32G | { EV_CONST stype_ptr = vptr; switch ( index ) { default: |
357 | | |
358 | | /* Enumerate elements */ |
359 | | |
360 | | #define ENUM_OBJ(optr) /* pointer to object */\ |
361 | 1.68G | (pep->ptr = (const void *)(optr), ptr_struct_type) |
362 | | #define ENUM_STRING2(sdata, ssize) /* gs_string */\ |
363 | 9.03M | (pep->ptr = sdata, pep->size = ssize, ptr_string_type) |
364 | | #define ENUM_STRING(sptr) /* pointer to gs_string */\ |
365 | 9.03M | ENUM_STRING2((sptr)->data, (sptr)->size) |
366 | | #define ENUM_CONST_STRING2(sdata, ssize) /* gs_const_string */\ |
367 | 207M | (pep->ptr = sdata, pep->size = ssize, ptr_const_string_type) |
368 | | #define ENUM_CONST_STRING(sptr) /* pointer to gs_const_string */\ |
369 | 125M | ENUM_CONST_STRING2((sptr)->data, (sptr)->size) |
370 | | #define ENUM_NAME_INDEX(name) /* name (as a long index) */\ |
371 | | (pep->size = (uint)name, ptr_name_index_type) |
372 | | extern gs_ptr_type_t |
373 | | enum_bytestring(enum_ptr_t *pep, const gs_bytestring *pbs); |
374 | | #define ENUM_BYTESTRING(ptr) /* pointer to gs_bytestring */\ |
375 | 0 | enum_bytestring(pep, ptr) |
376 | | extern gs_ptr_type_t |
377 | | enum_const_bytestring(enum_ptr_t *pep, const gs_const_bytestring *pbs); |
378 | | #define ENUM_CONST_BYTESTRING(ptr) /* pointer to gs_const_bytestring */\ |
379 | 0 | enum_const_bytestring(pep, ptr) |
380 | | |
381 | | #define ENUM_OBJ_ELT(typ, elt)\ |
382 | 597M | ENUM_OBJ(((const typ *)vptr)->elt) |
383 | | #define ENUM_STRING_ELT(typ, elt)\ |
384 | 397k | ENUM_STRING(&((const typ *)vptr)->elt) |
385 | | #define ENUM_PARAM_STRING_ELT(typ, elt)\ |
386 | 1.95M | (((const typ *)vptr)->elt.persistent ? 0 : ENUM_STRING(&((const typ *)vptr)->elt)) |
387 | | #define ENUM_CONST_STRING_ELT(typ, elt)\ |
388 | 0 | ENUM_CONST_STRING(&((const typ *)vptr)->elt) |
389 | | #define ENUM_NAME_INDEX_ELT(typ, elt) /* name (as a long index) */\ |
390 | | (pep->size = (uint)(((const typ *)vptr)->elt), ptr_name_index_type) |
391 | | |
392 | | #define ENUM_PTR(i, typ, elt)\ |
393 | 597M | case i: return ENUM_OBJ_ELT(typ, elt) |
394 | | #define ENUM_PTR2(i, typ, e1, e2) /* just an abbreviation */\ |
395 | 5.96k | ENUM_PTR(i, typ, e1); ENUM_PTR((i)+1, typ, e2) |
396 | | #define ENUM_PTR3(i, typ, e1, e2, e3) /* just an abbreviation */\ |
397 | 9.39M | ENUM_PTR(i, typ, e1); ENUM_PTR((i)+1, typ, e2); ENUM_PTR((i)+2, typ, e3) |
398 | | #define ENUM_STRING_PTR(i, typ, elt)\ |
399 | 396k | case i: return ENUM_STRING_ELT(typ, elt) |
400 | | #define ENUM_PARAM_STRING_PTR(i, typ, elt)\ |
401 | 1.95M | case i: return ENUM_PARAM_STRING_ELT(typ, elt) |
402 | | #define ENUM_CONST_STRING_PTR(i, typ, elt)\ |
403 | | case i: return ENUM_CONST_STRING_ELT(typ, elt) |
404 | | |
405 | | /* End enumeration */ |
406 | | |
407 | | #define ENUM_PTRS_END\ |
408 | 1.37G | } /* mustn't fall through! */ ENUM_PTRS_END_PROC } |
409 | | #define ENUM_PTRS_END_PROC /* */ |
410 | | |
411 | | /* Begin relocation */ |
412 | | |
413 | | #define RELOC_PTRS_BEGIN(proc)\ |
414 | 7.28G | void proc(void *vptr, uint size, const gs_memory_struct_type_t *pstype, gc_state_t *gcst) { |
415 | | #define RELOC_PTRS_WITH(proc, stype_ptr)\ |
416 | 126M | RELOC_PTRS_BEGIN(proc) stype_ptr = vptr; |
417 | | |
418 | | /* Relocate elements */ |
419 | | |
420 | | #define RELOC_OBJ(ptr)\ |
421 | 7.77G | (gc_proc(gcst, reloc_struct_ptr)((const void *)(ptr), gcst)) |
422 | | #define RELOC_OBJ_VAR(ptrvar)\ |
423 | 2.42G | (ptrvar = RELOC_OBJ(ptrvar)) |
424 | | #define RELOC_VAR(ptrvar) /* a handy abbreviation */\ |
425 | 1.61G | RELOC_OBJ_VAR(ptrvar) |
426 | | #define RELOC_STRING_VAR(ptrvar)\ |
427 | 798k | (gc_proc(gcst, reloc_string)(&(ptrvar), gcst)) |
428 | | #define RELOC_CONST_STRING_VAR(ptrvar)\ |
429 | 2.20G | (gc_proc(gcst, reloc_const_string)(&(ptrvar), gcst)) |
430 | | #define RELOC_PARAM_STRING_VAR(ptrvar)\ |
431 | 1.95M | (gc_proc(gcst, reloc_param_string)(&(ptrvar), gcst)) |
432 | | extern void reloc_bytestring(gs_bytestring *pbs, gc_state_t *gcst); |
433 | | #define RELOC_BYTESTRING_VAR(ptrvar)\ |
434 | 0 | reloc_bytestring(&(ptrvar), gcst) |
435 | | extern void reloc_const_bytestring(gs_const_bytestring *pbs, gc_state_t *gcst); |
436 | | #define RELOC_CONST_BYTESTRING_VAR(ptrvar)\ |
437 | 0 | reloc_const_bytestring(&(ptrvar), gcst) |
438 | | |
439 | | #define RELOC_OBJ_ELT(typ, elt)\ |
440 | 569M | RELOC_VAR(((typ *)vptr)->elt) |
441 | | #define RELOC_STRING_ELT(typ, elt)\ |
442 | 145 | RELOC_STRING_VAR(((typ *)vptr)->elt) |
443 | | #define RELOC_CONST_STRING_ELT(typ, elt)\ |
444 | 397k | RELOC_CONST_STRING_VAR(((typ *)vptr)->elt) |
445 | | #define RELOC_PARAM_STRING_ELT(typ, elt)\ |
446 | 1.95M | RELOC_PARAM_STRING_VAR(((typ *)vptr)->elt) |
447 | | |
448 | | /* Relocate a pointer that points to a known offset within an object. */ |
449 | | /* OFFSET is for byte offsets, TYPED_OFFSET is for element offsets. */ |
450 | | #define RELOC_OFFSET_ELT(typ, elt, offset)\ |
451 | | ((typ *)vptr)->elt = (void *)\ |
452 | | ((char *)RELOC_OBJ((char *)((typ *)vptr)->elt - (offset)) +\ |
453 | | (offset)) |
454 | | #define RELOC_TYPED_OFFSET_ELT(typ, elt, offset)\ |
455 | 69.0k | (((typ *)vptr)->elt = (void *)RELOC_OBJ(((typ *)vptr)->elt - (offset)),\ |
456 | 69.0k | ((typ *)vptr)->elt += (offset)) |
457 | | |
458 | | /* Backward compatibility */ |
459 | | |
460 | | #define RELOC_PTR(typ, elt)\ |
461 | 569M | RELOC_OBJ_ELT(typ, elt) |
462 | | #define RELOC_PTR2(typ, e1, e2) /* just an abbreviation */\ |
463 | 5.96k | RELOC_PTR(typ,e1); RELOC_PTR(typ,e2) |
464 | | #define RELOC_PTR3(typ, e1, e2, e3) /* just an abbreviation */\ |
465 | 767k | RELOC_PTR(typ,e1); RELOC_PTR(typ,e2); RELOC_PTR(typ,e3) |
466 | | #define RELOC_OFFSET_PTR(typ, elt, offset)\ |
467 | | RELOC_OFFSET_ELT(typ, elt, offset) |
468 | | #define RELOC_TYPED_OFFSET_PTR(typ, elt, offset)\ |
469 | 69.0k | RELOC_TYPED_OFFSET_ELT(typ, elt, offset) |
470 | | #define RELOC_STRING_PTR(typ, elt)\ |
471 | 145 | RELOC_STRING_ELT(typ, elt) |
472 | | #define RELOC_CONST_STRING_PTR(typ, elt)\ |
473 | 397k | RELOC_CONST_STRING_ELT(typ, elt) |
474 | | #define RELOC_PARAM_STRING_PTR(typ, elt)\ |
475 | 1.95M | RELOC_PARAM_STRING_ELT(typ, elt) |
476 | | |
477 | | /* End relocation */ |
478 | | |
479 | | #define RELOC_PTRS_END\ |
480 | 7.28G | } |
481 | | |
482 | | /* Subclass support */ |
483 | | |
484 | | #define ENUM_USING(supst, ptr, size, index)\ |
485 | 953M | (*(supst).enum_ptrs)(mem, ptr, size, index, pep, &(supst), gcst) |
486 | | |
487 | | #define RELOC_USING(supst, ptr, size)\ |
488 | 6.99G | (*(supst).reloc_ptrs)(ptr, size, &(supst), gcst) |
489 | | |
490 | | /* |
491 | | * Support for suffix subclasses. Special subclasses constructed |
492 | | * 'by hand' may use this also. |
493 | | */ |
494 | | |
495 | | #define ENUM_USING_PREFIX(supst, n)\ |
496 | 33.2M | ENUM_USING(supst, vptr, size, index-(n)) |
497 | | |
498 | | #define ENUM_PREFIX(supst, n)\ |
499 | 31.9M | return ENUM_USING_PREFIX(supst, n) |
500 | | |
501 | | #define RELOC_PREFIX(supst)\ |
502 | 1.85M | RELOC_USING(supst, vptr, size) |
503 | | |
504 | | /* |
505 | | * Support for general subclasses. |
506 | | */ |
507 | | |
508 | | #define ENUM_SUPER_ELT(stype, supst, member, n)\ |
509 | 26.2M | ENUM_USING(supst, &((EV_CONST stype *)vptr)->member, sizeof(((EV_CONST stype *)vptr)->member), index-(n)) |
510 | | #define ENUM_SUPER(stype, supst, member, n)\ |
511 | 26.2M | return ENUM_SUPER_ELT(stype, supst, member, n) |
512 | | |
513 | | #define RELOC_SUPER_ELT(stype, supst, member)\ |
514 | 13.1M | RELOC_USING(supst, &((stype *)vptr)->member, sizeof(((stype *)vptr)->member)) |
515 | | #define RELOC_SUPER(stype, supst, member)\ |
516 | 13.1M | RELOC_SUPER_ELT(stype, supst, member) |
517 | | |
518 | | /* Backward compatibility. */ |
519 | | |
520 | 172M | #define ENUM_RETURN(ptr) return ENUM_OBJ(ptr) |
521 | 17 | #define ENUM_RETURN_PTR(typ, elt) return ENUM_OBJ_ELT(typ, elt) |
522 | 290 | #define ENUM_RETURN_STRING_PTR(typ, elt) return ENUM_STRING_ELT(typ, elt) |
523 | | #define ENUM_RETURN_CONST_STRING(ptr) return ENUM_CONST_STRING(ptr) |
524 | 0 | #define ENUM_RETURN_CONST_STRING_PTR(typ, elt) return ENUM_CONST_STRING_ELT(typ, elt) |
525 | | |
526 | | /* -------------- Simple structures (no internal pointers). -------------- */ |
527 | | |
528 | | #define gs__st_simple(scope_st, stname, stype, sname)\ |
529 | | scope_st stname = { sizeof(stype), sname, 0, 0, gs_no_struct_enum_ptrs, gs_no_struct_reloc_ptrs, 0, 0 } |
530 | | #define gs_public_st_simple(stname, stype, sname)\ |
531 | | gs__st_simple(public_st, stname, stype, sname) |
532 | | #define gs_private_st_simple(stname, stype, sname)\ |
533 | | gs__st_simple(private_st, stname, stype, sname) |
534 | | |
535 | | #define gs__st_simple_final(scope_st, stname, stype, sname, pfinal)\ |
536 | | scope_st stname = { sizeof(stype), sname, 0, 0, gs_no_struct_enum_ptrs, gs_no_struct_reloc_ptrs, pfinal, 0 } |
537 | | #define gs_public_st_simple_final(stname, stype, sname, pfinal)\ |
538 | | gs__st_simple_final(public_st, stname, stype, sname, pfinal) |
539 | | #define gs_private_st_simple_final(stname, stype, sname, pfinal)\ |
540 | | gs__st_simple_final(private_st, stname, stype, sname, pfinal) |
541 | | |
542 | | /* ---------------- Structures with explicit procedures. ---------------- */ |
543 | | |
544 | | /* |
545 | | * Boilerplate for clear_marks procedures. |
546 | | */ |
547 | | #define CLEAR_MARKS_PROC(proc)\ |
548 | | void proc(const gs_memory_t *cmem, void *vptr, uint size, const gs_memory_struct_type_t *pstype) |
549 | | |
550 | | /* Complex structures with their own clear_marks, */ |
551 | | /* enum, reloc, and finalize procedures. */ |
552 | | |
553 | | #define gs__st_complex_only(scope_st, stname, stype, sname, pclear, penum, preloc, pfinal)\ |
554 | | scope_st stname = { sizeof(stype), sname, 0, pclear, penum, preloc, pfinal, 0 } |
555 | | #define gs_public_st_complex_only(stname, stype, sname, pclear, penum, preloc, pfinal)\ |
556 | | gs__st_complex_only(public_st, stname, stype, sname, pclear, penum, preloc, pfinal) |
557 | | #define gs_private_st_complex_only(stname, stype, sname, pclear, penum, preloc, pfinal)\ |
558 | | gs__st_complex_only(private_st, stname, stype, sname, pclear, penum, preloc, pfinal) |
559 | | |
560 | | #define gs__st_complex(scope_st, stname, stype, sname, pclear, penum, preloc, pfinal)\ |
561 | | static struct_proc_clear_marks(pclear);\ |
562 | | static struct_proc_enum_ptrs(penum);\ |
563 | | static struct_proc_reloc_ptrs(preloc);\ |
564 | | static struct_proc_finalize(pfinal);\ |
565 | | gs__st_complex_only(scope_st, stname, stype, sname, pclear, penum, preloc, pfinal) |
566 | | #define gs_public_st_complex(stname, stype, sname, pclear, penum, preloc, pfinal)\ |
567 | | gs__st_complex(public_st, stname, stype, sname, pclear, penum, preloc, pfinal) |
568 | | #define gs_private_st_complex(stname, stype, sname, pclear, penum, preloc, pfinal)\ |
569 | | gs__st_complex(private_st, stname, stype, sname, pclear, penum, preloc, pfinal) |
570 | | |
571 | | /* Composite structures with their own enum and reloc procedures. */ |
572 | | |
573 | | #define gs__st_composite(scope_st, stname, stype, sname, penum, preloc)\ |
574 | | static struct_proc_enum_ptrs(penum);\ |
575 | | static struct_proc_reloc_ptrs(preloc);\ |
576 | | gs__st_complex_only(scope_st, stname, stype, sname, 0, penum, preloc, 0) |
577 | | #define gs_public_st_composite(stname, stype, sname, penum, preloc)\ |
578 | | gs__st_composite(public_st, stname, stype, sname, penum, preloc) |
579 | | #define gs_private_st_composite(stname, stype, sname, penum, preloc)\ |
580 | | gs__st_composite(private_st, stname, stype, sname, penum, preloc) |
581 | | |
582 | | /* Composite structures with inherited finalization. */ |
583 | | |
584 | | #define gs__st_composite_use_final(scope_st, stname, stype, sname, penum, preloc, pfinal)\ |
585 | | static struct_proc_enum_ptrs(penum);\ |
586 | | static struct_proc_reloc_ptrs(preloc);\ |
587 | | gs__st_complex_only(scope_st, stname, stype, sname, 0, penum, preloc, pfinal) |
588 | | #define gs_public_st_composite_use_final(stname, stype, sname, penum, preloc, pfinal)\ |
589 | | gs__st_composite_use_final(public_st, stname, stype, sname, penum, preloc, pfinal) |
590 | | #define gs_private_st_composite_use_final(stname, stype, sname, penum, preloc, pfinal)\ |
591 | | gs__st_composite_use_final(private_st, stname, stype, sname, penum, preloc, pfinal) |
592 | | |
593 | | /* Composite structures with finalization. */ |
594 | | |
595 | | #define gs__st_composite_final(scope_st, stname, stype, sname, penum, preloc, pfinal)\ |
596 | | static struct_proc_finalize(pfinal);\ |
597 | | gs__st_composite_use_final(scope_st, stname, stype, sname, penum, preloc, pfinal) |
598 | | #define gs_public_st_composite_final(stname, stype, sname, penum, preloc, pfinal)\ |
599 | | gs__st_composite_final(public_st, stname, stype, sname, penum, preloc, pfinal) |
600 | | #define gs_private_st_composite_final(stname, stype, sname, penum, preloc, pfinal)\ |
601 | | gs__st_composite_final(private_st, stname, stype, sname, penum, preloc, pfinal) |
602 | | |
603 | | /* Composite structures with enum and reloc procedures */ |
604 | | /* already declared. */ |
605 | | |
606 | | #define gs__st_composite_only(scope_st, stname, stype, sname, penum, preloc)\ |
607 | | gs__st_complex_only(scope_st, stname, stype, sname, 0, penum, preloc, 0) |
608 | | #define gs_public_st_composite_only(stname, stype, sname, penum, preloc)\ |
609 | | gs__st_composite_only(public_st, stname, stype, sname, penum, preloc) |
610 | | #define gs_private_st_composite_only(stname, stype, sname, penum, preloc)\ |
611 | | gs__st_composite_only(private_st, stname, stype, sname, penum, preloc) |
612 | | |
613 | | /* ---------------- Special kinds of structures ---------------- */ |
614 | | |
615 | | /* Element structures, for use in arrays of structures. */ |
616 | | /* Note that these require that the underlying structure's */ |
617 | | /* enum_ptrs procedure always return the same number of pointers. */ |
618 | | |
619 | | #define gs__st_element(scope_st, stname, stype, sname, penum, preloc, basest)\ |
620 | 506M | static ENUM_PTRS_BEGIN_PROC(penum) {\ |
621 | 506M | uint count = size / (uint)sizeof(stype);\ |
622 | 506M | if ( count == 0 ) return 0;\ |
623 | 506M | return ENUM_USING(basest, (EV_CONST char *)vptr + (index % count) * sizeof(stype),\ |
624 | 506M | sizeof(stype), index / count);\ |
625 | 506M | } ENUM_PTRS_END_PROC\ gxpcmap.c:color_tile_elt_enum_ptrs Line | Count | Source | 620 | 68.3M | static ENUM_PTRS_BEGIN_PROC(penum) {\ | 621 | 68.3M | uint count = size / (uint)sizeof(stype);\ | 622 | 68.3M | if ( count == 0 ) return 0;\ | 623 | 68.3M | return ENUM_USING(basest, (EV_CONST char *)vptr + (index % count) * sizeof(stype),\ | 624 | 68.3M | sizeof(stype), index / count);\ | 625 | 68.3M | } ENUM_PTRS_END_PROC\ |
gdevpdf.c:pdf_substream_save_elt_enum_ptrs Line | Count | Source | 620 | 6.34M | static ENUM_PTRS_BEGIN_PROC(penum) {\ | 621 | 6.34M | uint count = size / (uint)sizeof(stype);\ | 622 | 6.34M | if ( count == 0 ) return 0;\ | 623 | 6.34M | return ENUM_USING(basest, (EV_CONST char *)vptr + (index % count) * sizeof(stype),\ | 624 | 6.34M | sizeof(stype), index / count);\ | 625 | 6.34M | } ENUM_PTRS_END_PROC\ |
gdevpdf.c:pdf_page_elt_enum_ptrs Line | Count | Source | 620 | 7.21M | static ENUM_PTRS_BEGIN_PROC(penum) {\ | 621 | 7.21M | uint count = size / (uint)sizeof(stype);\ | 622 | 7.21M | if ( count == 0 ) return 0;\ | 623 | 7.21M | return ENUM_USING(basest, (EV_CONST char *)vptr + (index % count) * sizeof(stype),\ | 624 | 7.21M | sizeof(stype), index / count);\ | 625 | 7.21M | } ENUM_PTRS_END_PROC\ |
Unexecuted instantiation: gdevpdf.c:pdf_linearisation_record_elt_enum_ptrs gdevpsdp.c:param_string_elt_enum_ptrs Line | Count | Source | 620 | 4.33M | static ENUM_PTRS_BEGIN_PROC(penum) {\ | 621 | 4.33M | uint count = size / (uint)sizeof(stype);\ | 622 | 4.33M | if ( count == 0 ) return 0;\ | 623 | 4.33M | return ENUM_USING(basest, (EV_CONST char *)vptr + (index % count) * sizeof(stype),\ | 624 | 4.33M | sizeof(stype), index / count);\ | 625 | 4.33M | } ENUM_PTRS_END_PROC\ |
gdevpdtf.c:pdf_std_font_elt_enum_ptrs Line | Count | Source | 620 | 1.07M | static ENUM_PTRS_BEGIN_PROC(penum) {\ | 621 | 1.07M | uint count = size / (uint)sizeof(stype);\ | 622 | 1.07M | if ( count == 0 ) return 0;\ | 623 | 1.07M | return ENUM_USING(basest, (EV_CONST char *)vptr + (index % count) * sizeof(stype),\ | 624 | 1.07M | sizeof(stype), index / count);\ | 625 | 1.07M | } ENUM_PTRS_END_PROC\ |
Unexecuted instantiation: gsfont.c:font_ptr_element_enum_ptrs gsht.c:ht_order_element_enum_ptrs Line | Count | Source | 620 | 7.37M | static ENUM_PTRS_BEGIN_PROC(penum) {\ | 621 | 7.37M | uint count = size / (uint)sizeof(stype);\ | 622 | 7.37M | if ( count == 0 ) return 0;\ | 623 | 7.37M | return ENUM_USING(basest, (EV_CONST char *)vptr + (index % count) * sizeof(stype),\ | 624 | 7.37M | sizeof(stype), index / count);\ | 625 | 7.37M | } ENUM_PTRS_END_PROC\ |
Unexecuted instantiation: gsmemory.c:const_string_elt_enum_ptrs gxccman.c:fm_pair_element_enum_ptrs Line | Count | Source | 620 | 411M | static ENUM_PTRS_BEGIN_PROC(penum) {\ | 621 | 411M | uint count = size / (uint)sizeof(stype);\ | 622 | 411M | if ( count == 0 ) return 0;\ | 623 | 411M | return ENUM_USING(basest, (EV_CONST char *)vptr + (index % count) * sizeof(stype),\ | 624 | 411M | sizeof(stype), index / count);\ | 625 | 411M | } ENUM_PTRS_END_PROC\ |
gxccman.c:cc_ptr_element_enum_ptrs Line | Count | Source | 620 | 411k | static ENUM_PTRS_BEGIN_PROC(penum) {\ | 621 | 411k | uint count = size / (uint)sizeof(stype);\ | 622 | 411k | if ( count == 0 ) return 0;\ | 623 | 411k | return ENUM_USING(basest, (EV_CONST char *)vptr + (index % count) * sizeof(stype),\ | 624 | 411k | sizeof(stype), index / count);\ | 625 | 411k | } ENUM_PTRS_END_PROC\ |
Unexecuted instantiation: gsfunc.c:function_ptr_element_enum_ptrs Unexecuted instantiation: gsht1.c:ht_comp_elt_enum_ptrs gsfcid.c:cid_si_elt_enum_ptrs Line | Count | Source | 620 | 3.21k | static ENUM_PTRS_BEGIN_PROC(penum) {\ | 621 | 3.21k | uint count = size / (uint)sizeof(stype);\ | 622 | 3.21k | if ( count == 0 ) return 0;\ | 623 | 3.21k | return ENUM_USING(basest, (EV_CONST char *)vptr + (index % count) * sizeof(stype),\ | 624 | 3.21k | sizeof(stype), index / count);\ | 625 | 3.21k | } ENUM_PTRS_END_PROC\ |
gsfcid.c:font1_ptr_element_enum_ptrs Line | Count | Source | 620 | 76 | static ENUM_PTRS_BEGIN_PROC(penum) {\ | 621 | 76 | uint count = size / (uint)sizeof(stype);\ | 622 | 76 | if ( count == 0 ) return 0;\ | 623 | 76 | return ENUM_USING(basest, (EV_CONST char *)vptr + (index % count) * sizeof(stype),\ | 624 | 76 | sizeof(stype), index / count);\ | 625 | 76 | } ENUM_PTRS_END_PROC\ |
Unexecuted instantiation: gsfcmap1.c:cmap_lookup_range_elt_enum_ptrs |
626 | 2.15M | static RELOC_PTRS_BEGIN(preloc) {\ |
627 | 2.15M | uint count = size / (uint)sizeof(stype);\ |
628 | 6.84G | for ( ; count; count--, vptr = (char *)vptr + sizeof(stype) )\ |
629 | 6.84G | RELOC_USING(basest, vptr, sizeof(stype));\ |
630 | 2.15M | } RELOC_PTRS_END\ gxpcmap.c:color_tile_elt_reloc_ptrs Line | Count | Source | 626 | 339k | static RELOC_PTRS_BEGIN(preloc) {\ | 627 | 339k | uint count = size / (uint)sizeof(stype);\ | 628 | 17.3M | for ( ; count; count--, vptr = (char *)vptr + sizeof(stype) )\ | 629 | 16.9M | RELOC_USING(basest, vptr, sizeof(stype));\ | 630 | 339k | } RELOC_PTRS_END\ |
gdevpdf.c:pdf_substream_save_elt_reloc_ptrs Line | Count | Source | 626 | 71.3k | static RELOC_PTRS_BEGIN(preloc) {\ | 627 | 71.3k | uint count = size / (uint)sizeof(stype);\ | 628 | 856k | for ( ; count; count--, vptr = (char *)vptr + sizeof(stype) )\ | 629 | 784k | RELOC_USING(basest, vptr, sizeof(stype));\ | 630 | 71.3k | } RELOC_PTRS_END\ |
gdevpdf.c:pdf_page_elt_reloc_ptrs Line | Count | Source | 626 | 71.3k | static RELOC_PTRS_BEGIN(preloc) {\ | 627 | 71.3k | uint count = size / (uint)sizeof(stype);\ | 628 | 3.64M | for ( ; count; count--, vptr = (char *)vptr + sizeof(stype) )\ | 629 | 3.57M | RELOC_USING(basest, vptr, sizeof(stype));\ | 630 | 71.3k | } RELOC_PTRS_END\ |
Unexecuted instantiation: gdevpdf.c:pdf_linearisation_record_elt_reloc_ptrs gdevpsdp.c:param_string_elt_reloc_ptrs Line | Count | Source | 626 | 288k | static RELOC_PTRS_BEGIN(preloc) {\ | 627 | 288k | uint count = size / (uint)sizeof(stype);\ | 628 | 4.33M | for ( ; count; count--, vptr = (char *)vptr + sizeof(stype) )\ | 629 | 4.04M | RELOC_USING(basest, vptr, sizeof(stype));\ | 630 | 288k | } RELOC_PTRS_END\ |
gdevpdtf.c:pdf_std_font_elt_reloc_ptrs Line | Count | Source | 626 | 71.3k | static RELOC_PTRS_BEGIN(preloc) {\ | 627 | 71.3k | uint count = size / (uint)sizeof(stype);\ | 628 | 1.07M | for ( ; count; count--, vptr = (char *)vptr + sizeof(stype) )\ | 629 | 998k | RELOC_USING(basest, vptr, sizeof(stype));\ | 630 | 71.3k | } RELOC_PTRS_END\ |
Unexecuted instantiation: gsfont.c:font_ptr_element_reloc_ptrs gsht.c:ht_order_element_reloc_ptrs Line | Count | Source | 626 | 488k | static RELOC_PTRS_BEGIN(preloc) {\ | 627 | 488k | uint count = size / (uint)sizeof(stype);\ | 628 | 2.20M | for ( ; count; count--, vptr = (char *)vptr + sizeof(stype) )\ | 629 | 1.72M | RELOC_USING(basest, vptr, sizeof(stype));\ | 630 | 488k | } RELOC_PTRS_END\ |
Unexecuted instantiation: gsmemory.c:const_string_elt_reloc_ptrs gxccman.c:fm_pair_element_reloc_ptrs Line | Count | Source | 626 | 411k | static RELOC_PTRS_BEGIN(preloc) {\ | 627 | 411k | uint count = size / (uint)sizeof(stype);\ | 628 | 82.6M | for ( ; count; count--, vptr = (char *)vptr + sizeof(stype) )\ | 629 | 82.2M | RELOC_USING(basest, vptr, sizeof(stype));\ | 630 | 411k | } RELOC_PTRS_END\ |
gxccman.c:cc_ptr_element_reloc_ptrs Line | Count | Source | 626 | 411k | static RELOC_PTRS_BEGIN(preloc) {\ | 627 | 411k | uint count = size / (uint)sizeof(stype);\ | 628 | 6.73G | for ( ; count; count--, vptr = (char *)vptr + sizeof(stype) )\ | 629 | 6.73G | RELOC_USING(basest, vptr, sizeof(stype));\ | 630 | 411k | } RELOC_PTRS_END\ |
Unexecuted instantiation: gsfunc.c:function_ptr_element_reloc_ptrs Unexecuted instantiation: gsht1.c:ht_comp_elt_reloc_ptrs gsfcid.c:cid_si_elt_reloc_ptrs Line | Count | Source | 626 | 3.21k | static RELOC_PTRS_BEGIN(preloc) {\ | 627 | 3.21k | uint count = size / (uint)sizeof(stype);\ | 628 | 3.21k | for ( ; count; count--, vptr = (char *)vptr + sizeof(stype) )\ | 629 | 3.21k | RELOC_USING(basest, vptr, sizeof(stype));\ | 630 | 3.21k | } RELOC_PTRS_END\ |
gsfcid.c:font1_ptr_element_reloc_ptrs Line | Count | Source | 626 | 27 | static RELOC_PTRS_BEGIN(preloc) {\ | 627 | 27 | uint count = size / (uint)sizeof(stype);\ | 628 | 76 | for ( ; count; count--, vptr = (char *)vptr + sizeof(stype) )\ | 629 | 49 | RELOC_USING(basest, vptr, sizeof(stype));\ | 630 | 27 | } RELOC_PTRS_END\ |
Unexecuted instantiation: gsfcmap1.c:cmap_lookup_range_elt_reloc_ptrs |
631 | | gs__st_composite_only(scope_st, stname, stype, sname, penum, preloc) |
632 | | #define gs_public_st_element(stname, stype, sname, penum, preloc, basest)\ |
633 | | gs__st_element(public_st, stname, stype, sname, penum, preloc, basest) |
634 | | #define gs_private_st_element(stname, stype, sname, penum, preloc, basest)\ |
635 | | gs__st_element(private_st, stname, stype, sname, penum, preloc, basest) |
636 | | |
637 | | #define gs__st_element_final(scope_st, stname, stype, sname, penum, preloc, basest, pfinal)\ |
638 | 8.50M | static ENUM_PTRS_BEGIN_PROC(penum) {\ |
639 | 8.50M | uint count = size / (uint)sizeof(stype);\ |
640 | 8.50M | if ( count == 0 ) return 0;\ |
641 | 8.50M | return ENUM_USING(basest, (EV_CONST char *)vptr + (index % count) * sizeof(stype),\ |
642 | 8.50M | sizeof(stype), index / count);\ |
643 | 8.50M | } ENUM_PTRS_END_PROC\ |
644 | 339k | static RELOC_PTRS_BEGIN(preloc) {\ |
645 | 339k | uint count = size / (uint)sizeof(stype);\ |
646 | 8.15M | for ( ; count; count--, vptr = (char *)vptr + sizeof(stype) )\ |
647 | 7.81M | RELOC_USING(basest, vptr, sizeof(stype));\ |
648 | 339k | } RELOC_PTRS_END\ |
649 | | gs__st_composite_final(scope_st, stname, stype, sname, penum, preloc,pfinal) |
650 | | #define gs_public_st_element_final(stname, stype, sname, penum, preloc, basest,pfinal)\ |
651 | | gs__st_element_final(public_st, stname, stype, sname, penum, preloc, basest,pfinal) |
652 | | #define gs_private_st_element_final(stname, stype, sname, penum, preloc, basest,pfinal)\ |
653 | | gs__st_element_final(private_st, stname, stype, sname, penum, preloc, basest,pfinal) |
654 | | |
655 | | /* A "structure" just consisting of a pointer. */ |
656 | | /* Note that in this case only, stype is a pointer type. */ |
657 | | /* Fortunately, C's bizarre 'const' syntax does what we want here. */ |
658 | | |
659 | | #define gs__st_ptr(scope_st, stname, stype, sname, penum, preloc)\ |
660 | 8.50M | static ENUM_PTRS_BEGIN(penum) return 0;\ |
661 | 8.15M | case 0: return ENUM_OBJ(*(stype const *)vptr);\ |
662 | 8.50M | ENUM_PTRS_END\ Unexecuted instantiation: gsfont.c:font_ptr_enum_ptrs gsiodev.c:iodev_ptr_enum_ptrs Line | Count | Source | 660 | 8.50M | static ENUM_PTRS_BEGIN(penum) return 0;\ | 661 | 8.15M | case 0: return ENUM_OBJ(*(stype const *)vptr);\ | 662 | 8.50M | ENUM_PTRS_END\ |
Unexecuted instantiation: gsfunc.c:function_ptr_enum_ptrs gsfcid.c:font1_ptr_enum_ptrs Line | Count | Source | 660 | 76 | static ENUM_PTRS_BEGIN(penum) return 0;\ | 661 | 49 | case 0: return ENUM_OBJ(*(stype const *)vptr);\ | 662 | 76 | ENUM_PTRS_END\ |
|
663 | 7.81M | static RELOC_PTRS_BEGIN(preloc) ;\ |
664 | 7.81M | RELOC_VAR(*(stype *)vptr);\ |
665 | 7.81M | RELOC_PTRS_END\ Unexecuted instantiation: gsfont.c:font_ptr_reloc_ptrs gsiodev.c:iodev_ptr_reloc_ptrs Line | Count | Source | 663 | 7.81M | static RELOC_PTRS_BEGIN(preloc) ;\ | 664 | 7.81M | RELOC_VAR(*(stype *)vptr);\ | 665 | 7.81M | RELOC_PTRS_END\ |
Unexecuted instantiation: gsfunc.c:function_ptr_reloc_ptrs gsfcid.c:font1_ptr_reloc_ptrs Line | Count | Source | 663 | 49 | static RELOC_PTRS_BEGIN(preloc) ;\ | 664 | 49 | RELOC_VAR(*(stype *)vptr);\ | 665 | 49 | RELOC_PTRS_END\ |
|
666 | | gs__st_composite_only(scope_st, stname, stype, sname, penum, preloc) |
667 | | #define gs_public_st_ptr(stname, stype, sname, penum, preloc)\ |
668 | | gs__st_ptr(public_st, stname, stype, sname, penum, preloc) |
669 | | #define gs_private_st_ptr(stname, stype, sname, penum, preloc)\ |
670 | | gs__st_ptr(private_st, stname, stype, sname, penum, preloc) |
671 | | |
672 | | /* ---------- Ordinary structures with a fixed set of pointers ----------- */ |
673 | | /* Note that we "cannibalize" the penum and preloc names for elts and sdata. */ |
674 | | /* Both with and without finalization are defined */ |
675 | | |
676 | | /* Structures with 1 pointer. */ |
677 | | |
678 | | #define gs__st_ptrs1(scope_st, stname, stype, sname, penum, preloc, e1)\ |
679 | | BASIC_PTRS(penum) {\ |
680 | | GC_OBJ_ELT(stype, e1)\ |
681 | | };\ |
682 | | gs__st_basic(scope_st, stname, stype, sname, penum, preloc) |
683 | | #define gs_public_st_ptrs1(stname, stype, sname, penum, preloc, e1)\ |
684 | | gs__st_ptrs1(public_st, stname, stype, sname, penum, preloc, e1) |
685 | | #define gs_private_st_ptrs1(stname, stype, sname, penum, preloc, e1)\ |
686 | | gs__st_ptrs1(private_st, stname, stype, sname, penum, preloc, e1) |
687 | | |
688 | | #define gs__st_ptrs1_final(scope_st, stname, stype, sname, penum, preloc, pfinal, e1)\ |
689 | | BASIC_PTRS(penum) {\ |
690 | | GC_OBJ_ELT(stype, e1)\ |
691 | | };\ |
692 | | gs__st_basic_final(scope_st, stname, stype, sname, penum, preloc, pfinal) |
693 | | |
694 | | #define gs_public_st_ptrs1_final(stname, stype, sname, penum, preloc, pfinal, e1)\ |
695 | | gs__st_ptrs1_final(public_st, stname, stype, sname, penum, preloc, pfinal, e1) |
696 | | |
697 | | #define gs_private_st_ptrs1_final(stname, stype, sname, penum, preloc, pfinal, e1)\ |
698 | | gs__st_ptrs1_final(private_st, stname, stype, sname, penum, preloc, pfinal, e1) |
699 | | |
700 | | /* Structures with 1 string. */ |
701 | | |
702 | | #define gs__st_strings1(scope_st, stname, stype, sname, penum, preloc, e1)\ |
703 | | BASIC_PTRS(penum) {\ |
704 | | GC_STRING_ELT(stype, e1)\ |
705 | | };\ |
706 | | gs__st_basic(scope_st, stname, stype, sname, penum, preloc) |
707 | | #define gs_public_st_strings1(stname, stype, sname, penum, preloc, e1)\ |
708 | | gs__st_strings1(public_st, stname, stype, sname, penum, preloc, e1) |
709 | | #define gs_private_st_strings1(stname, stype, sname, penum, preloc, e1)\ |
710 | | gs__st_strings1(private_st, stname, stype, sname, penum, preloc, e1) |
711 | | |
712 | | /* Structures with 1 const string. */ |
713 | | |
714 | | #define gs__st_const_strings1(scope_st, stname, stype, sname, penum, preloc, e1)\ |
715 | | BASIC_PTRS(penum) {\ |
716 | | GC_CONST_STRING_ELT(stype, e1)\ |
717 | | };\ |
718 | | gs__st_basic(scope_st, stname, stype, sname, penum, preloc) |
719 | | #define gs_public_st_const_strings1(stname, stype, sname, penum, preloc, e1)\ |
720 | | gs__st_const_strings1(public_st, stname, stype, sname, penum, preloc, e1) |
721 | | #define gs_private_st_const_strings1(stname, stype, sname, penum, preloc, e1)\ |
722 | | gs__st_const_strings1(private_st, stname, stype, sname, penum, preloc, e1) |
723 | | |
724 | | /* Structures with 2 const strings. */ |
725 | | |
726 | | #define gs__st_const_strings2(scope_st, stname, stype, sname, penum, preloc, e1, e2)\ |
727 | | BASIC_PTRS(penum) {\ |
728 | | GC_CONST_STRING_ELT(stype, e1), GC_CONST_STRING_ELT(stype, e2)\ |
729 | | };\ |
730 | | gs__st_basic(scope_st, stname, stype, sname, penum, preloc) |
731 | | #define gs_public_st_const_strings2(stname, stype, sname, penum, preloc, e1, e2)\ |
732 | | gs__st_const_strings2(public_st, stname, stype, sname, penum, preloc, e1, e2) |
733 | | #define gs_private_st_const_strings2(stname, stype, sname, penum, preloc, e1, e2)\ |
734 | | gs__st_const_strings2(private_st, stname, stype, sname, penum, preloc, e1, e2) |
735 | | |
736 | | /* Structures with 2 pointers. */ |
737 | | |
738 | | #define gs__st_ptrs2(scope_st, stname, stype, sname, penum, preloc, e1, e2)\ |
739 | | BASIC_PTRS(penum) {\ |
740 | | GC_OBJ_ELT2(stype, e1, e2)\ |
741 | | };\ |
742 | | gs__st_basic(scope_st, stname, stype, sname, penum, preloc) |
743 | | #define gs_public_st_ptrs2(stname, stype, sname, penum, preloc, e1, e2)\ |
744 | | gs__st_ptrs2(public_st, stname, stype, sname, penum, preloc, e1, e2) |
745 | | #define gs_private_st_ptrs2(stname, stype, sname, penum, preloc, e1, e2)\ |
746 | | gs__st_ptrs2(private_st, stname, stype, sname, penum, preloc, e1, e2) |
747 | | |
748 | | #define gs__st_ptrs2_final(scope_st, stname, stype, sname, penum, preloc, pfinal, e1, e2)\ |
749 | | BASIC_PTRS(penum) {\ |
750 | | GC_OBJ_ELT2(stype, e1, e2)\ |
751 | | };\ |
752 | | gs__st_basic_final(scope_st, stname, stype, sname, penum, preloc, pfinal) |
753 | | |
754 | | #define gs_public_st_ptrs2_final(stname, stype, sname, penum, preloc, pfinal, e1, e2)\ |
755 | | gs__st_ptrs2_final(public_st, stname, stype, sname, penum, preloc, pfinal, e1, e2) |
756 | | |
757 | | #define gs_private_st_ptrs2_final(stname, stype, sname, penum, preloc, pfinal, e1, e2)\ |
758 | | gs__st_ptrs2_final(private_st, stname, stype, sname, penum, preloc, pfinal, e1, e2) |
759 | | |
760 | | /* Structures with 3 pointers. */ |
761 | | |
762 | | #define gs__st_ptrs3(scope_st, stname, stype, sname, penum, preloc, e1, e2, e3)\ |
763 | | BASIC_PTRS(penum) {\ |
764 | | GC_OBJ_ELT3(stype, e1, e2, e3)\ |
765 | | };\ |
766 | | gs__st_basic(scope_st, stname, stype, sname, penum, preloc) |
767 | | #define gs_public_st_ptrs3(stname, stype, sname, penum, preloc, e1, e2, e3)\ |
768 | | gs__st_ptrs3(public_st, stname, stype, sname, penum, preloc, e1, e2, e3) |
769 | | #define gs_private_st_ptrs3(stname, stype, sname, penum, preloc, e1, e2, e3)\ |
770 | | gs__st_ptrs3(private_st, stname, stype, sname, penum, preloc, e1, e2, e3) |
771 | | |
772 | | #define gs__st_ptrs3_final(scope_st, stname, stype, sname, penum, preloc, pfinal, e1, e2, e3)\ |
773 | | BASIC_PTRS(penum) {\ |
774 | | GC_OBJ_ELT3(stype, e1, e2, e3)\ |
775 | | };\ |
776 | | gs__st_basic_final(scope_st, stname, stype, sname, penum, preloc, pfinal) |
777 | | #define gs_public_st_ptrs3_final(stname, stype, sname, penum, preloc, pfinal, e1, e2, e3)\ |
778 | | gs__st_ptrs3_final(public_st, stname, stype, sname, penum, preloc, pfinal, e1, e2, e3) |
779 | | #define gs_private_st_ptrs3_final(stname, stype, sname, penum, preloc, pfinal, e1, e2, e3)\ |
780 | | gs__st_ptrs3_final(private_st, stname, stype, sname, penum, preloc, pfinal, e1, e2, e3) |
781 | | |
782 | | /* Structures with 4 pointers. */ |
783 | | |
784 | | #define gs__st_ptrs4(scope_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4)\ |
785 | | BASIC_PTRS(penum) {\ |
786 | | GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT(stype, e4)\ |
787 | | };\ |
788 | | gs__st_basic(scope_st, stname, stype, sname, penum, preloc) |
789 | | #define gs_public_st_ptrs4(stname, stype, sname, penum, preloc, e1, e2, e3, e4)\ |
790 | | gs__st_ptrs4(public_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4) |
791 | | #define gs_private_st_ptrs4(stname, stype, sname, penum, preloc, e1, e2, e3, e4)\ |
792 | | gs__st_ptrs4(private_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4) |
793 | | |
794 | | #define gs__st_ptrs4_final(scope_st, stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4)\ |
795 | | BASIC_PTRS(penum) {\ |
796 | | GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT(stype, e4)\ |
797 | | };\ |
798 | | gs__st_basic_final(scope_st, stname, stype, sname, penum, preloc, pfinal) |
799 | | #define gs_public_st_ptrs4_final(stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4)\ |
800 | | gs__st_ptrs4_final(public_st, stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4) |
801 | | #define gs_private_st_ptrs4_final(stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4)\ |
802 | | gs__st_ptrs4_final(private_st, stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4) |
803 | | |
804 | | /* Structures with 5 pointers. */ |
805 | | |
806 | | #define gs__st_ptrs5(scope_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5)\ |
807 | | BASIC_PTRS(penum) {\ |
808 | | GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT2(stype, e4, e5)\ |
809 | | };\ |
810 | | gs__st_basic(scope_st, stname, stype, sname, penum, preloc) |
811 | | #define gs_public_st_ptrs5(stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5)\ |
812 | | gs__st_ptrs5(public_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5) |
813 | | #define gs_private_st_ptrs5(stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5)\ |
814 | | gs__st_ptrs5(private_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5) |
815 | | |
816 | | #define gs__st_ptrs5_final(scope_st, stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5)\ |
817 | | BASIC_PTRS(penum) {\ |
818 | | GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT2(stype, e4, e5)\ |
819 | | };\ |
820 | | gs__st_basic_final(scope_st, stname, stype, sname, penum, preloc, pfinal) |
821 | | #define gs_public_st_ptrs5_final(stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5)\ |
822 | | gs__st_ptrs5_final(public_st, stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5) |
823 | | #define gs_private_st_ptrs5_final(stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5)\ |
824 | | gs__st_ptrs5_final(private_st, stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5) |
825 | | |
826 | | /* Structures with 6 pointers. */ |
827 | | |
828 | | #define gs__st_ptrs6(scope_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6)\ |
829 | | BASIC_PTRS(penum) {\ |
830 | | GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT3(stype, e4, e5, e6)\ |
831 | | };\ |
832 | | gs__st_basic(scope_st, stname, stype, sname, penum, preloc) |
833 | | #define gs_public_st_ptrs6(stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6)\ |
834 | | gs__st_ptrs6(public_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6) |
835 | | #define gs_private_st_ptrs6(stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6)\ |
836 | | gs__st_ptrs6(private_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6) |
837 | | |
838 | | #define gs__st_ptrs6_final(scope_st, stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6)\ |
839 | | BASIC_PTRS(penum) {\ |
840 | | GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT3(stype, e4, e5, e6)\ |
841 | | };\ |
842 | | gs__st_basic_final(scope_st, stname, stype, sname, penum, preloc, pfinal) |
843 | | #define gs_public_st_ptrs6_final(stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6)\ |
844 | | gs__st_ptrs6_final(public_st, stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6) |
845 | | #define gs_private_st_ptrs6_final(stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6)\ |
846 | | gs__st_ptrs6_final(private_st, stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6) |
847 | | |
848 | | /* Structures with 7 pointers. */ |
849 | | |
850 | | #define gs__st_ptrs7(scope_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7)\ |
851 | | BASIC_PTRS(penum) {\ |
852 | | GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT3(stype, e4, e5, e6), GC_OBJ_ELT(stype, e7)\ |
853 | | };\ |
854 | | gs__st_basic(scope_st, stname, stype, sname, penum, preloc) |
855 | | #define gs_public_st_ptrs7(stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7)\ |
856 | | gs__st_ptrs7(public_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7) |
857 | | #define gs_private_st_ptrs7(stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7)\ |
858 | | gs__st_ptrs7(private_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7) |
859 | | |
860 | | #define gs__st_ptrs7_final(scope_st, stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6, e7)\ |
861 | | BASIC_PTRS(penum) {\ |
862 | | GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT3(stype, e4, e5, e6), GC_OBJ_ELT(stype, e7)\ |
863 | | };\ |
864 | | gs__st_basic_final(scope_st, stname, stype, sname, penum, preloc, pfinal) |
865 | | #define gs_public_st_ptrs7_final(stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6, e7)\ |
866 | | gs__st_ptrs7_final(public_st, stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6, e7) |
867 | | #define gs_private_st_ptrs7_final(stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6, e7)\ |
868 | | gs__st_ptrs7_final(private_st, stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6, e7) |
869 | | |
870 | | /* Structures with 8 pointers. */ |
871 | | |
872 | | #define gs__st_ptrs8(scope_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8)\ |
873 | | BASIC_PTRS(penum) {\ |
874 | | GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT3(stype, e4, e5, e6), GC_OBJ_ELT2(stype, e7, e8)\ |
875 | | };\ |
876 | | gs__st_basic(scope_st, stname, stype, sname, penum, preloc) |
877 | | #define gs_public_st_ptrs8(stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8)\ |
878 | | gs__st_ptrs8(public_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8) |
879 | | #define gs_private_st_ptrs8(stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8)\ |
880 | | gs__st_ptrs8(private_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8) |
881 | | |
882 | | #define gs__st_ptrs8_final(scope_st, stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6, e7, e8)\ |
883 | | BASIC_PTRS(penum) {\ |
884 | | GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT3(stype, e4, e5, e6), GC_OBJ_ELT2(stype, e7, e8)\ |
885 | | };\ |
886 | | gs__st_basic_final(scope_st, stname, stype, sname, penum, preloc, pfinal) |
887 | | #define gs_public_st_ptrs8_final(stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6, e7, e8)\ |
888 | | gs__st_ptrs8_final(public_st, stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6, e7, e8) |
889 | | #define gs_private_st_ptrs8_final(stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6, e7, e8)\ |
890 | | gs__st_ptrs8_final(private_st, stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6, e7, e8) |
891 | | |
892 | | /* Structures with 9 pointers. */ |
893 | | |
894 | | #define gs__st_ptrs9(scope_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8, e9)\ |
895 | | BASIC_PTRS(penum) {\ |
896 | | GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT3(stype, e4, e5, e6), GC_OBJ_ELT3(stype, e7, e8, e9)\ |
897 | | };\ |
898 | | gs__st_basic(scope_st, stname, stype, sname, penum, preloc) |
899 | | #define gs_public_st_ptrs9(stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8, e9)\ |
900 | | gs__st_ptrs9(public_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8, e9) |
901 | | #define gs_private_st_ptrs9(stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8, e9)\ |
902 | | gs__st_ptrs9(private_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8, e9) |
903 | | |
904 | | #define gs__st_ptrs9_final(scope_st, stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6, e7, e8, e9)\ |
905 | | BASIC_PTRS(penum) {\ |
906 | | GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT3(stype, e4, e5, e6), GC_OBJ_ELT3(stype, e7, e8, e9)\ |
907 | | };\ |
908 | | gs__st_basic_final(scope_st, stname, stype, sname, penum, preloc, pfinal) |
909 | | #define gs_public_st_ptrs9_final(stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6, e7, e8, e9)\ |
910 | | gs__st_ptrs9_final(public_st, stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6, e7, e8, e9) |
911 | | #define gs_private_st_ptrs9_final(stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6, e7, e8, e9)\ |
912 | | gs__st_ptrs9_final(private_st, stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6, e7, e8, e9) |
913 | | |
914 | | /* Structures with 10 pointers. */ |
915 | | |
916 | | #define gs__st_ptrs10(scope_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10)\ |
917 | | BASIC_PTRS(penum) {\ |
918 | | GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT3(stype, e4, e5, e6), GC_OBJ_ELT3(stype, e7, e8, e9),\ |
919 | | GC_OBJ_ELT(stype, e10) };\ |
920 | | gs__st_basic(scope_st, stname, stype, sname, penum, preloc) |
921 | | #define gs_public_st_ptrs10(stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10)\ |
922 | | gs__st_ptrs10(public_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10) |
923 | | #define gs_private_st_ptrs10(stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10)\ |
924 | | gs__st_ptrs10(private_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10) |
925 | | |
926 | | #define gs__st_ptrs10_final(scope_st, stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10)\ |
927 | | BASIC_PTRS(penum) {\ |
928 | | GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT3(stype, e4, e5, e6), GC_OBJ_ELT3(stype, e7, e8, e9),\ |
929 | | GC_OBJ_ELT(stype, e10) };\ |
930 | | gs__st_basic_final(scope_st, stname, stype, sname, penum, preloc, pfinal) |
931 | | #define gs_public_st_ptrs10_final(stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10)\ |
932 | | gs__st_ptrs10_final(public_st, stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10) |
933 | | #define gs_private_st_ptrs10_final(stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10)\ |
934 | | gs__st_ptrs10_final(private_st, stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10) |
935 | | |
936 | | /* Structures with 11 pointers. */ |
937 | | |
938 | | #define gs__st_ptrs11(scope_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11)\ |
939 | | BASIC_PTRS(penum) {\ |
940 | | GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT3(stype, e4, e5, e6), GC_OBJ_ELT3(stype, e7, e8, e9),\ |
941 | | GC_OBJ_ELT2(stype, e10, e11) };\ |
942 | | gs__st_basic(scope_st, stname, stype, sname, penum, preloc) |
943 | | #define gs_public_st_ptrs11(stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11)\ |
944 | | gs__st_ptrs11(public_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11) |
945 | | #define gs_private_st_ptrs11(stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11)\ |
946 | | gs__st_ptrs11(private_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11) |
947 | | |
948 | | #define gs__st_ptrs11_final(scope_st, stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11)\ |
949 | | BASIC_PTRS(penum) {\ |
950 | | GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT3(stype, e4, e5, e6), GC_OBJ_ELT3(stype, e7, e8, e9),\ |
951 | | GC_OBJ_ELT2(stype, e10, e11) };\ |
952 | | gs__st_basic_final(scope_st, stname, stype, sname, penum, preloc, pfinal) |
953 | | #define gs_public_st_ptrs11_final(stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11)\ |
954 | | gs__st_ptrs11_final(public_st, stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11) |
955 | | #define gs_private_st_ptrs11_final(stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11)\ |
956 | | gs__st_ptrs11_final(private_st, stname, stype, sname, penum, preloc, pfinal, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11) |
957 | | |
958 | | /* Structures with 1 const string and 1 pointer. */ |
959 | | |
960 | | #define gs__st_const_strings1_ptrs1(scope_st, stname, stype, sname, penum, preloc, e1, e2)\ |
961 | | BASIC_PTRS(penum) {\ |
962 | | GC_CONST_STRING_ELT(stype, e1), GC_OBJ_ELT(stype, e2)\ |
963 | | };\ |
964 | | gs__st_basic(scope_st, stname, stype, sname, penum, preloc) |
965 | | #define gs_public_st_const_strings1_ptrs1(stname, stype, sname, penum, preloc, e1, e2)\ |
966 | | gs__st_const_strings1_ptrs1(public_st, stname, stype, sname, penum, preloc, e1, e2) |
967 | | #define gs_private_st_const_strings1_ptrs1(stname, stype, sname, penum, preloc, e1, e2)\ |
968 | | gs__st_const_strings1_ptrs1(private_st, stname, stype, sname, penum, preloc, e1, e2) |
969 | | |
970 | | #define gs__st_const_strings1_ptrs1_final(scope_st, stname, stype, sname, penum, preloc, pfinal, e1, e2)\ |
971 | | BASIC_PTRS(penum) {\ |
972 | | GC_CONST_STRING_ELT(stype, e1), GC_OBJ_ELT(stype, e2)\ |
973 | | };\ |
974 | | gs__st_basic_final(scope_st, stname, stype, sname, penum, preloc, pfinal) |
975 | | #define gs_public_st_const_strings1_ptrs1_final(stname, stype, sname, penum, preloc, pfinal, e1, e2)\ |
976 | | gs__st_const_strings1_ptrs1_final(public_st, stname, stype, sname, penum, preloc, pfinal, e1, e2) |
977 | | #define gs_private_st_const_strings1_ptrs1_final(stname, stype, sname, penum, preloc, e1, e2)\ |
978 | | gs__st_const_strings1_ptrs1_final(private_st, stname, stype, sname, penum, preloc, pfinal, e1, e2) |
979 | | |
980 | | /* Structures with 1 const string and 4 pointers. */ |
981 | | |
982 | | #define gs__st_strings1_ptrs4(scope_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5)\ |
983 | | BASIC_PTRS(penum) {\ |
984 | | GC_CONST_STRING_ELT(stype, e1),\ |
985 | | GC_OBJ_ELT3(stype, e2, e3, e4), GC_OBJ_ELT(stype, e5)\ |
986 | | };\ |
987 | | gs__st_basic(scope_st, stname, stype, sname, penum, preloc) |
988 | | #define gs_public_st_strings1_ptrs4(stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5)\ |
989 | | gs__st_strings1_ptrs4(public_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5) |
990 | | #define gs_private_st_strings1_ptrs4(stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5)\ |
991 | | gs__st_strings1_ptrs4(private_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5) |
992 | | |
993 | | /* Structures with 1 const string and 7 pointers. */ |
994 | | |
995 | | #define gs__st_strings1_ptrs7(scope_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8)\ |
996 | | BASIC_PTRS(penum) {\ |
997 | | GC_CONST_STRING_ELT(stype, e1),\ |
998 | | GC_OBJ_ELT3(stype, e2, e3, e4), GC_OBJ_ELT3(stype, e5, e6, e7), GC_OBJ_ELT(stype, e8)\ |
999 | | };\ |
1000 | | gs__st_basic(scope_st, stname, stype, sname, penum, preloc) |
1001 | | #define gs_public_st_strings1_ptrs7(stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8)\ |
1002 | | gs__st_strings1_ptrs7(public_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8) |
1003 | | #define gs_private_st_strings1_ptrs7(stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8)\ |
1004 | | gs__st_strings1_ptrs7(private_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8) |
1005 | | |
1006 | | /* ---------------- Suffix subclasses ---------------- */ |
1007 | | |
1008 | | /* Suffix subclasses with no additional pointers. */ |
1009 | | |
1010 | | #define gs__st_suffix_add0(scope_st, stname, stype, sname, penum, preloc, supstname)\ |
1011 | | gs__st_basic_with_super_final(scope_st, stname, stype, sname, 0, 0, preloc, &supstname, 0, 0) |
1012 | | #define gs_public_st_suffix_add0(stname, stype, sname, penum, preloc, supstname)\ |
1013 | | gs__st_suffix_add0(public_st, stname, stype, sname, penum, preloc, supstname) |
1014 | | #define gs_private_st_suffix_add0(stname, stype, sname, penum, preloc, supstname)\ |
1015 | | gs__st_suffix_add0(private_st, stname, stype, sname, penum, preloc, supstname) |
1016 | | |
1017 | | /* Suffix subclasses with no additional pointers, */ |
1018 | | /* and with the superclass defined earlier in the same file */ |
1019 | | /* as a 'basic' type. */ |
1020 | | /* In this case, we don't even need new procedures. */ |
1021 | | |
1022 | | #define gs__st_suffix_add0_local(scope_st, stname, stype, sname, supenum, supreloc, supstname)\ |
1023 | | scope_st stname = {\ |
1024 | | sizeof(stype), sname, 0, 0, basic_enum_ptrs, basic_reloc_ptrs,\ |
1025 | | 0, &supreloc\ |
1026 | | } |
1027 | | #define gs_public_st_suffix_add0_local(stname, stype, sname, supenum, supreloc, supstname)\ |
1028 | | gs__st_suffix_add0_local(public_st, stname, stype, sname, supenum, supreloc, supstname) |
1029 | | #define gs_private_st_suffix_add0_local(stname, stype, sname, supenum, supreloc, supstname)\ |
1030 | | gs__st_suffix_add0_local(private_st, stname, stype, sname, supenum, supreloc, supstname) |
1031 | | |
1032 | | /* Suffix subclasses with no additional pointers and finalization. */ |
1033 | | /* This is a hack -- subclasses should inherit finalization, */ |
1034 | | /* but that would require a superclass pointer in the descriptor, */ |
1035 | | /* which would perturb things too much right now. */ |
1036 | | |
1037 | | #define gs__st_suffix_add0_final(scope_st, stname, stype, sname, penum, preloc, pfinal, supstname)\ |
1038 | 329k | static ENUM_PTRS_BEGIN_PROC(penum) {\ |
1039 | 329k | ENUM_PREFIX(supstname, 0);\ |
1040 | 329k | } ENUM_PTRS_END_PROC\ gdevpx.c:device_pclxl_enum_ptrs Line | Count | Source | 1038 | 329k | static ENUM_PTRS_BEGIN_PROC(penum) {\ | 1039 | 329k | ENUM_PREFIX(supstname, 0);\ | 1040 | 329k | } ENUM_PTRS_END_PROC\ |
Unexecuted instantiation: gsovrc.c:overprint_device_t_enum_ptrs gsfcid.c:font_cid_data_enum_ptrs Line | Count | Source | 1038 | 798 | static ENUM_PTRS_BEGIN_PROC(penum) {\ | 1039 | 798 | ENUM_PREFIX(supstname, 0);\ | 1040 | 798 | } ENUM_PTRS_END_PROC\ |
|
1041 | 47.4k | static RELOC_PTRS_BEGIN(preloc) {\ |
1042 | 47.4k | RELOC_PREFIX(supstname);\ |
1043 | 47.4k | } RELOC_PTRS_END\ gdevpx.c:device_pclxl_reloc_ptrs Line | Count | Source | 1041 | 47.0k | static RELOC_PTRS_BEGIN(preloc) {\ | 1042 | 47.0k | RELOC_PREFIX(supstname);\ | 1043 | 47.0k | } RELOC_PTRS_END\ |
Unexecuted instantiation: gsovrc.c:overprint_device_t_reloc_ptrs gsfcid.c:font_cid_data_reloc_ptrs Line | Count | Source | 1041 | 399 | static RELOC_PTRS_BEGIN(preloc) {\ | 1042 | 399 | RELOC_PREFIX(supstname);\ | 1043 | 399 | } RELOC_PTRS_END\ |
|
1044 | | gs__st_complex_only(scope_st, stname, stype, sname, 0, penum, preloc, pfinal) |
1045 | | #define gs_public_st_suffix_add0_final(stname, stype, sname, penum, preloc, pfinal, supstname)\ |
1046 | | gs__st_suffix_add0_final(public_st, stname, stype, sname, penum, preloc, pfinal, supstname) |
1047 | | #define gs_private_st_suffix_add0_final(stname, stype, sname, penum, preloc, pfinal, supstname)\ |
1048 | | gs__st_suffix_add0_final(private_st, stname, stype, sname, penum, preloc, pfinal, supstname) |
1049 | | |
1050 | | /* Suffix subclasses with 1 additional pointer. */ |
1051 | | |
1052 | | #define gs__st_suffix_add1(scope_st, stname, stype, sname, penum, preloc, supstname, e1)\ |
1053 | | BASIC_PTRS(penum) {\ |
1054 | | GC_OBJ_ELT(stype, e1)\ |
1055 | | };\ |
1056 | | gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, 0) |
1057 | | #define gs_public_st_suffix_add1(stname, stype, sname, penum, preloc, supstname, e1)\ |
1058 | | gs__st_suffix_add1(public_st, stname, stype, sname, penum, preloc, supstname, e1) |
1059 | | #define gs_private_st_suffix_add1(stname, stype, sname, penum, preloc, supstname, e1)\ |
1060 | | gs__st_suffix_add1(private_st, stname, stype, sname, penum, preloc, supstname, e1) |
1061 | | |
1062 | | /* Suffix subclasses with 1 additional pointer and finalization. */ |
1063 | | /* See above regarding finalization and subclasses. */ |
1064 | | |
1065 | | #define gs__st_suffix_add1_final(scope_st, stname, stype, sname, penum, preloc, pfinal, supstname, e1)\ |
1066 | | BASIC_PTRS(penum) {\ |
1067 | | GC_OBJ_ELT(stype, e1)\ |
1068 | | };\ |
1069 | | gs__st_basic_super_final(scope_st, stname, stype, sname, penum, preloc, &supstname, 0, pfinal) |
1070 | | #define gs_public_st_suffix_add1_final(stname, stype, sname, penum, preloc, pfinal, supstname, e1)\ |
1071 | | gs__st_suffix_add1_final(public_st, stname, stype, sname, penum, preloc, pfinal, supstname, e1) |
1072 | | #define gs_private_st_suffix_add1_final(stname, stype, sname, penum, preloc, pfinal, supstname, e1)\ |
1073 | | gs__st_suffix_add1_final(private_st, stname, stype, sname, penum, preloc, pfinal, supstname, e1) |
1074 | | |
1075 | | /* Suffix subclasses with 1 additional string. */ |
1076 | | |
1077 | | #define gs__st_suffix_add_strings1(scope_st, stname, stype, sname, penum, preloc, supstname, e1)\ |
1078 | | BASIC_PTRS(penum) {\ |
1079 | | GC_STRING_ELT(stype, e1)\ |
1080 | | };\ |
1081 | | gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, 0) |
1082 | | #define gs_public_st_suffix_add_strings1(stname, stype, sname, penum, preloc, supstname, e1)\ |
1083 | | gs__st_suffix_add_strings1(public_st, stname, stype, sname, penum, preloc, supstname, e1) |
1084 | | #define gs_private_st_suffix_add_strings1(stname, stype, sname, penum, preloc, supstname, e1)\ |
1085 | | gs__st_suffix_add_strings1(private_st, stname, stype, sname, penum, preloc, supstname, e1) |
1086 | | |
1087 | | /* Suffix subclasses with 2 additional pointers. */ |
1088 | | |
1089 | | #define gs__st_suffix_add2(scope_st, stname, stype, sname, penum, preloc, supstname, e1, e2)\ |
1090 | | BASIC_PTRS(penum) {\ |
1091 | | GC_OBJ_ELT2(stype, e1, e2)\ |
1092 | | };\ |
1093 | | gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, 0) |
1094 | | #define gs_public_st_suffix_add2(stname, stype, sname, penum, preloc, supstname, e1, e2)\ |
1095 | | gs__st_suffix_add2(public_st, stname, stype, sname, penum, preloc, supstname, e1, e2) |
1096 | | #define gs_private_st_suffix_add2(stname, stype, sname, penum, preloc, supstname, e1, e2)\ |
1097 | | gs__st_suffix_add2(private_st, stname, stype, sname, penum, preloc, supstname, e1, e2) |
1098 | | |
1099 | | /* Suffix subclasses with 1 additional pointers and 1 string. */ |
1100 | | |
1101 | | #define gs__st_suffix_add1_string1(scope_st, stname, stype, sname, penum, preloc, supstname, e1, e2)\ |
1102 | | BASIC_PTRS(penum) {\ |
1103 | | GC_OBJ_ELT(stype, e1),\ |
1104 | | GC_STRING_ELT(stype, e2)\ |
1105 | | };\ |
1106 | | gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, 0) |
1107 | | #define gs_public_st_suffix_add1_string1(stname, stype, sname, penum, preloc, supstname, e1, e2)\ |
1108 | | gs__st_suffix_add1_string1(public_st, stname, stype, sname, penum, preloc, supstname, e1, e2) |
1109 | | #define gs_private_st_suffix_add1_string1(stname, stype, sname, penum, preloc, supstname, e1, e2)\ |
1110 | | gs__st_suffix_add1_string1(private_st, stname, stype, sname, penum, preloc, supstname, e1, e2) |
1111 | | /* Suffix subclasses with 2 additional pointers and 1 string. */ |
1112 | | |
1113 | | #define gs__st_suffix_add2_string1(scope_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3)\ |
1114 | | BASIC_PTRS(penum) {\ |
1115 | | GC_OBJ_ELT2(stype, e1, e2),\ |
1116 | | GC_STRING_ELT(stype, e3)\ |
1117 | | };\ |
1118 | | gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, 0) |
1119 | | #define gs_public_st_suffix_add2_string1(stname, stype, sname, penum, preloc, supstname, e1, e2, e3)\ |
1120 | | gs__st_suffix_add2_string1(public_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3) |
1121 | | #define gs_private_st_suffix_add2_string1(stname, stype, sname, penum, preloc, supstname, e1, e2, e3)\ |
1122 | | gs__st_suffix_add2_string1(private_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3) |
1123 | | |
1124 | | /* Suffix subclasses with 2 additional pointers and finalization. */ |
1125 | | /* See above regarding finalization and subclasses. */ |
1126 | | |
1127 | | #define gs__st_suffix_add2_final(scope_st, stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2)\ |
1128 | | BASIC_PTRS(penum) {\ |
1129 | | GC_OBJ_ELT2(stype, e1, e2)\ |
1130 | | };\ |
1131 | | gs__st_basic_super_final(scope_st, stname, stype, sname, penum, preloc, &supstname, 0, pfinal) |
1132 | | #define gs_public_st_suffix_add2_final(stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2)\ |
1133 | | gs__st_suffix_add2_final(public_st, stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2) |
1134 | | #define gs_private_st_suffix_add2_final(stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2)\ |
1135 | | gs__st_suffix_add2_final(private_st, stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2) |
1136 | | |
1137 | | #define gs__st_suffix_string2_final(scope_st, stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2)\ |
1138 | | BASIC_PTRS(penum) {\ |
1139 | | GC_STRING_ELT(stype, e1),\ |
1140 | | GC_STRING_ELT(stype, e2)\ |
1141 | | };\ |
1142 | | gs__st_basic_super_final(scope_st, stname, stype, sname, penum, preloc, &supstname, 0, pfinal) |
1143 | | #define gs_public_st_suffix_string2_final(stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2)\ |
1144 | | gs__st_suffix_string2_final(public_st, stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2) |
1145 | | #define gs_private_st_suffix_string2_final(stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2)\ |
1146 | | gs__st_suffix_string2_final(private_st, stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2) |
1147 | | |
1148 | | /* Suffix subclasses with 3 additional pointers. */ |
1149 | | |
1150 | | #define gs__st_suffix_add3(scope_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3)\ |
1151 | | BASIC_PTRS(penum) {\ |
1152 | | GC_OBJ_ELT3(stype, e1, e2, e3)\ |
1153 | | };\ |
1154 | | gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, 0) |
1155 | | #define gs_public_st_suffix_add3(stname, stype, sname, penum, preloc, supstname, e1, e2, e3)\ |
1156 | | gs__st_suffix_add3(public_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3) |
1157 | | #define gs_private_st_suffix_add3(stname, stype, sname, penum, preloc, supstname, e1, e2, e3)\ |
1158 | | gs__st_suffix_add3(private_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3) |
1159 | | |
1160 | | /* Suffix subclasses with 3 additional pointers and 1 string. */ |
1161 | | |
1162 | | #define gs__st_suffix_add3_string1(scope_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4)\ |
1163 | | BASIC_PTRS(penum) {\ |
1164 | | GC_OBJ_ELT3(stype, e1, e2, e3),\ |
1165 | | GC_STRING_ELT(stype, e4)\ |
1166 | | };\ |
1167 | | gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, 0) |
1168 | | #define gs_public_st_suffix_add3_string1(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4)\ |
1169 | | gs__st_suffix_add3_string1(public_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4) |
1170 | | #define gs_private_st_suffix_add3_string1(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4)\ |
1171 | | gs__st_suffix_add3_string1(private_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4) |
1172 | | |
1173 | | /* Suffix subclasses with 3 additional pointers and finalization. */ |
1174 | | /* See above regarding finalization and subclasses. */ |
1175 | | |
1176 | | #define gs__st_suffix_add3_final(scope_st, stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2, e3)\ |
1177 | | BASIC_PTRS(penum) {\ |
1178 | | GC_OBJ_ELT3(stype, e1, e2, e3)\ |
1179 | | };\ |
1180 | | gs__st_basic_super_final(scope_st, stname, stype, sname, penum, preloc, &supstname, 0, pfinal) |
1181 | | #define gs_public_st_suffix_add3_final(stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2, e3)\ |
1182 | | gs__st_suffix_add3_final(public_st, stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2, e3) |
1183 | | #define gs_private_st_suffix_add3_final(stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2, e3)\ |
1184 | | gs__st_suffix_add3_final(private_st, stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2, e3) |
1185 | | |
1186 | | /* Suffix subclasses with 4 additional pointers. */ |
1187 | | |
1188 | | #define gs__st_suffix_add4(scope_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4)\ |
1189 | | BASIC_PTRS(penum) {\ |
1190 | | GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT(stype, e4)\ |
1191 | | };\ |
1192 | | gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, 0) |
1193 | | #define gs_public_st_suffix_add4(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4)\ |
1194 | | gs__st_suffix_add4(public_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4) |
1195 | | #define gs_private_st_suffix_add4(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4)\ |
1196 | | gs__st_suffix_add4(private_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4) |
1197 | | |
1198 | | /* Suffix subclasses with 4 additional pointers and finalization. */ |
1199 | | /* See above regarding finalization and subclasses. */ |
1200 | | |
1201 | | #define gs__st_suffix_add4_final(scope_st, stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2, e3, e4)\ |
1202 | | BASIC_PTRS(penum) {\ |
1203 | | GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT(stype, e4)\ |
1204 | | };\ |
1205 | | gs__st_basic_super_final(scope_st, stname, stype, sname, penum, preloc, &supstname, 0, pfinal) |
1206 | | #define gs_public_st_suffix_add4_final(stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2, e3, e4)\ |
1207 | | gs__st_suffix_add4_final(public_st, stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2, e3, e4) |
1208 | | #define gs_private_st_suffix_add4_final(stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2, e3, e4)\ |
1209 | | gs__st_suffix_add4_final(private_st, stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2, e3, e4) |
1210 | | |
1211 | | /* Suffix subclasses with 5 additional pointers. */ |
1212 | | |
1213 | | #define gs__st_suffix_add5(scope_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5)\ |
1214 | | BASIC_PTRS(penum) {\ |
1215 | | GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT2(stype, e4, e5)\ |
1216 | | };\ |
1217 | | gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, 0) |
1218 | | #define gs_public_st_suffix_add5(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5)\ |
1219 | | gs__st_suffix_add5(public_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5) |
1220 | | #define gs_private_st_suffix_add5(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5)\ |
1221 | | gs__st_suffix_add5(private_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5) |
1222 | | |
1223 | | /* Suffix subclasses with 6 additional pointers. */ |
1224 | | |
1225 | | #define gs__st_suffix_add6(scope_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6)\ |
1226 | | BASIC_PTRS(penum) {\ |
1227 | | GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT3(stype, e4, e5, e6)\ |
1228 | | };\ |
1229 | | gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, 0) |
1230 | | #define gs_public_st_suffix_add6(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6)\ |
1231 | | gs__st_suffix_add6(public_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6) |
1232 | | #define gs_private_st_suffix_add6(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6)\ |
1233 | | gs__st_suffix_add6(private_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6) |
1234 | | |
1235 | | /* Suffix subclasses with 7 additional pointers. */ |
1236 | | |
1237 | | #define gs__st_suffix_add7(scope_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7)\ |
1238 | | BASIC_PTRS(penum) {\ |
1239 | | GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT3(stype, e4, e5, e6),\ |
1240 | | GC_OBJ_ELT(stype, e7)\ |
1241 | | };\ |
1242 | | gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, 0) |
1243 | | #define gs_public_st_suffix_add7(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7)\ |
1244 | | gs__st_suffix_add7(public_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7) |
1245 | | #define gs_private_st_suffix_add7(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7)\ |
1246 | | gs__st_suffix_add7(private_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7) |
1247 | | |
1248 | | /* Suffix subclasses with 8 additional pointers. */ |
1249 | | |
1250 | | #define gs__st_suffix_add8(scope_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8)\ |
1251 | | BASIC_PTRS(penum) {\ |
1252 | | GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT3(stype, e4, e5, e6),\ |
1253 | | GC_OBJ_ELT2(stype, e7, e8)\ |
1254 | | };\ |
1255 | | gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, 0) |
1256 | | #define gs_public_st_suffix_add8(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8)\ |
1257 | | gs__st_suffix_add8(public_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8) |
1258 | | #define gs_private_st_suffix_add8(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8)\ |
1259 | | gs__st_suffix_add8(private_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8) |
1260 | | |
1261 | | /* Suffix subclasses with 9 additional pointers. */ |
1262 | | |
1263 | | #define gs__st_suffix_add9(scope_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9)\ |
1264 | | BASIC_PTRS(penum) {\ |
1265 | | GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT3(stype, e4, e5, e6),\ |
1266 | | GC_OBJ_ELT3(stype, e7, e8, e9)\ |
1267 | | };\ |
1268 | | gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, 0) |
1269 | | #define gs_public_st_suffix_add9(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9)\ |
1270 | | gs__st_suffix_add9(public_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9) |
1271 | | #define gs_private_st_suffix_add9(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9)\ |
1272 | | gs__st_suffix_add9(private_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9) |
1273 | | |
1274 | | /* Suffix subclasses with 10 additional pointers. */ |
1275 | | |
1276 | | #define gs__st_suffix_add10(scope_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10)\ |
1277 | | BASIC_PTRS(penum) {\ |
1278 | | GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT3(stype, e4, e5, e6),\ |
1279 | | GC_OBJ_ELT3(stype, e7, e8, e9), GC_OBJ_ELT(stype, e10)\ |
1280 | | };\ |
1281 | | gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, 0) |
1282 | | #define gs_public_st_suffix_add10(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10)\ |
1283 | | gs__st_suffix_add10(public_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10) |
1284 | | #define gs_private_st_suffix_add10(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10)\ |
1285 | | gs__st_suffix_add10(private_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10) |
1286 | | |
1287 | | /* Suffix subclasses with 11 additional pointers. */ |
1288 | | |
1289 | | #define gs__st_suffix_add11(scope_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11)\ |
1290 | | BASIC_PTRS(penum) {\ |
1291 | | GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT3(stype, e4, e5, e6),\ |
1292 | | GC_OBJ_ELT3(stype, e7, e8, e9), GC_OBJ_ELT2(stype, e10, e11)\ |
1293 | | };\ |
1294 | | gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, 0) |
1295 | | #define gs_public_st_suffix_add11(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11)\ |
1296 | | gs__st_suffix_add11(public_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11) |
1297 | | #define gs_private_st_suffix_add11(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11)\ |
1298 | | gs__st_suffix_add11(private_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11) |
1299 | | |
1300 | | /* ---------------- General subclasses ---------------- */ |
1301 | | |
1302 | | /* General subclasses with no additional pointers. */ |
1303 | | |
1304 | | #define gs__st_ptrs_add0(scope_st, stname, stype, sname, penum, preloc, supstname, member)\ |
1305 | | gs__st_basic_with_super_final(scope_st, stname, stype, sname, 0, 0, preloc, &supstname, offset_of(stype, member), 0) |
1306 | | #define gs_public_st_ptrs_add0(stname, stype, sname, penum, preloc, supstname, member)\ |
1307 | | gs__st_ptrs_add0(public_st, stname, stype, sname, penum, preloc, supstname, member) |
1308 | | #define gs_private_st_ptrs_add0(stname, stype, sname, penum, preloc, supstname, member)\ |
1309 | | gs__st_ptrs_add0(private_st, stname, stype, sname, penum, preloc, supstname, member) |
1310 | | |
1311 | | /* General subclasses with 1 additional pointer. */ |
1312 | | |
1313 | | #define gs__st_ptrs_add1(scope_st, stname, stype, sname, penum, preloc, supstname, member, e1)\ |
1314 | | BASIC_PTRS(penum) {\ |
1315 | | GC_OBJ_ELT(stype, e1)\ |
1316 | | };\ |
1317 | | gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, offset_of(stype, member)) |
1318 | | #define gs_public_st_ptrs_add1(stname, stype, sname, penum, preloc, supstname, member, e1)\ |
1319 | | gs__st_ptrs_add1(public_st, stname, stype, sname, penum, preloc, supstname, member, e1) |
1320 | | #define gs_private_st_ptrs_add1(stname, stype, sname, penum, preloc, supstname, member, e1)\ |
1321 | | gs__st_ptrs_add1(private_st, stname, stype, sname, penum, preloc, supstname, member, e1) |
1322 | | |
1323 | | /* General subclasses with 2 additional pointers. */ |
1324 | | |
1325 | | #define gs__st_ptrs_add2(scope_st, stname, stype, sname, penum, preloc, supstname, member, e1, e2)\ |
1326 | | BASIC_PTRS(penum) {\ |
1327 | | GC_OBJ_ELT2(stype, e1, e2)\ |
1328 | | };\ |
1329 | | gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, offset_of(stype, member)) |
1330 | | #define gs_public_st_ptrs_add2(stname, stype, sname, penum, preloc, supstname, member, e1, e2)\ |
1331 | | gs__st_ptrs_add2(public_st, stname, stype, sname, penum, preloc, supstname, member, e1, e2) |
1332 | | #define gs_private_st_ptrs_add2(stname, stype, sname, penum, preloc, supstname, member, e1, e2)\ |
1333 | | gs__st_ptrs_add2(private_st, stname, stype, sname, penum, preloc, supstname, member, e1, e2) |
1334 | | |
1335 | | #endif /* gsstruct_INCLUDED */ |