Fix -Wmissing-prototypes/-Wmissing-declarations warnings
[babeltrace.git] / src / ctf-writer / field-types.h
CommitLineData
8deee039
PP
1#ifndef BABELTRACE_CTF_WRITER_FIELD_TYPES_INTERNAL_H
2#define BABELTRACE_CTF_WRITER_FIELD_TYPES_INTERNAL_H
3
4/*
8deee039
PP
5 * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 *
7 * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a copy
10 * of this software and associated documentation files (the "Software"), to deal
11 * in the Software without restriction, including without limitation the rights
12 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 * copies of the Software, and to permit persons to whom the Software is
14 * furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included in
17 * all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 * SOFTWARE.
26 *
27 * The Common Trace Format (CTF) Specification is available at
28 * http://www.efficios.com/ctf
29 */
30
31#include <stdint.h>
32#include <stddef.h>
33
3996bc53
PP
34#include <babeltrace2-ctf-writer/field-types.h>
35#include <babeltrace2-ctf-writer/types.h>
086dc475 36
85e7137b 37#include "common/macros.h"
57952005
MJ
38
39#include "assert-pre.h"
40#include "clock-class.h"
41#include "object.h"
42#include "writer.h"
43
bf436657
MJ
44#define BT_CTF_ASSERT_PRE_CTF_FT_COMMON_HAS_ID(_ft, _type_id, _name) \
45 BT_CTF_ASSERT_PRE(((struct bt_ctf_field_type_common *) (_ft))->id == (_type_id), \
086dc475
PP
46 _name " has the wrong type ID: expected-type-id=%s, " \
47 "ft-addr=%p", bt_ctf_field_type_id_string(_type_id), (_ft))
48
bf436657
MJ
49#define BT_CTF_ASSERT_PRE_CTF_FT_HOT(_ft, _name) \
50 BT_CTF_ASSERT_PRE_HOT((_ft), (_name), ": ft-addr=%p", (_ft))
086dc475
PP
51
52#define BT_CTF_FIELD_TYPE_COMMON_STRUCTURE_FIELD_AT_INDEX(_ft, _index) \
53 (&g_array_index(((struct bt_ctf_field_type_common_structure *) (_ft))->fields, \
54 struct bt_ctf_field_type_common_structure_field, (_index)))
55
56#define BT_CTF_FIELD_TYPE_COMMON_VARIANT_CHOICE_AT_INDEX(_ft, _index) \
57 (&g_array_index(((struct bt_ctf_field_type_common_variant *) (_ft))->choices, \
58 struct bt_ctf_field_type_common_variant_choice, (_index)))
59
60struct bt_ctf_field_common;
61struct bt_ctf_field_type_common;
62
63typedef void (*bt_ctf_field_type_common_method_freeze)(
64 struct bt_ctf_field_type_common *);
65typedef int (*bt_ctf_field_type_common_method_validate)(
66 struct bt_ctf_field_type_common *);
67typedef void (*bt_ctf_field_type_common_method_set_byte_order)(
68 struct bt_ctf_field_type_common *, enum bt_ctf_byte_order);
69typedef struct bt_ctf_field_type_common *(*bt_ctf_field_type_common_method_copy)(
70 struct bt_ctf_field_type_common *);
71typedef int (*bt_ctf_field_type_common_method_compare)(
72 struct bt_ctf_field_type_common *,
73 struct bt_ctf_field_type_common *);
74
75struct bt_ctf_field_type_common_methods {
76 bt_ctf_field_type_common_method_freeze freeze;
77 bt_ctf_field_type_common_method_validate validate;
78 bt_ctf_field_type_common_method_set_byte_order set_byte_order;
79 bt_ctf_field_type_common_method_copy copy;
80 bt_ctf_field_type_common_method_compare compare;
81};
82
83struct bt_ctf_field_type_common {
c2606e2f 84 struct bt_ctf_object base;
086dc475
PP
85 enum bt_ctf_field_type_id id;
86 unsigned int alignment;
87
88 /* Virtual table */
89 struct bt_ctf_field_type_common_methods *methods;
90
91 /*
92 * A type can't be modified once it is added to an event or after a
93 * a field has been instanciated from it.
94 */
95 int frozen;
96
97 /*
98 * This flag indicates if the field type is valid. A valid
99 * field type is _always_ frozen. All the nested field types of
100 * a valid field type are also valid (and thus frozen).
101 */
102 int valid;
103
104 /*
105 * Specialized data for either CTF IR or CTF writer APIs.
106 * Having this here ensures that:
107 *
108 * * The type-specific common data is always found at the same
109 * offset when the common API has a `struct
110 * bt_ctf_field_type_common *` so that you can cast it to `struct
111 * bt_ctf_field_type_common_integer *` for example and access the
112 * common integer field type fields.
113 *
114 * * The specific CTF IR and CTF writer APIs can access their
115 * specific field type fields in this union at an offset known
116 * at build time. This avoids a pointer to specific data so
117 * that all the fields, common or specific, of a CTF IR
118 * integer field type or of a CTF writer integer field type,
119 * for example, are contained within the same contiguous block
120 * of memory.
121 */
122 union {
123 struct {
124 } ir;
125 struct {
126 void *serialize_func;
127 } writer;
128 } spec;
129};
130
131struct bt_ctf_field_type_common_integer {
132 struct bt_ctf_field_type_common common;
133
134 /* Owned by this */
135 struct bt_ctf_clock_class *mapped_clock_class;
136
137 enum bt_ctf_byte_order user_byte_order;
d7279670 138 bt_ctf_bool is_signed;
086dc475
PP
139 unsigned int size;
140 enum bt_ctf_integer_base base;
141 enum bt_ctf_string_encoding encoding;
142};
143
144struct bt_ctf_enumeration_mapping {
145 union {
146 uint64_t _unsigned;
147 int64_t _signed;
148 } range_start;
149 union {
150 uint64_t _unsigned;
151 int64_t _signed;
152 } range_end;
153 GQuark string;
154};
155
156struct bt_ctf_field_type_common_enumeration {
157 struct bt_ctf_field_type_common common;
158
159 /* Owned by this */
160 struct bt_ctf_field_type_common_integer *container_ft;
161
162 /* Array of `struct bt_ctf_enumeration_mapping *`, owned by this */
163 GPtrArray *entries;
164
165 /* Only set during validation */
d7279670 166 bt_ctf_bool has_overlapping_ranges;
086dc475
PP
167};
168
169enum bt_ctf_field_type_enumeration_mapping_iterator_type {
170 CTF_ITERATOR_BY_NAME,
171 CTF_ITERATOR_BY_SIGNED_VALUE,
172 CTF_ITERATOR_BY_UNSIGNED_VALUE,
173};
174
175struct bt_ctf_field_type_enumeration_mapping_iterator {
c2606e2f 176 struct bt_ctf_object base;
086dc475
PP
177
178 /* Owned by this */
179 struct bt_ctf_field_type_common_enumeration *enumeration_ft;
180
181 enum bt_ctf_field_type_enumeration_mapping_iterator_type type;
182 int index;
183 union {
184 GQuark name_quark;
185 int64_t signed_value;
186 uint64_t unsigned_value;
187 } u;
188};
189
190struct bt_ctf_field_type_common_floating_point {
191 struct bt_ctf_field_type_common common;
192 enum bt_ctf_byte_order user_byte_order;
193 unsigned int exp_dig;
194 unsigned int mant_dig;
195};
196
197struct bt_ctf_field_type_common_structure_field {
198 GQuark name;
199
200 /* Owned by this */
201 struct bt_ctf_field_type_common *type;
202};
203
204struct bt_ctf_field_type_common_structure {
205 struct bt_ctf_field_type_common common;
206 GHashTable *field_name_to_index;
207
208 /*
209 * Array of `struct bt_ctf_field_type_common_structure_field`,
210 * owned by this
211 */
212 GArray *fields;
213};
214
215struct bt_ctf_field_type_common_variant_choice_range {
216 union {
217 int64_t i;
218 uint64_t u;
219 } lower;
220 union {
221 int64_t i;
222 uint64_t u;
223 } upper;
224};
225
226struct bt_ctf_field_type_common_variant_choice {
227 GQuark name;
228
229 /* Owned by this */
230 struct bt_ctf_field_type_common *type;
231
232 /* Array of `struct bt_ctf_field_type_common_variant_choice_range` */
233 GArray *ranges;
234};
235
236struct bt_ctf_field_type_common_variant {
237 struct bt_ctf_field_type_common common;
238 GString *tag_name;
239 bool choices_up_to_date;
240
241 /* Owned by this */
242 struct bt_ctf_field_type_common_enumeration *tag_ft;
243
244 /* Owned by this */
245 struct bt_ctf_field_path *tag_field_path;
246
247 GHashTable *choice_name_to_index;
248
249 /*
250 * Array of `struct bt_ctf_field_type_common_variant_choice`,
251 * owned by this */
252 GArray *choices;
253};
254
255struct bt_ctf_field_type_common_array {
256 struct bt_ctf_field_type_common common;
257
258 /* Owned by this */
259 struct bt_ctf_field_type_common *element_ft;
260
261 unsigned int length;
262};
263
264struct bt_ctf_field_type_common_sequence {
265 struct bt_ctf_field_type_common common;
266
267 /* Owned by this */
268 struct bt_ctf_field_type_common *element_ft;
269
270 GString *length_field_name;
271
272 /* Owned by this */
273 struct bt_ctf_field_path *length_field_path;
274};
275
276struct bt_ctf_field_type_common_string {
277 struct bt_ctf_field_type_common common;
278 enum bt_ctf_string_encoding encoding;
279};
280
281typedef struct bt_ctf_field_common *(* bt_ctf_field_common_create_func)(
282 struct bt_ctf_field_type_common *);
283
284BT_HIDDEN
285void bt_ctf_field_type_common_initialize(struct bt_ctf_field_type_common *ft,
c2606e2f 286 bool init_bo, bt_ctf_object_release_func release_func,
086dc475
PP
287 struct bt_ctf_field_type_common_methods *methods);
288
289BT_HIDDEN
290void bt_ctf_field_type_common_integer_initialize(
291 struct bt_ctf_field_type_common *ft,
c2606e2f 292 unsigned int size, bt_ctf_object_release_func release_func,
086dc475
PP
293 struct bt_ctf_field_type_common_methods *methods);
294
295BT_HIDDEN
296void bt_ctf_field_type_common_floating_point_initialize(
297 struct bt_ctf_field_type_common *ft,
c2606e2f 298 bt_ctf_object_release_func release_func,
086dc475
PP
299 struct bt_ctf_field_type_common_methods *methods);
300
301BT_HIDDEN
302void bt_ctf_field_type_common_enumeration_initialize(
303 struct bt_ctf_field_type_common *ft,
304 struct bt_ctf_field_type_common *container_ft,
c2606e2f 305 bt_ctf_object_release_func release_func,
086dc475
PP
306 struct bt_ctf_field_type_common_methods *methods);
307
308BT_HIDDEN
309void bt_ctf_field_type_common_string_initialize(
310 struct bt_ctf_field_type_common *ft,
c2606e2f 311 bt_ctf_object_release_func release_func,
086dc475
PP
312 struct bt_ctf_field_type_common_methods *methods);
313
314BT_HIDDEN
315void bt_ctf_field_type_common_structure_initialize(
316 struct bt_ctf_field_type_common *ft,
c2606e2f 317 bt_ctf_object_release_func release_func,
086dc475
PP
318 struct bt_ctf_field_type_common_methods *methods);
319
320BT_HIDDEN
321void bt_ctf_field_type_common_array_initialize(
322 struct bt_ctf_field_type_common *ft,
323 struct bt_ctf_field_type_common *element_ft,
c2606e2f 324 unsigned int length, bt_ctf_object_release_func release_func,
086dc475
PP
325 struct bt_ctf_field_type_common_methods *methods);
326
327BT_HIDDEN
328void bt_ctf_field_type_common_sequence_initialize(
329 struct bt_ctf_field_type_common *ft,
330 struct bt_ctf_field_type_common *element_ft,
331 const char *length_field_name,
c2606e2f 332 bt_ctf_object_release_func release_func,
086dc475
PP
333 struct bt_ctf_field_type_common_methods *methods);
334
335BT_HIDDEN
336void bt_ctf_field_type_common_variant_initialize(
337 struct bt_ctf_field_type_common *ft,
338 struct bt_ctf_field_type_common *tag_ft,
339 const char *tag_name,
c2606e2f 340 bt_ctf_object_release_func release_func,
086dc475
PP
341 struct bt_ctf_field_type_common_methods *methods);
342
343BT_HIDDEN
c2606e2f 344void bt_ctf_field_type_common_integer_destroy(struct bt_ctf_object *obj);
086dc475
PP
345
346BT_HIDDEN
c2606e2f 347void bt_ctf_field_type_common_floating_point_destroy(struct bt_ctf_object *obj);
086dc475
PP
348
349BT_HIDDEN
c2606e2f 350void bt_ctf_field_type_common_enumeration_destroy_recursive(struct bt_ctf_object *obj);
086dc475
PP
351
352BT_HIDDEN
c2606e2f 353void bt_ctf_field_type_common_string_destroy(struct bt_ctf_object *obj);
086dc475
PP
354
355BT_HIDDEN
c2606e2f 356void bt_ctf_field_type_common_structure_destroy_recursive(struct bt_ctf_object *obj);
086dc475
PP
357
358BT_HIDDEN
c2606e2f 359void bt_ctf_field_type_common_array_destroy_recursive(struct bt_ctf_object *obj);
086dc475
PP
360
361BT_HIDDEN
c2606e2f 362void bt_ctf_field_type_common_sequence_destroy_recursive(struct bt_ctf_object *obj);
086dc475
PP
363
364BT_HIDDEN
c2606e2f 365void bt_ctf_field_type_common_variant_destroy_recursive(struct bt_ctf_object *obj);
086dc475
PP
366
367BT_HIDDEN
368int bt_ctf_field_type_common_integer_validate(struct bt_ctf_field_type_common *ft);
369
370BT_HIDDEN
371int bt_ctf_field_type_common_enumeration_validate_recursive(
372 struct bt_ctf_field_type_common *ft);
373
374BT_HIDDEN
375int bt_ctf_field_type_common_sequence_validate_recursive(
376 struct bt_ctf_field_type_common *ft);
377
378BT_HIDDEN
379int bt_ctf_field_type_common_array_validate_recursive(
380 struct bt_ctf_field_type_common *ft);
381
382BT_HIDDEN
383int bt_ctf_field_type_common_structure_validate_recursive(
384 struct bt_ctf_field_type_common *ft);
385
386BT_HIDDEN
387int bt_ctf_field_type_common_variant_validate_recursive(
388 struct bt_ctf_field_type_common *type);
389
390BT_HIDDEN
391int bt_ctf_field_type_common_validate(struct bt_ctf_field_type_common *ft);
392
393BT_HIDDEN
394int bt_ctf_field_type_common_integer_get_size(struct bt_ctf_field_type_common *ft);
395
396BT_HIDDEN
d7279670 397bt_ctf_bool bt_ctf_field_type_common_integer_is_signed(struct bt_ctf_field_type_common *ft);
086dc475
PP
398
399BT_HIDDEN
400int bt_ctf_field_type_common_integer_set_is_signed(struct bt_ctf_field_type_common *ft,
d7279670 401 bt_ctf_bool is_signed);
086dc475
PP
402
403BT_HIDDEN
404int bt_ctf_field_type_common_integer_set_size(struct bt_ctf_field_type_common *ft,
405 unsigned int size);
406
407BT_HIDDEN
408enum bt_ctf_integer_base bt_ctf_field_type_common_integer_get_base(
409 struct bt_ctf_field_type_common *ft);
410
411BT_HIDDEN
412int bt_ctf_field_type_common_integer_set_base(struct bt_ctf_field_type_common *ft,
413 enum bt_ctf_integer_base base);
414
415BT_HIDDEN
416enum bt_ctf_string_encoding bt_ctf_field_type_common_integer_get_encoding(
417 struct bt_ctf_field_type_common *ft);
418
419BT_HIDDEN
420int bt_ctf_field_type_common_integer_set_encoding(struct bt_ctf_field_type_common *ft,
421 enum bt_ctf_string_encoding encoding);
422
423BT_HIDDEN
424struct bt_ctf_clock_class *bt_ctf_field_type_common_integer_borrow_mapped_clock_class(
425 struct bt_ctf_field_type_common *ft);
426
427BT_HIDDEN
428int bt_ctf_field_type_common_integer_set_mapped_clock_class_no_check_frozen(
429 struct bt_ctf_field_type_common *ft,
430 struct bt_ctf_clock_class *clock_class);
431
432BT_HIDDEN
433int bt_ctf_field_type_common_integer_set_mapped_clock_class(
434 struct bt_ctf_field_type_common *ft,
435 struct bt_ctf_clock_class *clock_class);
436
437BT_HIDDEN
438struct bt_ctf_field_type_enumeration_mapping_iterator *
439bt_ctf_field_type_common_enumeration_find_mappings_by_name(
440 struct bt_ctf_field_type_common *ft, const char *name);
441
442BT_HIDDEN
443struct bt_ctf_field_type_enumeration_mapping_iterator *
444bt_ctf_field_type_common_enumeration_signed_find_mappings_by_value(
445 struct bt_ctf_field_type_common *ft, int64_t value);
446
447BT_HIDDEN
448struct bt_ctf_field_type_enumeration_mapping_iterator *
449bt_ctf_field_type_common_enumeration_unsigned_find_mappings_by_value(
450 struct bt_ctf_field_type_common *ft, uint64_t value);
451
f3847c75
SM
452BT_HIDDEN
453int bt_ctf_field_type_enumeration_mapping_iterator_next(
454 struct bt_ctf_field_type_enumeration_mapping_iterator *iter);
455
456BT_HIDDEN
457int bt_ctf_field_type_enumeration_mapping_iterator_signed_get(
458 struct bt_ctf_field_type_enumeration_mapping_iterator *iter,
459 const char **mapping_name, int64_t *range_begin,
460 int64_t *range_end);
461
462BT_HIDDEN
463int bt_ctf_field_type_enumeration_mapping_iterator_unsigned_get(
464 struct bt_ctf_field_type_enumeration_mapping_iterator *iter,
465 const char **mapping_name, uint64_t *range_begin,
466 uint64_t *range_end);
467
086dc475
PP
468BT_HIDDEN
469int bt_ctf_field_type_common_enumeration_signed_get_mapping_by_index(
470 struct bt_ctf_field_type_common *ft, uint64_t index,
471 const char **mapping_name, int64_t *range_begin,
472 int64_t *range_end);
473
474BT_HIDDEN
475int bt_ctf_field_type_common_enumeration_unsigned_get_mapping_by_index(
476 struct bt_ctf_field_type_common *ft, uint64_t index,
477 const char **mapping_name, uint64_t *range_begin,
478 uint64_t *range_end);
479
480BT_HIDDEN
481struct bt_ctf_field_type_common *
482bt_ctf_field_type_common_enumeration_borrow_container_field_type(
483 struct bt_ctf_field_type_common *ft);
484
485BT_HIDDEN
486int bt_ctf_field_type_common_enumeration_signed_add_mapping(
487 struct bt_ctf_field_type_common *ft, const char *string,
488 int64_t range_start, int64_t range_end);
489
490BT_HIDDEN
491int bt_ctf_field_type_common_enumeration_unsigned_add_mapping(
492 struct bt_ctf_field_type_common *ft, const char *string,
493 uint64_t range_start, uint64_t range_end);
494
495BT_HIDDEN
496int64_t bt_ctf_field_type_common_enumeration_get_mapping_count(
497 struct bt_ctf_field_type_common *ft);
498
499BT_HIDDEN
500int bt_ctf_field_type_common_floating_point_get_exponent_digits(
501 struct bt_ctf_field_type_common *ft);
502
503BT_HIDDEN
504int bt_ctf_field_type_common_floating_point_set_exponent_digits(
505 struct bt_ctf_field_type_common *ft,
506 unsigned int exponent_digits);
507
508BT_HIDDEN
509int bt_ctf_field_type_common_floating_point_get_mantissa_digits(
510 struct bt_ctf_field_type_common *type);
511
512BT_HIDDEN
513int bt_ctf_field_type_common_floating_point_set_mantissa_digits(
514 struct bt_ctf_field_type_common *ft, unsigned int mantissa_digits);
515
516BT_HIDDEN
517int bt_ctf_field_type_common_structure_replace_field(
518 struct bt_ctf_field_type_common *ft,
519 const char *field_name,
520 struct bt_ctf_field_type_common *field_type);
521
522BT_HIDDEN
523int bt_ctf_field_type_common_structure_add_field(struct bt_ctf_field_type_common *ft,
524 struct bt_ctf_field_type_common *field_type,
525 const char *field_name);
526
527BT_HIDDEN
528int64_t bt_ctf_field_type_common_structure_get_field_count(
529 struct bt_ctf_field_type_common *ft);
530
531BT_HIDDEN
532int bt_ctf_field_type_common_structure_borrow_field_by_index(
533 struct bt_ctf_field_type_common *ft,
534 const char **field_name,
535 struct bt_ctf_field_type_common **field_type, uint64_t index);
536
537BT_HIDDEN
538struct bt_ctf_field_type_common *
539bt_ctf_field_type_common_structure_borrow_field_type_by_name(
540 struct bt_ctf_field_type_common *ft, const char *name);
541
542BT_HIDDEN
543struct bt_ctf_field_type_common *
544bt_ctf_field_type_common_variant_borrow_tag_field_type(
545 struct bt_ctf_field_type_common *ft);
546
547BT_HIDDEN
548const char *bt_ctf_field_type_common_variant_get_tag_name(
549 struct bt_ctf_field_type_common *ft);
550
551BT_HIDDEN
552int bt_ctf_field_type_common_variant_set_tag_name(
553 struct bt_ctf_field_type_common *ft, const char *name);
554
555BT_HIDDEN
556int bt_ctf_field_type_common_variant_add_field(struct bt_ctf_field_type_common *ft,
557 struct bt_ctf_field_type_common *field_type,
558 const char *field_name);
559
560BT_HIDDEN
561int bt_ctf_field_type_common_variant_update_choices(
562 struct bt_ctf_field_type_common *ft);
563
564BT_HIDDEN
565struct bt_ctf_field_type_common *
566bt_ctf_field_type_common_variant_borrow_field_type_by_name(
567 struct bt_ctf_field_type_common *ft,
568 const char *field_name);
569
570BT_HIDDEN
571int64_t bt_ctf_field_type_common_variant_get_field_count(
572 struct bt_ctf_field_type_common *ft);
573
574BT_HIDDEN
575int bt_ctf_field_type_common_variant_borrow_field_by_index(
576 struct bt_ctf_field_type_common *ft,
577 const char **field_name,
578 struct bt_ctf_field_type_common **field_type, uint64_t index);
579
580BT_HIDDEN
581struct bt_ctf_field_type_common *
582bt_ctf_field_type_common_array_borrow_element_field_type(
583 struct bt_ctf_field_type_common *ft);
584
585BT_HIDDEN
586int bt_ctf_field_type_common_array_set_element_field_type(
587 struct bt_ctf_field_type_common *ft,
588 struct bt_ctf_field_type_common *element_ft);
589
590BT_HIDDEN
591int64_t bt_ctf_field_type_common_array_get_length(struct bt_ctf_field_type_common *ft);
592
593BT_HIDDEN
594struct bt_ctf_field_type_common *
595bt_ctf_field_type_common_sequence_borrow_element_field_type(
596 struct bt_ctf_field_type_common *ft);
597
598BT_HIDDEN
599int bt_ctf_field_type_common_sequence_set_element_field_type(
600 struct bt_ctf_field_type_common *ft,
601 struct bt_ctf_field_type_common *element_ft);
602
603BT_HIDDEN
604const char *bt_ctf_field_type_common_sequence_get_length_field_name(
605 struct bt_ctf_field_type_common *ft);
606
607BT_HIDDEN
608enum bt_ctf_string_encoding bt_ctf_field_type_common_string_get_encoding(
609 struct bt_ctf_field_type_common *ft);
610
611BT_HIDDEN
612int bt_ctf_field_type_common_string_set_encoding(struct bt_ctf_field_type_common *ft,
613 enum bt_ctf_string_encoding encoding);
614
615BT_HIDDEN
616int bt_ctf_field_type_common_get_alignment(struct bt_ctf_field_type_common *type);
617
618BT_HIDDEN
619int bt_ctf_field_type_common_set_alignment(struct bt_ctf_field_type_common *ft,
620 unsigned int alignment);
621
622BT_HIDDEN
623enum bt_ctf_byte_order bt_ctf_field_type_common_get_byte_order(
624 struct bt_ctf_field_type_common *ft);
625
626BT_HIDDEN
627int bt_ctf_field_type_common_set_byte_order(struct bt_ctf_field_type_common *ft,
628 enum bt_ctf_byte_order byte_order);
629
630BT_HIDDEN
631enum bt_ctf_field_type_id bt_ctf_field_type_common_get_type_id(
632 struct bt_ctf_field_type_common *ft);
633
634BT_HIDDEN
635void bt_ctf_field_type_common_freeze(struct bt_ctf_field_type_common *ft);
636
637BT_HIDDEN
638struct bt_ctf_field_type_common *
639bt_ctf_field_type_common_variant_borrow_field_type_signed(
640 struct bt_ctf_field_type_common_variant *var_ft,
641 int64_t tag_value);
642
643BT_HIDDEN
644struct bt_ctf_field_type_common *
645bt_ctf_field_type_common_variant_borrow_field_type_unsigned(
646 struct bt_ctf_field_type_common_variant *var_ft,
647 uint64_t tag_value);
648
649BT_HIDDEN
650struct bt_ctf_field_type_common *bt_ctf_field_type_common_copy(
651 struct bt_ctf_field_type_common *ft);
652
653BT_HIDDEN
654int bt_ctf_field_type_common_structure_get_field_name_index(
655 struct bt_ctf_field_type_common *ft, const char *name);
656
657BT_HIDDEN
658int bt_ctf_field_type_common_variant_get_field_name_index(
659 struct bt_ctf_field_type_common *ft, const char *name);
660
661BT_HIDDEN
662int bt_ctf_field_type_common_sequence_set_length_field_path(
663 struct bt_ctf_field_type_common *ft, struct bt_ctf_field_path *path);
664
665BT_HIDDEN
666int bt_ctf_field_type_common_variant_set_tag_field_path(
667 struct bt_ctf_field_type_common *ft,
668 struct bt_ctf_field_path *path);
669
670BT_HIDDEN
671int bt_ctf_field_type_common_variant_set_tag_field_type(
672 struct bt_ctf_field_type_common *ft,
673 struct bt_ctf_field_type_common *tag_ft);
674
675BT_HIDDEN
676void bt_ctf_field_type_common_generic_freeze(struct bt_ctf_field_type_common *ft);
677
678BT_HIDDEN
679void bt_ctf_field_type_common_enumeration_freeze_recursive(
680 struct bt_ctf_field_type_common *ft);
681
682BT_HIDDEN
683void bt_ctf_field_type_common_structure_freeze_recursive(
684 struct bt_ctf_field_type_common *ft);
685
686BT_HIDDEN
687void bt_ctf_field_type_common_variant_freeze_recursive(
688 struct bt_ctf_field_type_common *ft);
689
690BT_HIDDEN
691void bt_ctf_field_type_common_array_freeze_recursive(
692 struct bt_ctf_field_type_common *ft);
693
694BT_HIDDEN
695void bt_ctf_field_type_common_sequence_freeze_recursive(
696 struct bt_ctf_field_type_common *type);
697
698BT_HIDDEN
699void bt_ctf_field_type_common_integer_set_byte_order(
700 struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order);
701
702BT_HIDDEN
703void bt_ctf_field_type_common_enumeration_set_byte_order_recursive(
704 struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order);
705
706BT_HIDDEN
707void bt_ctf_field_type_common_floating_point_set_byte_order(
708 struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order);
709
710BT_HIDDEN
711void bt_ctf_field_type_common_structure_set_byte_order_recursive(
712 struct bt_ctf_field_type_common *ft,
713 enum bt_ctf_byte_order byte_order);
714
715BT_HIDDEN
716void bt_ctf_field_type_common_variant_set_byte_order_recursive(
717 struct bt_ctf_field_type_common *ft,
718 enum bt_ctf_byte_order byte_order);
719
720BT_HIDDEN
721void bt_ctf_field_type_common_array_set_byte_order_recursive(
722 struct bt_ctf_field_type_common *ft,
723 enum bt_ctf_byte_order byte_order);
724
725BT_HIDDEN
726void bt_ctf_field_type_common_sequence_set_byte_order_recursive(
727 struct bt_ctf_field_type_common *ft,
728 enum bt_ctf_byte_order byte_order);
729
730BT_HIDDEN
731int bt_ctf_field_type_common_integer_compare(struct bt_ctf_field_type_common *ft_a,
732 struct bt_ctf_field_type_common *ft_b);
733
734BT_HIDDEN
735int bt_ctf_field_type_common_floating_point_compare(
736 struct bt_ctf_field_type_common *ft_a,
737 struct bt_ctf_field_type_common *ft_b);
738
739BT_HIDDEN
740int bt_ctf_field_type_common_enumeration_compare_recursive(
741 struct bt_ctf_field_type_common *ft_a,
742 struct bt_ctf_field_type_common *ft_b);
743
744BT_HIDDEN
745int bt_ctf_field_type_common_string_compare(struct bt_ctf_field_type_common *ft_a,
746 struct bt_ctf_field_type_common *ft_b);
747
748BT_HIDDEN
749int bt_ctf_field_type_common_structure_compare_recursive(
750 struct bt_ctf_field_type_common *ft_a,
751 struct bt_ctf_field_type_common *ft_b);
752
753BT_HIDDEN
754int bt_ctf_field_type_common_variant_compare_recursive(
755 struct bt_ctf_field_type_common *ft_a,
756 struct bt_ctf_field_type_common *ft_b);
757
758BT_HIDDEN
759int bt_ctf_field_type_common_array_compare_recursive(
760 struct bt_ctf_field_type_common *ft_a,
761 struct bt_ctf_field_type_common *ft_b);
762
763BT_HIDDEN
764int bt_ctf_field_type_common_sequence_compare_recursive(
765 struct bt_ctf_field_type_common *ft_a,
766 struct bt_ctf_field_type_common *ft_b);
767
768BT_HIDDEN
769int bt_ctf_field_type_common_compare(struct bt_ctf_field_type_common *ft_a,
770 struct bt_ctf_field_type_common *ft_b);
771
772BT_HIDDEN
773int64_t bt_ctf_field_type_common_get_field_count(struct bt_ctf_field_type_common *ft);
774
775BT_HIDDEN
776struct bt_ctf_field_type_common *bt_ctf_field_type_common_borrow_field_at_index(
777 struct bt_ctf_field_type_common *ft, int index);
778
779BT_HIDDEN
780int bt_ctf_field_type_common_get_field_index(struct bt_ctf_field_type_common *ft,
781 const char *name);
782
783BT_HIDDEN
784struct bt_ctf_field_path *bt_ctf_field_type_common_variant_borrow_tag_field_path(
785 struct bt_ctf_field_type_common *ft);
786
787BT_HIDDEN
788struct bt_ctf_field_path *bt_ctf_field_type_common_sequence_borrow_length_field_path(
789 struct bt_ctf_field_type_common *ft);
790
791BT_HIDDEN
792int bt_ctf_field_type_common_validate_single_clock_class(
793 struct bt_ctf_field_type_common *ft,
794 struct bt_ctf_clock_class **expected_clock_class);
795
796BT_HIDDEN
797int64_t bt_ctf_field_type_common_variant_find_choice_index(
798 struct bt_ctf_field_type_common *ft, uint64_t uval,
799 bool is_signed);
8deee039
PP
800
801BT_HIDDEN
802int bt_ctf_field_type_serialize_recursive(struct bt_ctf_field_type *type,
803 struct metadata_context *context);
804
805BT_HIDDEN
806struct bt_ctf_field_type *bt_ctf_field_type_copy(struct bt_ctf_field_type *ft);
807
808#endif /* BABELTRACE_CTF_WRITER_FIELD_TYPES_INTERNAL_H */
This page took 0.086197 seconds and 4 git commands to generate.