Commit | Line | Data |
---|---|---|
d79865b9 MD |
1 | #ifndef _BABELTRACE_TYPES_H |
2 | #define _BABELTRACE_TYPES_H | |
3 | ||
4 | /* | |
5 | * BabelTrace | |
6 | * | |
fc93b2bd | 7 | * Type Header |
d79865b9 | 8 | * |
c054553d | 9 | * Copyright 2010, 2011 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
d79865b9 | 10 | * |
ccd7e1c8 MD |
11 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
12 | * of this software and associated documentation files (the "Software"), to deal | |
13 | * in the Software without restriction, including without limitation the rights | |
14 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
15 | * copies of the Software, and to permit persons to whom the Software is | |
16 | * furnished to do so, subject to the following conditions: | |
d79865b9 | 17 | * |
ccd7e1c8 MD |
18 | * The above copyright notice and this permission notice shall be included in |
19 | * all copies or substantial portions of the Software. | |
d79865b9 MD |
20 | */ |
21 | ||
bed864a7 | 22 | #include <babeltrace/align.h> |
d65d8abb | 23 | #include <babeltrace/list.h> |
4c8bfb7e MD |
24 | #include <stdbool.h> |
25 | #include <stdint.h> | |
26 | #include <limits.h> | |
bed864a7 | 27 | #include <string.h> |
4c8bfb7e | 28 | #include <glib.h> |
8eab883c | 29 | #include <assert.h> |
bed864a7 | 30 | |
11796b96 MD |
31 | /* Preallocate this many fields for structures */ |
32 | #define DEFAULT_NR_STRUCT_FIELDS 8 | |
33 | ||
bed864a7 MD |
34 | /* |
35 | * Always update stream_pos with move_pos and init_pos. | |
36 | */ | |
37 | struct stream_pos { | |
47e0f2e2 | 38 | char *base; /* Base address */ |
bed864a7 MD |
39 | size_t offset; /* Offset from base, in bits */ |
40 | int dummy; /* Dummy position, for length calculation */ | |
41 | }; | |
42 | ||
43 | static inline | |
47e0f2e2 | 44 | void init_pos(struct stream_pos *pos, char *base) |
bed864a7 MD |
45 | { |
46 | pos->base = base; /* initial base, page-aligned */ | |
47 | pos->offset = 0; | |
48 | pos->dummy = false; | |
49 | } | |
50 | ||
51 | /* | |
52 | * move_pos - move position of a relative bit offset | |
53 | * | |
54 | * TODO: allow larger files by updating base too. | |
55 | */ | |
56 | static inline | |
57 | void move_pos(struct stream_pos *pos, size_t offset) | |
58 | { | |
59 | pos->offset = pos->offset + offset; | |
60 | } | |
61 | ||
62 | /* | |
63 | * align_pos - align position on a bit offset (> 0) | |
64 | * | |
65 | * TODO: allow larger files by updating base too. | |
66 | */ | |
67 | static inline | |
68 | void align_pos(struct stream_pos *pos, size_t offset) | |
69 | { | |
70 | pos->offset += offset_align(pos->offset, offset); | |
71 | } | |
72 | ||
73 | static inline | |
74 | void copy_pos(struct stream_pos *dest, struct stream_pos *src) | |
75 | { | |
76 | memcpy(dest, src, sizeof(struct stream_pos)); | |
77 | } | |
78 | ||
79 | static inline | |
47e0f2e2 | 80 | char *get_pos_addr(struct stream_pos *pos) |
bed864a7 MD |
81 | { |
82 | /* Only makes sense to get the address after aligning on CHAR_BIT */ | |
4c8bfb7e | 83 | assert(!(pos->offset % CHAR_BIT)); |
bed864a7 MD |
84 | return pos->base + (pos->offset / CHAR_BIT); |
85 | } | |
fc93b2bd | 86 | |
4c8bfb7e | 87 | struct format; |
e1151715 | 88 | struct definition; |
4c8bfb7e | 89 | |
64893f33 | 90 | /* type scope */ |
f6625916 | 91 | struct declaration_scope { |
c13cbf74 | 92 | /* Hash table mapping type name GQuark to "struct declaration" */ |
1ee8e81d | 93 | /* Used for both typedef and typealias. */ |
f6625916 MD |
94 | GHashTable *typedef_declarations; |
95 | /* Hash table mapping struct name GQuark to "struct declaration_struct" */ | |
96 | GHashTable *struct_declarations; | |
97 | /* Hash table mapping variant name GQuark to "struct declaration_variant" */ | |
98 | GHashTable *variant_declarations; | |
c13cbf74 | 99 | /* Hash table mapping enum name GQuark to "struct type_enum" */ |
f6625916 MD |
100 | GHashTable *enum_declarations; |
101 | struct declaration_scope *parent_scope; | |
64893f33 MD |
102 | }; |
103 | ||
e1151715 MD |
104 | /* definition scope */ |
105 | struct definition_scope { | |
106 | /* Hash table mapping field name GQuark to "struct definition" */ | |
107 | GHashTable *definitions; | |
108 | struct definition_scope *parent_scope; | |
05c749e5 MD |
109 | /* |
110 | * Complete "path" leading to this definition scope. | |
9e29e16e | 111 | * Includes dynamic scope name '.' field name '.' field name '.' .... |
05c749e5 | 112 | * Array of GQuark elements (which are each separated by dots). |
9e29e16e MD |
113 | * The dynamic scope name can contain dots, and is encoded into |
114 | * a single GQuark. Thus, scope_path[0] returns the GQuark | |
115 | * identifying the dynamic scope. | |
05c749e5 MD |
116 | */ |
117 | GArray *scope_path; /* array of GQuark */ | |
6b71274a MD |
118 | }; |
119 | ||
05628561 MD |
120 | enum ctf_type_id { |
121 | CTF_TYPE_UNKNOWN = 0, | |
122 | CTF_TYPE_INTEGER, | |
123 | CTF_TYPE_FLOAT, | |
124 | CTF_TYPE_ENUM, | |
125 | CTF_TYPE_STRING, | |
126 | CTF_TYPE_STRUCT, | |
d60cb676 | 127 | CTF_TYPE_UNTAGGED_VARIANT, |
05628561 MD |
128 | CTF_TYPE_VARIANT, |
129 | CTF_TYPE_ARRAY, | |
130 | CTF_TYPE_SEQUENCE, | |
131 | NR_CTF_TYPES, | |
132 | }; | |
133 | ||
f6625916 | 134 | struct declaration { |
05628561 | 135 | enum ctf_type_id id; |
fc93b2bd MD |
136 | GQuark name; /* type name */ |
137 | size_t alignment; /* type alignment, in bits */ | |
e19c3d69 | 138 | int ref; /* number of references to the type */ |
c054553d | 139 | /* |
f6625916 | 140 | * declaration_free called with declaration ref is decremented to 0. |
c054553d | 141 | */ |
f6625916 | 142 | void (*declaration_free)(struct declaration *declaration); |
e1151715 | 143 | struct definition * |
f6625916 | 144 | (*definition_new)(struct declaration *declaration, |
05c749e5 MD |
145 | struct definition_scope *parent_scope, |
146 | GQuark field_name, int index); | |
c054553d | 147 | /* |
e1151715 | 148 | * definition_free called with definition ref is decremented to 0. |
e19c3d69 | 149 | */ |
e1151715 | 150 | void (*definition_free)(struct definition *definition); |
e19c3d69 | 151 | /* |
e1151715 MD |
152 | * Definition copy function. Knows how to find the child |
153 | * definition from the parent definition. | |
fc93b2bd | 154 | */ |
4c8bfb7e MD |
155 | void (*copy)(struct stream_pos *dest, const struct format *fdest, |
156 | struct stream_pos *src, const struct format *fsrc, | |
e1151715 | 157 | struct definition *definition); |
c054553d MD |
158 | }; |
159 | ||
e1151715 | 160 | struct definition { |
f6625916 | 161 | struct declaration *declaration; |
05c749e5 | 162 | int index; /* Position of the definition in its container */ |
e1151715 | 163 | int ref; /* number of references to the definition */ |
fc93b2bd MD |
164 | }; |
165 | ||
bed864a7 MD |
166 | /* |
167 | * Because we address in bits, bitfields end up being exactly the same as | |
168 | * integers, except that their read/write functions must be able to deal with | |
169 | * read/write non aligned on CHAR_BIT. | |
170 | */ | |
f6625916 MD |
171 | struct declaration_integer { |
172 | struct declaration p; | |
7fe00194 MD |
173 | size_t len; /* length, in bits. */ |
174 | int byte_order; /* byte order */ | |
175 | int signedness; | |
fc93b2bd MD |
176 | }; |
177 | ||
e1151715 MD |
178 | struct definition_integer { |
179 | struct definition p; | |
f6625916 | 180 | struct declaration_integer *declaration; |
c054553d MD |
181 | /* Last values read */ |
182 | union { | |
183 | uint64_t _unsigned; | |
184 | int64_t _signed; | |
185 | } value; | |
186 | }; | |
187 | ||
f6625916 MD |
188 | struct declaration_float { |
189 | struct declaration p; | |
190 | struct declaration_integer *sign; | |
191 | struct declaration_integer *mantissa; | |
192 | struct declaration_integer *exp; | |
fc93b2bd | 193 | int byte_order; |
0a46062b | 194 | /* TODO: we might want to express more info about NaN, +inf and -inf */ |
fc93b2bd MD |
195 | }; |
196 | ||
e1151715 MD |
197 | struct definition_float { |
198 | struct definition p; | |
f6625916 | 199 | struct declaration_float *declaration; |
c054553d MD |
200 | /* Last values read */ |
201 | long double value; | |
202 | }; | |
203 | ||
d65d8abb MD |
204 | /* |
205 | * enum_val_equal assumes that signed and unsigned memory layout overlap. | |
206 | */ | |
207 | struct enum_range { | |
208 | union { | |
209 | int64_t _signed; | |
210 | uint64_t _unsigned; | |
211 | } start; /* lowest range value */ | |
212 | union { | |
213 | int64_t _signed; | |
214 | uint64_t _unsigned; | |
215 | } end; /* highest range value */ | |
216 | }; | |
217 | ||
218 | struct enum_range_to_quark { | |
219 | struct cds_list_head node; | |
220 | struct enum_range range; | |
221 | GQuark quark; | |
222 | }; | |
223 | ||
224 | /* | |
225 | * We optimize the common case (range of size 1: single value) by creating a | |
226 | * hash table mapping values to quark sets. We then lookup the ranges to | |
227 | * complete the quark set. | |
228 | * | |
229 | * TODO: The proper structure to hold the range to quark set mapping would be an | |
230 | * interval tree, with O(n) size, O(n*log(n)) build time and O(log(n)) query | |
231 | * time. Using a simple O(n) list search for now for implementation speed and | |
232 | * given that we can expect to have a _relatively_ small number of enumeration | |
233 | * ranges. This might become untrue if we are fed with symbol tables often | |
234 | * required to lookup function names from instruction pointer value. | |
235 | */ | |
448d3cc7 | 236 | struct enum_table { |
d65d8abb MD |
237 | GHashTable *value_to_quark_set; /* (value, GQuark GArray) */ |
238 | struct cds_list_head range_to_quark; /* (range, GQuark) */ | |
239 | GHashTable *quark_to_range_set; /* (GQuark, range GArray) */ | |
448d3cc7 MD |
240 | }; |
241 | ||
f6625916 MD |
242 | struct declaration_enum { |
243 | struct declaration p; | |
244 | struct declaration_integer *integer_declaration; | |
448d3cc7 | 245 | struct enum_table table; |
fc93b2bd MD |
246 | }; |
247 | ||
e1151715 MD |
248 | struct definition_enum { |
249 | struct definition p; | |
250 | struct definition_integer *integer; | |
f6625916 | 251 | struct declaration_enum *declaration; |
c054553d MD |
252 | /* Last GQuark values read. Keeping a reference on the GQuark array. */ |
253 | GArray *value; | |
254 | }; | |
255 | ||
f6625916 MD |
256 | struct declaration_string { |
257 | struct declaration p; | |
c054553d MD |
258 | }; |
259 | ||
e1151715 MD |
260 | struct definition_string { |
261 | struct definition p; | |
f6625916 | 262 | struct declaration_string *declaration; |
e1151715 | 263 | char *value; /* freed at definition_string teardown */ |
11796b96 MD |
264 | }; |
265 | ||
f6625916 | 266 | struct declaration_field { |
e19c3d69 | 267 | GQuark name; |
f6625916 | 268 | struct declaration *declaration; |
c054553d MD |
269 | }; |
270 | ||
e19c3d69 | 271 | struct field { |
ac88af75 | 272 | GQuark name; |
e1151715 | 273 | struct definition *definition; |
c054553d MD |
274 | }; |
275 | ||
f6625916 MD |
276 | struct declaration_struct { |
277 | struct declaration p; | |
e19c3d69 | 278 | GHashTable *fields_by_name; /* Tuples (field name, field index) */ |
f6625916 MD |
279 | struct declaration_scope *scope; |
280 | GArray *fields; /* Array of declaration_field */ | |
e19c3d69 MD |
281 | }; |
282 | ||
e1151715 MD |
283 | struct definition_struct { |
284 | struct definition p; | |
f6625916 | 285 | struct declaration_struct *declaration; |
e1151715 | 286 | struct definition_scope *scope; |
c054553d MD |
287 | GArray *fields; /* Array of struct field */ |
288 | }; | |
289 | ||
d60cb676 | 290 | struct declaration_untagged_variant { |
f6625916 | 291 | struct declaration p; |
c054553d | 292 | GHashTable *fields_by_tag; /* Tuples (field tag, field index) */ |
f6625916 MD |
293 | struct declaration_scope *scope; |
294 | GArray *fields; /* Array of declaration_field */ | |
c054553d MD |
295 | }; |
296 | ||
d60cb676 MD |
297 | struct declaration_variant { |
298 | struct declaration p; | |
299 | struct declaration_untagged_variant *untagged_variant; | |
300 | GArray *tag_name; /* Array of GQuark */ | |
301 | }; | |
302 | ||
303 | /* A variant needs to be tagged to be defined. */ | |
e1151715 MD |
304 | struct definition_variant { |
305 | struct definition p; | |
f6625916 | 306 | struct declaration_variant *declaration; |
e1151715 MD |
307 | struct definition_scope *scope; |
308 | struct definition *enum_tag; | |
c054553d MD |
309 | GArray *fields; /* Array of struct field */ |
310 | struct field *current_field; /* Last field read */ | |
11796b96 MD |
311 | }; |
312 | ||
f6625916 MD |
313 | struct declaration_array { |
314 | struct declaration p; | |
11796b96 | 315 | size_t len; |
f6625916 MD |
316 | struct declaration *elem; |
317 | struct declaration_scope *scope; | |
11796b96 MD |
318 | }; |
319 | ||
e1151715 MD |
320 | struct definition_array { |
321 | struct definition p; | |
f6625916 | 322 | struct declaration_array *declaration; |
e1151715 | 323 | struct definition_scope *scope; |
c054553d MD |
324 | struct field current_element; /* struct field */ |
325 | }; | |
326 | ||
f6625916 MD |
327 | struct declaration_sequence { |
328 | struct declaration p; | |
329 | struct declaration_integer *len_declaration; | |
330 | struct declaration *elem; | |
331 | struct declaration_scope *scope; | |
e19c3d69 MD |
332 | }; |
333 | ||
e1151715 MD |
334 | struct definition_sequence { |
335 | struct definition p; | |
f6625916 | 336 | struct declaration_sequence *declaration; |
e1151715 MD |
337 | struct definition_scope *scope; |
338 | struct definition_integer *len; | |
c054553d MD |
339 | struct field current_element; /* struct field */ |
340 | }; | |
341 | ||
f6625916 MD |
342 | int register_declaration(GQuark declaration_name, |
343 | struct declaration *declaration, | |
344 | struct declaration_scope *scope); | |
345 | struct declaration *lookup_declaration(GQuark declaration_name, | |
346 | struct declaration_scope *scope); | |
c13cbf74 MD |
347 | |
348 | /* | |
349 | * Type scopes also contain a separate registry for struct, variant and | |
e1151715 | 350 | * enum types. Those register types rather than type definitions, so |
c13cbf74 MD |
351 | * that a named variant can be declared without specifying its target |
352 | * "choice" tag field immediately. | |
353 | */ | |
f6625916 MD |
354 | int register_struct_declaration(GQuark struct_name, |
355 | struct declaration_struct *struct_declaration, | |
356 | struct declaration_scope *scope); | |
357 | struct declaration_struct * | |
358 | lookup_struct_declaration(GQuark struct_name, | |
359 | struct declaration_scope *scope); | |
360 | int register_variant_declaration(GQuark variant_name, | |
361 | struct declaration_variant *variant_declaration, | |
362 | struct declaration_scope *scope); | |
363 | struct declaration_variant *lookup_variant_declaration(GQuark variant_name, | |
364 | struct declaration_scope *scope); | |
365 | int register_enum_declaration(GQuark enum_name, | |
366 | struct declaration_enum *enum_declaration, | |
367 | struct declaration_scope *scope); | |
368 | struct declaration_enum * | |
369 | lookup_enum_declaration(GQuark enum_name, | |
370 | struct declaration_scope *scope); | |
371 | ||
372 | struct declaration_scope * | |
373 | new_declaration_scope(struct declaration_scope *parent_scope); | |
374 | void free_declaration_scope(struct declaration_scope *scope); | |
c054553d | 375 | |
c13cbf74 | 376 | /* |
e1151715 MD |
377 | * field_definition is for field definitions. They are registered into |
378 | * definition scopes. | |
c13cbf74 | 379 | */ |
e1151715 | 380 | struct definition * |
05c749e5 MD |
381 | lookup_definition(GArray *cur_path, /* array of GQuark */ |
382 | GArray *lookup_path, /* array of GQuark */ | |
383 | struct definition_scope *scope); | |
e1151715 MD |
384 | int register_field_definition(GQuark field_name, |
385 | struct definition *definition, | |
386 | struct definition_scope *scope); | |
387 | struct definition_scope * | |
05c749e5 MD |
388 | new_definition_scope(struct definition_scope *parent_scope, |
389 | GQuark field_name); | |
6a36ddca MD |
390 | void set_dynamic_definition_scope(struct definition *definition, |
391 | struct definition_scope *scope, | |
d00d17d1 | 392 | const char *root_name); |
e1151715 | 393 | void free_definition_scope(struct definition_scope *scope); |
4c8bfb7e | 394 | |
f6625916 MD |
395 | void declaration_ref(struct declaration *declaration); |
396 | void declaration_unref(struct declaration *declaration); | |
64893f33 | 397 | |
e1151715 MD |
398 | void definition_ref(struct definition *definition); |
399 | void definition_unref(struct definition *definition); | |
698f0fe4 | 400 | |
add40b62 | 401 | struct declaration_integer *integer_declaration_new(size_t len, int byte_order, |
e19c3d69 | 402 | int signedness, size_t alignment); |
0a46062b | 403 | |
11d43b90 MD |
404 | /* |
405 | * mantissa_len is the length of the number of bytes represented by the mantissa | |
406 | * (e.g. result of DBL_MANT_DIG). It includes the leading 1. | |
407 | */ | |
add40b62 | 408 | struct declaration_float *float_declaration_new(size_t mantissa_len, |
e19c3d69 MD |
409 | size_t exp_len, int byte_order, |
410 | size_t alignment); | |
0a46062b | 411 | |
448d3cc7 MD |
412 | /* |
413 | * A GQuark can be translated to/from strings with g_quark_from_string() and | |
414 | * g_quark_to_string(). | |
415 | */ | |
47e0f2e2 MD |
416 | |
417 | /* | |
418 | * Returns a GArray of GQuark or NULL. | |
419 | * Caller must release the GArray with g_array_unref(). | |
420 | */ | |
f6625916 MD |
421 | GArray *enum_uint_to_quark_set(const struct declaration_enum *enum_declaration, |
422 | uint64_t v); | |
d65d8abb MD |
423 | |
424 | /* | |
47e0f2e2 | 425 | * Returns a GArray of GQuark or NULL. |
d65d8abb MD |
426 | * Caller must release the GArray with g_array_unref(). |
427 | */ | |
f6625916 MD |
428 | GArray *enum_int_to_quark_set(const struct declaration_enum *enum_declaration, |
429 | uint64_t v); | |
47e0f2e2 MD |
430 | |
431 | /* | |
432 | * Returns a GArray of struct enum_range or NULL. | |
fdacfb73 MD |
433 | * Callers do _not_ own the returned GArray (and therefore _don't_ need to |
434 | * release it). | |
47e0f2e2 | 435 | */ |
f6625916 MD |
436 | GArray *enum_quark_to_range_set(const struct declaration_enum *enum_declaration, |
437 | GQuark q); | |
438 | void enum_signed_insert(struct declaration_enum *enum_declaration, | |
d65d8abb | 439 | int64_t start, int64_t end, GQuark q); |
f6625916 | 440 | void enum_unsigned_insert(struct declaration_enum *enum_declaration, |
d65d8abb | 441 | uint64_t start, uint64_t end, GQuark q); |
f6625916 MD |
442 | size_t enum_get_nr_enumerators(struct declaration_enum *enum_declaration); |
443 | ||
444 | struct declaration_enum * | |
445 | enum_declaration_new(const char *name, | |
446 | struct declaration_integer *integer_declaration); | |
447 | ||
448 | struct declaration_struct * | |
449 | struct_declaration_new(const char *name, | |
450 | struct declaration_scope *parent_scope); | |
451 | void struct_declaration_add_field(struct declaration_struct *struct_declaration, | |
452 | const char *field_name, | |
453 | struct declaration *field_declaration); | |
11796b96 MD |
454 | /* |
455 | * Returns the index of a field within a structure. | |
456 | */ | |
f6625916 MD |
457 | unsigned long struct_declaration_lookup_field_index(struct declaration_struct *struct_declaration, |
458 | GQuark field_name); | |
11796b96 MD |
459 | /* |
460 | * field returned only valid as long as the field structure is not appended to. | |
461 | */ | |
f6625916 MD |
462 | struct declaration_field * |
463 | struct_declaration_get_field_from_index(struct declaration_struct *struct_declaration, | |
464 | unsigned long index); | |
e19c3d69 | 465 | struct field * |
e1151715 | 466 | struct_get_field_from_index(struct definition_struct *struct_definition, |
e19c3d69 | 467 | unsigned long index); |
11796b96 | 468 | |
c054553d MD |
469 | /* |
470 | * The tag enumeration is validated to ensure that it contains only mappings | |
471 | * from numeric values to a single tag. Overlapping tag value ranges are | |
472 | * therefore forbidden. | |
473 | */ | |
d60cb676 | 474 | struct declaration_untagged_variant *untagged_variant_declaration_new(const char *name, |
1934b94f | 475 | struct declaration_scope *parent_scope); |
d60cb676 MD |
476 | struct declaration_variant *variant_declaration_new(struct declaration_untagged_variant *untagged_variant, |
477 | const char *tag); | |
478 | ||
479 | void untagged_variant_declaration_add_field(struct declaration_untagged_variant *untagged_variant_declaration, | |
480 | const char *field_name, | |
481 | struct declaration *field_declaration); | |
f6625916 | 482 | struct declaration_field * |
d60cb676 | 483 | untagged_variant_declaration_get_field_from_tag(struct declaration_untagged_variant *untagged_variant_declaration, |
1934b94f | 484 | GQuark tag); |
c054553d MD |
485 | /* |
486 | * Returns 0 on success, -EPERM on error. | |
487 | */ | |
e1151715 MD |
488 | int variant_definition_set_tag(struct definition_variant *variant, |
489 | struct definition *enum_tag); | |
c054553d MD |
490 | /* |
491 | * Returns the field selected by the current tag value. | |
492 | * field returned only valid as long as the variant structure is not appended | |
493 | * to. | |
494 | */ | |
f6625916 | 495 | struct field *variant_get_current_field(struct definition_variant *variant); |
c054553d | 496 | |
d06d03db | 497 | /* |
f6625916 MD |
498 | * elem_declaration passed as parameter now belongs to the array. No |
499 | * need to free it explicitly. "len" is the number of elements in the | |
500 | * array. | |
d06d03db | 501 | */ |
f6625916 MD |
502 | struct declaration_array * |
503 | array_declaration_new(const char *name, | |
1934b94f MD |
504 | size_t len, struct declaration *elem_declaration, |
505 | struct declaration_scope *parent_scope); | |
11796b96 | 506 | |
d06d03db | 507 | /* |
f6625916 MD |
508 | * int_declaration and elem_declaration passed as parameter now belong |
509 | * to the sequence. No need to free them explicitly. | |
d06d03db | 510 | */ |
f6625916 MD |
511 | struct declaration_sequence * |
512 | sequence_declaration_new(const char *name, | |
1934b94f MD |
513 | struct declaration_integer *len_declaration, |
514 | struct declaration *elem_declaration, | |
515 | struct declaration_scope *parent_scope); | |
11796b96 | 516 | |
d60cb676 MD |
517 | /* |
518 | * in: path (dot separated), out: q (GArray of GQuark) | |
519 | */ | |
520 | void append_scope_path(const char *path, GArray *q); | |
521 | ||
f6625916 | 522 | #endif /* _BABELTRACE_declarationS_H */ |