Fix: freeze field type unconditionally
[babeltrace.git] / include / babeltrace / ctf-ir / field-types-internal.h
CommitLineData
2e33ac5a
PP
1#ifndef BABELTRACE_CTF_IR_FIELD_TYPES_INTERNAL_H
2#define BABELTRACE_CTF_IR_FIELD_TYPES_INTERNAL_H
273b65be
JG
3
4/*
2e33ac5a 5 * BabelTrace - CTF IR: Event field types internal
273b65be 6 *
de9dd397 7 * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
273b65be
JG
8 *
9 * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
10 *
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:
17 *
18 * The above copyright notice and this permission notice shall be included in
19 * all copies or substantial portions of the Software.
20 *
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 * SOFTWARE.
28 */
29
3dca2276 30#include <babeltrace/assert-pre-internal.h>
ac0c6bdd 31#include <babeltrace/ctf-ir/clock-class.h>
4e8304f7 32#include <babeltrace/ctf-ir/field-types.h>
273b65be 33#include <babeltrace/babeltrace-internal.h>
83509119 34#include <babeltrace/object-internal.h>
c55a9f58 35#include <babeltrace/types.h>
3dca2276 36#include <stdint.h>
273b65be
JG
37#include <glib.h>
38
3dca2276
PP
39#define BT_ASSERT_PRE_FT_COMMON_HAS_ID(_ft, _type_id, _name) \
40 BT_ASSERT_PRE(((struct bt_field_type_common *) (_ft))->id == (_type_id), \
41 _name " has the wrong type ID: expected-type-id=%s, " \
42 "%![ft-]+_F", bt_common_field_type_id_string(_type_id), (_ft))
43
44#define BT_ASSERT_PRE_FT_HOT(_ft, _name) \
45 BT_ASSERT_PRE_HOT((_ft), (_name), ": +%!+_F", (_ft))
46
312c056a
PP
47#define BT_FIELD_TYPE_COMMON_STRUCTURE_FIELD_AT_INDEX(_ft, _index) \
48 (&g_array_index(((struct bt_field_type_common_structure *) (_ft))->fields, \
49 struct bt_field_type_common_structure_field, (_index)))
50
51#define BT_FIELD_TYPE_COMMON_VARIANT_CHOICE_AT_INDEX(_ft, _index) \
52 (&g_array_index(((struct bt_field_type_common_variant *) (_ft))->choices, \
53 struct bt_field_type_common_variant_choice, (_index)))
54
3dca2276
PP
55struct bt_field_common;
56struct bt_field_type_common;
57struct bt_field_type;
58
59typedef void (*bt_field_type_common_method_freeze)(
60 struct bt_field_type_common *);
61typedef int (*bt_field_type_common_method_validate)(
62 struct bt_field_type_common *);
63typedef void (*bt_field_type_common_method_set_byte_order)(
64 struct bt_field_type_common *, enum bt_byte_order);
65typedef struct bt_field_type_common *(*bt_field_type_common_method_copy)(
66 struct bt_field_type_common *);
67typedef int (*bt_field_type_common_method_compare)(
68 struct bt_field_type_common *,
69 struct bt_field_type_common *);
70
71struct bt_field_type_common_methods {
72 bt_field_type_common_method_freeze freeze;
73 bt_field_type_common_method_validate validate;
74 bt_field_type_common_method_set_byte_order set_byte_order;
75 bt_field_type_common_method_copy copy;
76 bt_field_type_common_method_compare compare;
77};
273b65be 78
3dca2276 79struct bt_field_type_common {
83509119 80 struct bt_object base;
50842bdc 81 enum bt_field_type_id id;
dc3fffef 82 unsigned int alignment;
3dca2276
PP
83
84 /* Virtual table */
85 struct bt_field_type_common_methods *methods;
86
273b65be
JG
87 /*
88 * A type can't be modified once it is added to an event or after a
89 * a field has been instanciated from it.
90 */
91 int frozen;
81e36fac
PP
92
93 /*
94 * This flag indicates if the field type is valid. A valid
95 * field type is _always_ frozen. All the nested field types of
96 * a valid field type are also valid (and thus frozen).
97 */
98 int valid;
3dca2276
PP
99
100 /*
101 * Specialized data for either CTF IR or CTF writer APIs.
102 * Having this here ensures that:
103 *
104 * * The type-specific common data is always found at the same
105 * offset when the common API has a `struct
106 * bt_field_type_common *` so that you can cast it to `struct
107 * bt_field_type_common_integer *` for example and access the
108 * common integer field type fields.
109 *
110 * * The specific CTF IR and CTF writer APIs can access their
111 * specific field type fields in this union at an offset known
112 * at build time. This avoids a pointer to specific data so
113 * that all the fields, common or specific, of a CTF IR
114 * integer field type or of a CTF writer integer field type,
115 * for example, are contained within the same contiguous block
116 * of memory.
117 */
118 union {
119 struct {
120 } ir;
121 struct {
122 void *serialize_func;
123 } writer;
124 } spec;
273b65be
JG
125};
126
3dca2276
PP
127struct bt_field_type_common_integer {
128 struct bt_field_type_common common;
312c056a
PP
129
130 /* Owned by this */
3dca2276 131 struct bt_clock_class *mapped_clock_class;
312c056a 132
50842bdc 133 enum bt_byte_order user_byte_order;
c55a9f58 134 bt_bool is_signed;
dc3fffef 135 unsigned int size;
50842bdc
PP
136 enum bt_integer_base base;
137 enum bt_string_encoding encoding;
273b65be
JG
138};
139
140struct enumeration_mapping {
b92ddaaa
JG
141 union {
142 uint64_t _unsigned;
143 int64_t _signed;
144 } range_start;
b92ddaaa
JG
145 union {
146 uint64_t _unsigned;
147 int64_t _signed;
148 } range_end;
273b65be
JG
149 GQuark string;
150};
151
3dca2276
PP
152struct bt_field_type_common_enumeration {
153 struct bt_field_type_common common;
312c056a
PP
154
155 /* Owned by this */
3dca2276 156 struct bt_field_type_common_integer *container_ft;
312c056a
PP
157
158 /* Array of `struct enumeration_mapping *`, owned by this */
159 GPtrArray *entries;
160
161 /* Only set during validation */
c55a9f58 162 bt_bool has_overlapping_ranges;
96e8f959
MD
163};
164
50842bdc 165enum bt_field_type_enumeration_mapping_iterator_type {
96e8f959
MD
166 ITERATOR_BY_NAME,
167 ITERATOR_BY_SIGNED_VALUE,
168 ITERATOR_BY_UNSIGNED_VALUE,
169};
170
50842bdc 171struct bt_field_type_enumeration_mapping_iterator {
96e8f959 172 struct bt_object base;
312c056a
PP
173
174 /* Owned by this */
3dca2276 175 struct bt_field_type_common_enumeration *enumeration_ft;
312c056a 176
50842bdc 177 enum bt_field_type_enumeration_mapping_iterator_type type;
96e8f959
MD
178 int index;
179 union {
180 GQuark name_quark;
181 int64_t signed_value;
182 uint64_t unsigned_value;
183 } u;
273b65be
JG
184};
185
3dca2276
PP
186struct bt_field_type_common_floating_point {
187 struct bt_field_type_common common;
50842bdc 188 enum bt_byte_order user_byte_order;
dc3fffef
PP
189 unsigned int exp_dig;
190 unsigned int mant_dig;
273b65be
JG
191};
192
312c056a 193struct bt_field_type_common_structure_field {
273b65be 194 GQuark name;
312c056a
PP
195
196 /* Owned by this */
3dca2276 197 struct bt_field_type_common *type;
273b65be
JG
198};
199
3dca2276
PP
200struct bt_field_type_common_structure {
201 struct bt_field_type_common common;
273b65be 202 GHashTable *field_name_to_index;
312c056a
PP
203
204 /*
205 * Array of `struct bt_field_type_common_structure_field`,
206 * owned by this
207 */
208 GArray *fields;
209};
210
211struct bt_field_type_common_variant_choice_range {
212 union {
213 int64_t i;
214 uint64_t u;
215 } lower;
216 union {
217 int64_t i;
218 uint64_t u;
219 } upper;
220};
221
222struct bt_field_type_common_variant_choice {
223 GQuark name;
224
225 /* Owned by this */
226 struct bt_field_type_common *type;
227
228 /* Array of `struct bt_field_type_common_variant_choice_range` */
229 GArray *ranges;
273b65be
JG
230};
231
3dca2276
PP
232struct bt_field_type_common_variant {
233 struct bt_field_type_common common;
273b65be 234 GString *tag_name;
312c056a
PP
235 bool choices_up_to_date;
236
237 /* Owned by this */
3dca2276 238 struct bt_field_type_common_enumeration *tag_ft;
312c056a
PP
239
240 /* Owned by this */
50842bdc 241 struct bt_field_path *tag_field_path;
312c056a
PP
242
243 GHashTable *choice_name_to_index;
244
245 /*
246 * Array of `struct bt_field_type_common_variant_choice`,
247 * owned by this */
248 GArray *choices;
273b65be
JG
249};
250
3dca2276
PP
251struct bt_field_type_common_array {
252 struct bt_field_type_common common;
312c056a
PP
253
254 /* Owned by this */
3dca2276 255 struct bt_field_type_common *element_ft;
312c056a
PP
256
257 unsigned int length;
273b65be
JG
258};
259
3dca2276
PP
260struct bt_field_type_common_sequence {
261 struct bt_field_type_common common;
312c056a
PP
262
263 /* Owned by this */
3dca2276 264 struct bt_field_type_common *element_ft;
312c056a 265
273b65be 266 GString *length_field_name;
312c056a
PP
267
268 /* Owned by this */
50842bdc 269 struct bt_field_path *length_field_path;
273b65be
JG
270};
271
3dca2276
PP
272struct bt_field_type_common_string {
273 struct bt_field_type_common common;
50842bdc 274 enum bt_string_encoding encoding;
273b65be
JG
275};
276
3dca2276
PP
277typedef struct bt_field_common *(* bt_field_common_create_func)(
278 struct bt_field_type_common *);
279
273b65be 280BT_HIDDEN
3dca2276
PP
281void bt_field_type_common_initialize(struct bt_field_type_common *ft,
282 bool init_bo, bt_object_release_func release_func,
283 struct bt_field_type_common_methods *methods);
273b65be
JG
284
285BT_HIDDEN
3dca2276
PP
286void bt_field_type_common_integer_initialize(
287 struct bt_field_type_common *ft,
288 unsigned int size, bt_object_release_func release_func,
289 struct bt_field_type_common_methods *methods);
273b65be
JG
290
291BT_HIDDEN
3dca2276
PP
292void bt_field_type_common_floating_point_initialize(
293 struct bt_field_type_common *ft,
294 bt_object_release_func release_func,
295 struct bt_field_type_common_methods *methods);
273b65be
JG
296
297BT_HIDDEN
3dca2276
PP
298void bt_field_type_common_enumeration_initialize(
299 struct bt_field_type_common *ft,
300 struct bt_field_type_common *container_ft,
301 bt_object_release_func release_func,
302 struct bt_field_type_common_methods *methods);
273b65be 303
9ce21c30 304BT_HIDDEN
3dca2276
PP
305void bt_field_type_common_string_initialize(
306 struct bt_field_type_common *ft,
307 bt_object_release_func release_func,
308 struct bt_field_type_common_methods *methods);
9ce21c30 309
39a5e0db 310BT_HIDDEN
3dca2276
PP
311void bt_field_type_common_structure_initialize(
312 struct bt_field_type_common *ft,
313 bt_object_release_func release_func,
314 struct bt_field_type_common_methods *methods);
736133f1
JG
315
316BT_HIDDEN
3dca2276
PP
317void bt_field_type_common_array_initialize(
318 struct bt_field_type_common *ft,
319 struct bt_field_type_common *element_ft,
320 unsigned int length, bt_object_release_func release_func,
321 struct bt_field_type_common_methods *methods);
79422a2b
PP
322
323BT_HIDDEN
3dca2276
PP
324void bt_field_type_common_sequence_initialize(
325 struct bt_field_type_common *ft,
326 struct bt_field_type_common *element_ft,
327 const char *length_field_name,
328 bt_object_release_func release_func,
329 struct bt_field_type_common_methods *methods);
aa4e271c
JG
330
331BT_HIDDEN
3dca2276
PP
332void bt_field_type_common_variant_initialize(
333 struct bt_field_type_common *ft,
334 struct bt_field_type_common *tag_ft,
335 const char *tag_name,
336 bt_object_release_func release_func,
337 struct bt_field_type_common_methods *methods);
4a1e8671
JG
338
339BT_HIDDEN
3dca2276 340void bt_field_type_common_integer_destroy(struct bt_object *obj);
3f39933a
JG
341
342BT_HIDDEN
3dca2276 343void bt_field_type_common_floating_point_destroy(struct bt_object *obj);
3f39933a 344
626e93aa 345BT_HIDDEN
3dca2276 346void bt_field_type_common_enumeration_destroy_recursive(struct bt_object *obj);
626e93aa
PP
347
348BT_HIDDEN
3dca2276 349void bt_field_type_common_string_destroy(struct bt_object *obj);
626e93aa 350
09840de5 351BT_HIDDEN
3dca2276 352void bt_field_type_common_structure_destroy_recursive(struct bt_object *obj);
09840de5
PP
353
354BT_HIDDEN
3dca2276 355void bt_field_type_common_array_destroy_recursive(struct bt_object *obj);
09840de5
PP
356
357BT_HIDDEN
3dca2276
PP
358void bt_field_type_common_sequence_destroy_recursive(struct bt_object *obj);
359
360BT_HIDDEN
361void bt_field_type_common_variant_destroy_recursive(struct bt_object *obj);
362
363BT_HIDDEN
364int bt_field_type_common_integer_validate(struct bt_field_type_common *ft);
365
366BT_HIDDEN
367int bt_field_type_common_enumeration_validate_recursive(
368 struct bt_field_type_common *ft);
369
370BT_HIDDEN
371int bt_field_type_common_sequence_validate_recursive(
372 struct bt_field_type_common *ft);
373
374BT_HIDDEN
375int bt_field_type_common_array_validate_recursive(
376 struct bt_field_type_common *ft);
377
378BT_HIDDEN
379int bt_field_type_common_structure_validate_recursive(
380 struct bt_field_type_common *ft);
381
382BT_HIDDEN
383int bt_field_type_common_variant_validate_recursive(
384 struct bt_field_type_common *type);
385
386BT_HIDDEN
387int bt_field_type_common_validate(struct bt_field_type_common *ft);
388
389BT_HIDDEN
390int bt_field_type_common_integer_get_size(struct bt_field_type_common *ft);
391
392BT_HIDDEN
393bt_bool bt_field_type_common_integer_is_signed(struct bt_field_type_common *ft);
394
395BT_HIDDEN
396int bt_field_type_common_integer_set_is_signed(struct bt_field_type_common *ft,
397 bt_bool is_signed);
398
399BT_HIDDEN
400int bt_field_type_common_integer_set_size(struct bt_field_type_common *ft,
401 unsigned int size);
402
403BT_HIDDEN
404enum bt_integer_base bt_field_type_common_integer_get_base(
405 struct bt_field_type_common *ft);
09840de5 406
e011d2c1 407BT_HIDDEN
3dca2276
PP
408int bt_field_type_common_integer_set_base(struct bt_field_type_common *ft,
409 enum bt_integer_base base);
410
411BT_HIDDEN
412enum bt_string_encoding bt_field_type_common_integer_get_encoding(
413 struct bt_field_type_common *ft);
414
415BT_HIDDEN
416int bt_field_type_common_integer_set_encoding(struct bt_field_type_common *ft,
417 enum bt_string_encoding encoding);
418
419BT_HIDDEN
094ff7c0 420struct bt_clock_class *bt_field_type_common_integer_borrow_mapped_clock_class(
3dca2276
PP
421 struct bt_field_type_common *ft);
422
423BT_HIDDEN
424int bt_field_type_common_integer_set_mapped_clock_class_no_check_frozen(
425 struct bt_field_type_common *ft,
50842bdc 426 struct bt_clock_class *clock_class);
e011d2c1 427
3dca2276
PP
428BT_HIDDEN
429int bt_field_type_common_integer_set_mapped_clock_class(
430 struct bt_field_type_common *ft,
431 struct bt_clock_class *clock_class);
b7a73f0f 432
3dca2276
PP
433BT_HIDDEN
434struct bt_field_type_enumeration_mapping_iterator *
435bt_field_type_common_enumeration_find_mappings_by_name(
436 struct bt_field_type_common *ft, const char *name);
b7a73f0f 437
3dca2276
PP
438BT_HIDDEN
439struct bt_field_type_enumeration_mapping_iterator *
440bt_field_type_common_enumeration_signed_find_mappings_by_value(
441 struct bt_field_type_common *ft, int64_t value);
442
443BT_HIDDEN
444struct bt_field_type_enumeration_mapping_iterator *
445bt_field_type_common_enumeration_unsigned_find_mappings_by_value(
446 struct bt_field_type_common *ft, uint64_t value);
447
448BT_HIDDEN
449int bt_field_type_common_enumeration_signed_get_mapping_by_index(
450 struct bt_field_type_common *ft, uint64_t index,
451 const char **mapping_name, int64_t *range_begin,
452 int64_t *range_end);
453
454BT_HIDDEN
455int bt_field_type_common_enumeration_unsigned_get_mapping_by_index(
456 struct bt_field_type_common *ft, uint64_t index,
457 const char **mapping_name, uint64_t *range_begin,
458 uint64_t *range_end);
459
460BT_HIDDEN
094ff7c0
PP
461struct bt_field_type_common *
462bt_field_type_common_enumeration_borrow_container_field_type(
3dca2276
PP
463 struct bt_field_type_common *ft);
464
465BT_HIDDEN
466int bt_field_type_common_enumeration_signed_add_mapping(
467 struct bt_field_type_common *ft, const char *string,
468 int64_t range_start, int64_t range_end);
469
470BT_HIDDEN
471int bt_field_type_common_enumeration_unsigned_add_mapping(
472 struct bt_field_type_common *ft, const char *string,
473 uint64_t range_start, uint64_t range_end);
474
475BT_HIDDEN
476int64_t bt_field_type_common_enumeration_get_mapping_count(
477 struct bt_field_type_common *ft);
478
479BT_HIDDEN
480int bt_field_type_common_floating_point_get_exponent_digits(
481 struct bt_field_type_common *ft);
482
483BT_HIDDEN
484int bt_field_type_common_floating_point_set_exponent_digits(
485 struct bt_field_type_common *ft,
486 unsigned int exponent_digits);
487
488BT_HIDDEN
489int bt_field_type_common_floating_point_get_mantissa_digits(
490 struct bt_field_type_common *type);
491
492BT_HIDDEN
493int bt_field_type_common_floating_point_set_mantissa_digits(
494 struct bt_field_type_common *ft, unsigned int mantissa_digits);
495
496BT_HIDDEN
497int bt_field_type_common_structure_replace_field(
498 struct bt_field_type_common *ft,
499 const char *field_name,
500 struct bt_field_type_common *field_type);
4e8304f7 501
3dca2276
PP
502BT_HIDDEN
503int bt_field_type_common_structure_add_field(struct bt_field_type_common *ft,
504 struct bt_field_type_common *field_type,
505 const char *field_name);
506
507BT_HIDDEN
508int64_t bt_field_type_common_structure_get_field_count(
509 struct bt_field_type_common *ft);
510
511BT_HIDDEN
094ff7c0 512int bt_field_type_common_structure_borrow_field_by_index(
3dca2276
PP
513 struct bt_field_type_common *ft,
514 const char **field_name,
515 struct bt_field_type_common **field_type, uint64_t index);
516
517BT_HIDDEN
094ff7c0
PP
518struct bt_field_type_common *
519bt_field_type_common_structure_borrow_field_type_by_name(
3dca2276
PP
520 struct bt_field_type_common *ft, const char *name);
521
522BT_HIDDEN
094ff7c0
PP
523struct bt_field_type_common *
524bt_field_type_common_variant_borrow_tag_field_type(
3dca2276
PP
525 struct bt_field_type_common *ft);
526
527BT_HIDDEN
528const char *bt_field_type_common_variant_get_tag_name(
529 struct bt_field_type_common *ft);
530
531BT_HIDDEN
532int bt_field_type_common_variant_set_tag_name(
533 struct bt_field_type_common *ft, const char *name);
534
535BT_HIDDEN
536int bt_field_type_common_variant_add_field(struct bt_field_type_common *ft,
537 struct bt_field_type_common *field_type,
538 const char *field_name);
539
540BT_HIDDEN
312c056a
PP
541int bt_field_type_common_variant_update_choices(
542 struct bt_field_type_common *ft);
3dca2276
PP
543
544BT_HIDDEN
094ff7c0 545struct bt_field_type_common *
312c056a 546bt_field_type_common_variant_borrow_field_type_by_name(
3dca2276 547 struct bt_field_type_common *ft,
312c056a 548 const char *field_name);
3dca2276
PP
549
550BT_HIDDEN
551int64_t bt_field_type_common_variant_get_field_count(
552 struct bt_field_type_common *ft);
553
554BT_HIDDEN
094ff7c0 555int bt_field_type_common_variant_borrow_field_by_index(
3dca2276
PP
556 struct bt_field_type_common *ft,
557 const char **field_name,
558 struct bt_field_type_common **field_type, uint64_t index);
559
560BT_HIDDEN
094ff7c0
PP
561struct bt_field_type_common *
562bt_field_type_common_array_borrow_element_field_type(
3dca2276
PP
563 struct bt_field_type_common *ft);
564
565BT_HIDDEN
566int bt_field_type_common_array_set_element_field_type(
567 struct bt_field_type_common *ft,
568 struct bt_field_type_common *element_ft);
569
570BT_HIDDEN
571int64_t bt_field_type_common_array_get_length(struct bt_field_type_common *ft);
572
573BT_HIDDEN
094ff7c0
PP
574struct bt_field_type_common *
575bt_field_type_common_sequence_borrow_element_field_type(
3dca2276
PP
576 struct bt_field_type_common *ft);
577
578BT_HIDDEN
579int bt_field_type_common_sequence_set_element_field_type(
580 struct bt_field_type_common *ft,
581 struct bt_field_type_common *element_ft);
582
583BT_HIDDEN
584const char *bt_field_type_common_sequence_get_length_field_name(
585 struct bt_field_type_common *ft);
586
587BT_HIDDEN
588enum bt_string_encoding bt_field_type_common_string_get_encoding(
589 struct bt_field_type_common *ft);
590
591BT_HIDDEN
592int bt_field_type_common_string_set_encoding(struct bt_field_type_common *ft,
593 enum bt_string_encoding encoding);
594
595BT_HIDDEN
596int bt_field_type_common_get_alignment(struct bt_field_type_common *type);
597
598BT_HIDDEN
599int bt_field_type_common_set_alignment(struct bt_field_type_common *ft,
600 unsigned int alignment);
601
602BT_HIDDEN
603enum bt_byte_order bt_field_type_common_get_byte_order(
604 struct bt_field_type_common *ft);
605
606BT_HIDDEN
607int bt_field_type_common_set_byte_order(struct bt_field_type_common *ft,
608 enum bt_byte_order byte_order);
609
610BT_HIDDEN
611enum bt_field_type_id bt_field_type_common_get_type_id(
612 struct bt_field_type_common *ft);
613
614BT_HIDDEN
5ea30b28 615void bt_field_type_common_freeze(struct bt_field_type_common *ft);
3dca2276
PP
616
617BT_HIDDEN
5ea30b28 618void bt_field_type_freeze(struct bt_field_type *ft);
3dca2276
PP
619
620BT_HIDDEN
094ff7c0
PP
621struct bt_field_type_common *
622bt_field_type_common_variant_borrow_field_type_signed(
3dca2276
PP
623 struct bt_field_type_common_variant *var_ft,
624 int64_t tag_value);
625
626BT_HIDDEN
094ff7c0
PP
627struct bt_field_type_common *
628bt_field_type_common_variant_borrow_field_type_unsigned(
3dca2276
PP
629 struct bt_field_type_common_variant *var_ft,
630 uint64_t tag_value);
631
632BT_HIDDEN
633struct bt_field_type_common *bt_field_type_common_copy(
634 struct bt_field_type_common *ft);
635
636BT_HIDDEN
637int bt_field_type_common_structure_get_field_name_index(
638 struct bt_field_type_common *ft, const char *name);
639
640BT_HIDDEN
641int bt_field_type_common_variant_get_field_name_index(
642 struct bt_field_type_common *ft, const char *name);
643
644BT_HIDDEN
645int bt_field_type_common_sequence_set_length_field_path(
646 struct bt_field_type_common *ft, struct bt_field_path *path);
647
648BT_HIDDEN
649int bt_field_type_common_variant_set_tag_field_path(
650 struct bt_field_type_common *ft,
651 struct bt_field_path *path);
652
653BT_HIDDEN
654int bt_field_type_common_variant_set_tag_field_type(
655 struct bt_field_type_common *ft,
656 struct bt_field_type_common *tag_ft);
657
658BT_HIDDEN
659void bt_field_type_common_generic_freeze(struct bt_field_type_common *ft);
660
661BT_HIDDEN
662void bt_field_type_common_enumeration_freeze_recursive(
663 struct bt_field_type_common *ft);
664
665BT_HIDDEN
666void bt_field_type_common_structure_freeze_recursive(
667 struct bt_field_type_common *ft);
668
669BT_HIDDEN
670void bt_field_type_common_variant_freeze_recursive(
671 struct bt_field_type_common *ft);
672
673BT_HIDDEN
674void bt_field_type_common_array_freeze_recursive(
675 struct bt_field_type_common *ft);
676
677BT_HIDDEN
678void bt_field_type_common_sequence_freeze_recursive(
679 struct bt_field_type_common *type);
680
681BT_HIDDEN
682void bt_field_type_common_integer_set_byte_order(
683 struct bt_field_type_common *ft, enum bt_byte_order byte_order);
684
685BT_HIDDEN
686void bt_field_type_common_enumeration_set_byte_order_recursive(
687 struct bt_field_type_common *ft, enum bt_byte_order byte_order);
688
689BT_HIDDEN
690void bt_field_type_common_floating_point_set_byte_order(
691 struct bt_field_type_common *ft, enum bt_byte_order byte_order);
692
693BT_HIDDEN
694void bt_field_type_common_structure_set_byte_order_recursive(
695 struct bt_field_type_common *ft,
696 enum bt_byte_order byte_order);
697
698BT_HIDDEN
699void bt_field_type_common_variant_set_byte_order_recursive(
700 struct bt_field_type_common *ft,
701 enum bt_byte_order byte_order);
702
703BT_HIDDEN
704void bt_field_type_common_array_set_byte_order_recursive(
705 struct bt_field_type_common *ft,
706 enum bt_byte_order byte_order);
707
708BT_HIDDEN
709void bt_field_type_common_sequence_set_byte_order_recursive(
710 struct bt_field_type_common *ft,
711 enum bt_byte_order byte_order);
712
713BT_HIDDEN
714int bt_field_type_common_integer_compare(struct bt_field_type_common *ft_a,
715 struct bt_field_type_common *ft_b);
716
717BT_HIDDEN
718int bt_field_type_common_floating_point_compare(
719 struct bt_field_type_common *ft_a,
720 struct bt_field_type_common *ft_b);
721
722BT_HIDDEN
723int bt_field_type_common_enumeration_compare_recursive(
724 struct bt_field_type_common *ft_a,
725 struct bt_field_type_common *ft_b);
726
727BT_HIDDEN
728int bt_field_type_common_string_compare(struct bt_field_type_common *ft_a,
729 struct bt_field_type_common *ft_b);
730
731BT_HIDDEN
732int bt_field_type_common_structure_compare_recursive(
733 struct bt_field_type_common *ft_a,
734 struct bt_field_type_common *ft_b);
735
736BT_HIDDEN
737int bt_field_type_common_variant_compare_recursive(
738 struct bt_field_type_common *ft_a,
739 struct bt_field_type_common *ft_b);
740
741BT_HIDDEN
742int bt_field_type_common_array_compare_recursive(
743 struct bt_field_type_common *ft_a,
744 struct bt_field_type_common *ft_b);
745
746BT_HIDDEN
747int bt_field_type_common_sequence_compare_recursive(
748 struct bt_field_type_common *ft_a,
749 struct bt_field_type_common *ft_b);
750
751BT_HIDDEN
752int bt_field_type_common_compare(struct bt_field_type_common *ft_a,
753 struct bt_field_type_common *ft_b);
754
755BT_HIDDEN
756int64_t bt_field_type_common_get_field_count(struct bt_field_type_common *ft);
757
758BT_HIDDEN
094ff7c0 759struct bt_field_type_common *bt_field_type_common_borrow_field_at_index(
3dca2276
PP
760 struct bt_field_type_common *ft, int index);
761
762BT_HIDDEN
763int bt_field_type_common_get_field_index(struct bt_field_type_common *ft,
764 const char *name);
765
766BT_HIDDEN
094ff7c0 767struct bt_field_path *bt_field_type_common_variant_borrow_tag_field_path(
3dca2276
PP
768 struct bt_field_type_common *ft);
769
770BT_HIDDEN
094ff7c0 771struct bt_field_path *bt_field_type_common_sequence_borrow_length_field_path(
3dca2276
PP
772 struct bt_field_type_common *ft);
773
774BT_HIDDEN
775int bt_field_type_common_validate_single_clock_class(
776 struct bt_field_type_common *ft,
777 struct bt_clock_class **expected_clock_class);
4e8304f7 778
312c056a
PP
779BT_HIDDEN
780int64_t bt_field_type_common_variant_find_choice_index(
781 struct bt_field_type_common *ft, uint64_t uval,
782 bool is_signed);
783
2e33ac5a 784#endif /* BABELTRACE_CTF_IR_FIELD_TYPES_INTERNAL_H */
This page took 0.077928 seconds and 4 git commands to generate.