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