Move to kernel style SPDX license identifiers
[babeltrace.git] / src / ctf-writer / field-types.h
CommitLineData
3dca2276 1/*
0235b0db 2 * SPDX-License-Identifier: MIT
3dca2276 3 *
0235b0db 4 * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
3dca2276
PP
5 *
6 * The Common Trace Format (CTF) Specification is available at
7 * http://www.efficios.com/ctf
8 */
9
0235b0db
MJ
10#ifndef BABELTRACE_CTF_WRITER_FIELD_TYPES_INTERNAL_H
11#define BABELTRACE_CTF_WRITER_FIELD_TYPES_INTERNAL_H
12
c4f23e30 13#include <stdbool.h>
3dca2276
PP
14#include <stdint.h>
15#include <stddef.h>
16
217cf9d3
PP
17#include <babeltrace2-ctf-writer/field-types.h>
18#include <babeltrace2-ctf-writer/types.h>
16ca5ff0 19
91d81473 20#include "common/macros.h"
578e048b
MJ
21
22#include "assert-pre.h"
23#include "clock-class.h"
24#include "object.h"
25#include "writer.h"
26
67d2ce02
MJ
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), \
16ca5ff0
PP
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
67d2ce02
MJ
32#define BT_CTF_ASSERT_PRE_CTF_FT_HOT(_ft, _name) \
33 BT_CTF_ASSERT_PRE_HOT((_ft), (_name), ": ft-addr=%p", (_ft))
16ca5ff0
PP
34
35#define BT_CTF_FIELD_TYPE_COMMON_STRUCTURE_FIELD_AT_INDEX(_ft, _index) \
36 (&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 (&g_array_index(((struct bt_ctf_field_type_common_variant *) (_ft))->choices, \
41 struct bt_ctf_field_type_common_variant_choice, (_index)))
42
43struct bt_ctf_field_common;
44struct bt_ctf_field_type_common;
45
46typedef void (*bt_ctf_field_type_common_method_freeze)(
47 struct bt_ctf_field_type_common *);
48typedef int (*bt_ctf_field_type_common_method_validate)(
49 struct bt_ctf_field_type_common *);
50typedef void (*bt_ctf_field_type_common_method_set_byte_order)(
51 struct bt_ctf_field_type_common *, enum bt_ctf_byte_order);
52typedef struct bt_ctf_field_type_common *(*bt_ctf_field_type_common_method_copy)(
53 struct bt_ctf_field_type_common *);
54typedef int (*bt_ctf_field_type_common_method_compare)(
55 struct bt_ctf_field_type_common *,
56 struct bt_ctf_field_type_common *);
57
58struct 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
66struct bt_ctf_field_type_common {
e1e02a22 67 struct bt_ctf_object base;
16ca5ff0
PP
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 instanciated 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
114struct 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;
00409097 121 bt_ctf_bool is_signed;
16ca5ff0
PP
122 unsigned int size;
123 enum bt_ctf_integer_base base;
124 enum bt_ctf_string_encoding encoding;
125};
126
127struct 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
139struct 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 */
00409097 149 bt_ctf_bool has_overlapping_ranges;
16ca5ff0
PP
150};
151
152enum 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
158struct bt_ctf_field_type_enumeration_mapping_iterator {
e1e02a22 159 struct bt_ctf_object base;
16ca5ff0
PP
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
173struct 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
180struct 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
187struct 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
198struct 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
209struct 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
219struct 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
238struct 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
247struct 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
259struct bt_ctf_field_type_common_string {
260 struct bt_ctf_field_type_common common;
261 enum bt_ctf_string_encoding encoding;
262};
263
264typedef struct bt_ctf_field_common *(* bt_ctf_field_common_create_func)(
265 struct bt_ctf_field_type_common *);
266
267BT_HIDDEN
268void bt_ctf_field_type_common_initialize(struct bt_ctf_field_type_common *ft,
e1e02a22 269 bool init_bo, bt_ctf_object_release_func release_func,
16ca5ff0
PP
270 struct bt_ctf_field_type_common_methods *methods);
271
272BT_HIDDEN
273void bt_ctf_field_type_common_integer_initialize(
274 struct bt_ctf_field_type_common *ft,
e1e02a22 275 unsigned int size, bt_ctf_object_release_func release_func,
16ca5ff0
PP
276 struct bt_ctf_field_type_common_methods *methods);
277
278BT_HIDDEN
279void bt_ctf_field_type_common_floating_point_initialize(
280 struct bt_ctf_field_type_common *ft,
e1e02a22 281 bt_ctf_object_release_func release_func,
16ca5ff0
PP
282 struct bt_ctf_field_type_common_methods *methods);
283
284BT_HIDDEN
285void bt_ctf_field_type_common_enumeration_initialize(
286 struct bt_ctf_field_type_common *ft,
287 struct bt_ctf_field_type_common *container_ft,
e1e02a22 288 bt_ctf_object_release_func release_func,
16ca5ff0
PP
289 struct bt_ctf_field_type_common_methods *methods);
290
291BT_HIDDEN
292void bt_ctf_field_type_common_string_initialize(
293 struct bt_ctf_field_type_common *ft,
e1e02a22 294 bt_ctf_object_release_func release_func,
16ca5ff0
PP
295 struct bt_ctf_field_type_common_methods *methods);
296
297BT_HIDDEN
298void bt_ctf_field_type_common_structure_initialize(
299 struct bt_ctf_field_type_common *ft,
e1e02a22 300 bt_ctf_object_release_func release_func,
16ca5ff0
PP
301 struct bt_ctf_field_type_common_methods *methods);
302
303BT_HIDDEN
304void bt_ctf_field_type_common_array_initialize(
305 struct bt_ctf_field_type_common *ft,
306 struct bt_ctf_field_type_common *element_ft,
e1e02a22 307 unsigned int length, bt_ctf_object_release_func release_func,
16ca5ff0
PP
308 struct bt_ctf_field_type_common_methods *methods);
309
310BT_HIDDEN
311void bt_ctf_field_type_common_sequence_initialize(
312 struct bt_ctf_field_type_common *ft,
313 struct bt_ctf_field_type_common *element_ft,
314 const char *length_field_name,
e1e02a22 315 bt_ctf_object_release_func release_func,
16ca5ff0
PP
316 struct bt_ctf_field_type_common_methods *methods);
317
318BT_HIDDEN
319void bt_ctf_field_type_common_variant_initialize(
320 struct bt_ctf_field_type_common *ft,
321 struct bt_ctf_field_type_common *tag_ft,
322 const char *tag_name,
e1e02a22 323 bt_ctf_object_release_func release_func,
16ca5ff0
PP
324 struct bt_ctf_field_type_common_methods *methods);
325
326BT_HIDDEN
e1e02a22 327void bt_ctf_field_type_common_integer_destroy(struct bt_ctf_object *obj);
16ca5ff0
PP
328
329BT_HIDDEN
e1e02a22 330void bt_ctf_field_type_common_floating_point_destroy(struct bt_ctf_object *obj);
16ca5ff0
PP
331
332BT_HIDDEN
e1e02a22 333void bt_ctf_field_type_common_enumeration_destroy_recursive(struct bt_ctf_object *obj);
16ca5ff0
PP
334
335BT_HIDDEN
e1e02a22 336void bt_ctf_field_type_common_string_destroy(struct bt_ctf_object *obj);
16ca5ff0
PP
337
338BT_HIDDEN
e1e02a22 339void bt_ctf_field_type_common_structure_destroy_recursive(struct bt_ctf_object *obj);
16ca5ff0
PP
340
341BT_HIDDEN
e1e02a22 342void bt_ctf_field_type_common_array_destroy_recursive(struct bt_ctf_object *obj);
16ca5ff0
PP
343
344BT_HIDDEN
e1e02a22 345void bt_ctf_field_type_common_sequence_destroy_recursive(struct bt_ctf_object *obj);
16ca5ff0
PP
346
347BT_HIDDEN
e1e02a22 348void bt_ctf_field_type_common_variant_destroy_recursive(struct bt_ctf_object *obj);
16ca5ff0
PP
349
350BT_HIDDEN
351int bt_ctf_field_type_common_integer_validate(struct bt_ctf_field_type_common *ft);
352
353BT_HIDDEN
354int bt_ctf_field_type_common_enumeration_validate_recursive(
355 struct bt_ctf_field_type_common *ft);
356
357BT_HIDDEN
358int bt_ctf_field_type_common_sequence_validate_recursive(
359 struct bt_ctf_field_type_common *ft);
360
361BT_HIDDEN
362int bt_ctf_field_type_common_array_validate_recursive(
363 struct bt_ctf_field_type_common *ft);
364
365BT_HIDDEN
366int bt_ctf_field_type_common_structure_validate_recursive(
367 struct bt_ctf_field_type_common *ft);
368
369BT_HIDDEN
370int bt_ctf_field_type_common_variant_validate_recursive(
371 struct bt_ctf_field_type_common *type);
372
373BT_HIDDEN
374int bt_ctf_field_type_common_validate(struct bt_ctf_field_type_common *ft);
375
376BT_HIDDEN
377int bt_ctf_field_type_common_integer_get_size(struct bt_ctf_field_type_common *ft);
378
379BT_HIDDEN
00409097 380bt_ctf_bool bt_ctf_field_type_common_integer_is_signed(struct bt_ctf_field_type_common *ft);
16ca5ff0
PP
381
382BT_HIDDEN
383int bt_ctf_field_type_common_integer_set_is_signed(struct bt_ctf_field_type_common *ft,
00409097 384 bt_ctf_bool is_signed);
16ca5ff0
PP
385
386BT_HIDDEN
387int bt_ctf_field_type_common_integer_set_size(struct bt_ctf_field_type_common *ft,
388 unsigned int size);
389
390BT_HIDDEN
391enum bt_ctf_integer_base bt_ctf_field_type_common_integer_get_base(
392 struct bt_ctf_field_type_common *ft);
393
394BT_HIDDEN
395int bt_ctf_field_type_common_integer_set_base(struct bt_ctf_field_type_common *ft,
396 enum bt_ctf_integer_base base);
397
398BT_HIDDEN
399enum bt_ctf_string_encoding bt_ctf_field_type_common_integer_get_encoding(
400 struct bt_ctf_field_type_common *ft);
401
402BT_HIDDEN
403int bt_ctf_field_type_common_integer_set_encoding(struct bt_ctf_field_type_common *ft,
404 enum bt_ctf_string_encoding encoding);
405
406BT_HIDDEN
407struct bt_ctf_clock_class *bt_ctf_field_type_common_integer_borrow_mapped_clock_class(
408 struct bt_ctf_field_type_common *ft);
409
410BT_HIDDEN
411int bt_ctf_field_type_common_integer_set_mapped_clock_class_no_check_frozen(
412 struct bt_ctf_field_type_common *ft,
413 struct bt_ctf_clock_class *clock_class);
414
415BT_HIDDEN
416int bt_ctf_field_type_common_integer_set_mapped_clock_class(
417 struct bt_ctf_field_type_common *ft,
418 struct bt_ctf_clock_class *clock_class);
419
420BT_HIDDEN
421struct bt_ctf_field_type_enumeration_mapping_iterator *
422bt_ctf_field_type_common_enumeration_find_mappings_by_name(
423 struct bt_ctf_field_type_common *ft, const char *name);
424
425BT_HIDDEN
426struct bt_ctf_field_type_enumeration_mapping_iterator *
427bt_ctf_field_type_common_enumeration_signed_find_mappings_by_value(
428 struct bt_ctf_field_type_common *ft, int64_t value);
429
430BT_HIDDEN
431struct bt_ctf_field_type_enumeration_mapping_iterator *
432bt_ctf_field_type_common_enumeration_unsigned_find_mappings_by_value(
433 struct bt_ctf_field_type_common *ft, uint64_t value);
434
7c7301d5
SM
435BT_HIDDEN
436int bt_ctf_field_type_enumeration_mapping_iterator_next(
437 struct bt_ctf_field_type_enumeration_mapping_iterator *iter);
438
439BT_HIDDEN
440int bt_ctf_field_type_enumeration_mapping_iterator_signed_get(
441 struct bt_ctf_field_type_enumeration_mapping_iterator *iter,
442 const char **mapping_name, int64_t *range_begin,
443 int64_t *range_end);
444
445BT_HIDDEN
446int bt_ctf_field_type_enumeration_mapping_iterator_unsigned_get(
447 struct bt_ctf_field_type_enumeration_mapping_iterator *iter,
448 const char **mapping_name, uint64_t *range_begin,
449 uint64_t *range_end);
450
16ca5ff0
PP
451BT_HIDDEN
452int bt_ctf_field_type_common_enumeration_signed_get_mapping_by_index(
453 struct bt_ctf_field_type_common *ft, uint64_t index,
454 const char **mapping_name, int64_t *range_begin,
455 int64_t *range_end);
456
457BT_HIDDEN
458int bt_ctf_field_type_common_enumeration_unsigned_get_mapping_by_index(
459 struct bt_ctf_field_type_common *ft, uint64_t index,
460 const char **mapping_name, uint64_t *range_begin,
461 uint64_t *range_end);
462
463BT_HIDDEN
464struct bt_ctf_field_type_common *
465bt_ctf_field_type_common_enumeration_borrow_container_field_type(
466 struct bt_ctf_field_type_common *ft);
467
468BT_HIDDEN
469int bt_ctf_field_type_common_enumeration_signed_add_mapping(
470 struct bt_ctf_field_type_common *ft, const char *string,
471 int64_t range_start, int64_t range_end);
472
473BT_HIDDEN
474int bt_ctf_field_type_common_enumeration_unsigned_add_mapping(
475 struct bt_ctf_field_type_common *ft, const char *string,
476 uint64_t range_start, uint64_t range_end);
477
478BT_HIDDEN
479int64_t bt_ctf_field_type_common_enumeration_get_mapping_count(
480 struct bt_ctf_field_type_common *ft);
481
482BT_HIDDEN
483int bt_ctf_field_type_common_floating_point_get_exponent_digits(
484 struct bt_ctf_field_type_common *ft);
485
486BT_HIDDEN
487int bt_ctf_field_type_common_floating_point_set_exponent_digits(
488 struct bt_ctf_field_type_common *ft,
489 unsigned int exponent_digits);
490
491BT_HIDDEN
492int bt_ctf_field_type_common_floating_point_get_mantissa_digits(
493 struct bt_ctf_field_type_common *type);
494
495BT_HIDDEN
496int bt_ctf_field_type_common_floating_point_set_mantissa_digits(
497 struct bt_ctf_field_type_common *ft, unsigned int mantissa_digits);
498
499BT_HIDDEN
500int bt_ctf_field_type_common_structure_replace_field(
501 struct bt_ctf_field_type_common *ft,
502 const char *field_name,
503 struct bt_ctf_field_type_common *field_type);
504
505BT_HIDDEN
506int bt_ctf_field_type_common_structure_add_field(struct bt_ctf_field_type_common *ft,
507 struct bt_ctf_field_type_common *field_type,
508 const char *field_name);
509
510BT_HIDDEN
511int64_t bt_ctf_field_type_common_structure_get_field_count(
512 struct bt_ctf_field_type_common *ft);
513
514BT_HIDDEN
515int bt_ctf_field_type_common_structure_borrow_field_by_index(
516 struct bt_ctf_field_type_common *ft,
517 const char **field_name,
518 struct bt_ctf_field_type_common **field_type, uint64_t index);
519
520BT_HIDDEN
521struct bt_ctf_field_type_common *
522bt_ctf_field_type_common_structure_borrow_field_type_by_name(
523 struct bt_ctf_field_type_common *ft, const char *name);
524
525BT_HIDDEN
526struct bt_ctf_field_type_common *
527bt_ctf_field_type_common_variant_borrow_tag_field_type(
528 struct bt_ctf_field_type_common *ft);
529
530BT_HIDDEN
531const char *bt_ctf_field_type_common_variant_get_tag_name(
532 struct bt_ctf_field_type_common *ft);
533
534BT_HIDDEN
535int bt_ctf_field_type_common_variant_set_tag_name(
536 struct bt_ctf_field_type_common *ft, const char *name);
537
538BT_HIDDEN
539int bt_ctf_field_type_common_variant_add_field(struct bt_ctf_field_type_common *ft,
540 struct bt_ctf_field_type_common *field_type,
541 const char *field_name);
542
543BT_HIDDEN
544int bt_ctf_field_type_common_variant_update_choices(
545 struct bt_ctf_field_type_common *ft);
546
547BT_HIDDEN
548struct bt_ctf_field_type_common *
549bt_ctf_field_type_common_variant_borrow_field_type_by_name(
550 struct bt_ctf_field_type_common *ft,
551 const char *field_name);
552
553BT_HIDDEN
554int64_t bt_ctf_field_type_common_variant_get_field_count(
555 struct bt_ctf_field_type_common *ft);
556
557BT_HIDDEN
558int bt_ctf_field_type_common_variant_borrow_field_by_index(
559 struct bt_ctf_field_type_common *ft,
560 const char **field_name,
561 struct bt_ctf_field_type_common **field_type, uint64_t index);
562
563BT_HIDDEN
564struct bt_ctf_field_type_common *
565bt_ctf_field_type_common_array_borrow_element_field_type(
566 struct bt_ctf_field_type_common *ft);
567
568BT_HIDDEN
569int bt_ctf_field_type_common_array_set_element_field_type(
570 struct bt_ctf_field_type_common *ft,
571 struct bt_ctf_field_type_common *element_ft);
572
573BT_HIDDEN
574int64_t bt_ctf_field_type_common_array_get_length(struct bt_ctf_field_type_common *ft);
575
576BT_HIDDEN
577struct bt_ctf_field_type_common *
578bt_ctf_field_type_common_sequence_borrow_element_field_type(
579 struct bt_ctf_field_type_common *ft);
580
581BT_HIDDEN
582int bt_ctf_field_type_common_sequence_set_element_field_type(
583 struct bt_ctf_field_type_common *ft,
584 struct bt_ctf_field_type_common *element_ft);
585
586BT_HIDDEN
587const char *bt_ctf_field_type_common_sequence_get_length_field_name(
588 struct bt_ctf_field_type_common *ft);
589
590BT_HIDDEN
591enum bt_ctf_string_encoding bt_ctf_field_type_common_string_get_encoding(
592 struct bt_ctf_field_type_common *ft);
593
594BT_HIDDEN
595int bt_ctf_field_type_common_string_set_encoding(struct bt_ctf_field_type_common *ft,
596 enum bt_ctf_string_encoding encoding);
597
598BT_HIDDEN
599int bt_ctf_field_type_common_get_alignment(struct bt_ctf_field_type_common *type);
600
601BT_HIDDEN
602int bt_ctf_field_type_common_set_alignment(struct bt_ctf_field_type_common *ft,
603 unsigned int alignment);
604
605BT_HIDDEN
606enum bt_ctf_byte_order bt_ctf_field_type_common_get_byte_order(
607 struct bt_ctf_field_type_common *ft);
608
609BT_HIDDEN
610int bt_ctf_field_type_common_set_byte_order(struct bt_ctf_field_type_common *ft,
611 enum bt_ctf_byte_order byte_order);
612
613BT_HIDDEN
614enum bt_ctf_field_type_id bt_ctf_field_type_common_get_type_id(
615 struct bt_ctf_field_type_common *ft);
616
617BT_HIDDEN
618void bt_ctf_field_type_common_freeze(struct bt_ctf_field_type_common *ft);
619
620BT_HIDDEN
621struct bt_ctf_field_type_common *
622bt_ctf_field_type_common_variant_borrow_field_type_signed(
623 struct bt_ctf_field_type_common_variant *var_ft,
624 int64_t tag_value);
625
626BT_HIDDEN
627struct bt_ctf_field_type_common *
628bt_ctf_field_type_common_variant_borrow_field_type_unsigned(
629 struct bt_ctf_field_type_common_variant *var_ft,
630 uint64_t tag_value);
631
632BT_HIDDEN
633struct bt_ctf_field_type_common *bt_ctf_field_type_common_copy(
634 struct bt_ctf_field_type_common *ft);
635
636BT_HIDDEN
637int bt_ctf_field_type_common_structure_get_field_name_index(
638 struct bt_ctf_field_type_common *ft, const char *name);
639
640BT_HIDDEN
641int bt_ctf_field_type_common_variant_get_field_name_index(
642 struct bt_ctf_field_type_common *ft, const char *name);
643
644BT_HIDDEN
645int bt_ctf_field_type_common_sequence_set_length_field_path(
646 struct bt_ctf_field_type_common *ft, struct bt_ctf_field_path *path);
647
648BT_HIDDEN
649int bt_ctf_field_type_common_variant_set_tag_field_path(
650 struct bt_ctf_field_type_common *ft,
651 struct bt_ctf_field_path *path);
652
653BT_HIDDEN
654int bt_ctf_field_type_common_variant_set_tag_field_type(
655 struct bt_ctf_field_type_common *ft,
656 struct bt_ctf_field_type_common *tag_ft);
657
658BT_HIDDEN
659void bt_ctf_field_type_common_generic_freeze(struct bt_ctf_field_type_common *ft);
660
661BT_HIDDEN
662void bt_ctf_field_type_common_enumeration_freeze_recursive(
663 struct bt_ctf_field_type_common *ft);
664
665BT_HIDDEN
666void bt_ctf_field_type_common_structure_freeze_recursive(
667 struct bt_ctf_field_type_common *ft);
668
669BT_HIDDEN
670void bt_ctf_field_type_common_variant_freeze_recursive(
671 struct bt_ctf_field_type_common *ft);
672
673BT_HIDDEN
674void bt_ctf_field_type_common_array_freeze_recursive(
675 struct bt_ctf_field_type_common *ft);
676
677BT_HIDDEN
678void bt_ctf_field_type_common_sequence_freeze_recursive(
679 struct bt_ctf_field_type_common *type);
680
681BT_HIDDEN
682void bt_ctf_field_type_common_integer_set_byte_order(
683 struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order);
684
685BT_HIDDEN
686void bt_ctf_field_type_common_enumeration_set_byte_order_recursive(
687 struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order);
688
689BT_HIDDEN
690void bt_ctf_field_type_common_floating_point_set_byte_order(
691 struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order);
692
693BT_HIDDEN
694void bt_ctf_field_type_common_structure_set_byte_order_recursive(
695 struct bt_ctf_field_type_common *ft,
696 enum bt_ctf_byte_order byte_order);
697
698BT_HIDDEN
699void bt_ctf_field_type_common_variant_set_byte_order_recursive(
700 struct bt_ctf_field_type_common *ft,
701 enum bt_ctf_byte_order byte_order);
702
703BT_HIDDEN
704void bt_ctf_field_type_common_array_set_byte_order_recursive(
705 struct bt_ctf_field_type_common *ft,
706 enum bt_ctf_byte_order byte_order);
707
708BT_HIDDEN
709void bt_ctf_field_type_common_sequence_set_byte_order_recursive(
710 struct bt_ctf_field_type_common *ft,
711 enum bt_ctf_byte_order byte_order);
712
713BT_HIDDEN
714int bt_ctf_field_type_common_integer_compare(struct bt_ctf_field_type_common *ft_a,
715 struct bt_ctf_field_type_common *ft_b);
716
717BT_HIDDEN
718int bt_ctf_field_type_common_floating_point_compare(
719 struct bt_ctf_field_type_common *ft_a,
720 struct bt_ctf_field_type_common *ft_b);
721
722BT_HIDDEN
723int bt_ctf_field_type_common_enumeration_compare_recursive(
724 struct bt_ctf_field_type_common *ft_a,
725 struct bt_ctf_field_type_common *ft_b);
726
727BT_HIDDEN
728int bt_ctf_field_type_common_string_compare(struct bt_ctf_field_type_common *ft_a,
729 struct bt_ctf_field_type_common *ft_b);
730
731BT_HIDDEN
732int bt_ctf_field_type_common_structure_compare_recursive(
733 struct bt_ctf_field_type_common *ft_a,
734 struct bt_ctf_field_type_common *ft_b);
735
736BT_HIDDEN
737int bt_ctf_field_type_common_variant_compare_recursive(
738 struct bt_ctf_field_type_common *ft_a,
739 struct bt_ctf_field_type_common *ft_b);
740
741BT_HIDDEN
742int bt_ctf_field_type_common_array_compare_recursive(
743 struct bt_ctf_field_type_common *ft_a,
744 struct bt_ctf_field_type_common *ft_b);
745
746BT_HIDDEN
747int bt_ctf_field_type_common_sequence_compare_recursive(
748 struct bt_ctf_field_type_common *ft_a,
749 struct bt_ctf_field_type_common *ft_b);
750
751BT_HIDDEN
752int bt_ctf_field_type_common_compare(struct bt_ctf_field_type_common *ft_a,
753 struct bt_ctf_field_type_common *ft_b);
754
755BT_HIDDEN
756int64_t bt_ctf_field_type_common_get_field_count(struct bt_ctf_field_type_common *ft);
757
758BT_HIDDEN
759struct bt_ctf_field_type_common *bt_ctf_field_type_common_borrow_field_at_index(
760 struct bt_ctf_field_type_common *ft, int index);
761
762BT_HIDDEN
763int bt_ctf_field_type_common_get_field_index(struct bt_ctf_field_type_common *ft,
764 const char *name);
765
766BT_HIDDEN
767struct bt_ctf_field_path *bt_ctf_field_type_common_variant_borrow_tag_field_path(
768 struct bt_ctf_field_type_common *ft);
769
770BT_HIDDEN
771struct bt_ctf_field_path *bt_ctf_field_type_common_sequence_borrow_length_field_path(
772 struct bt_ctf_field_type_common *ft);
773
774BT_HIDDEN
775int bt_ctf_field_type_common_validate_single_clock_class(
776 struct bt_ctf_field_type_common *ft,
777 struct bt_ctf_clock_class **expected_clock_class);
778
779BT_HIDDEN
780int64_t bt_ctf_field_type_common_variant_find_choice_index(
781 struct bt_ctf_field_type_common *ft, uint64_t uval,
782 bool is_signed);
3dca2276
PP
783
784BT_HIDDEN
785int bt_ctf_field_type_serialize_recursive(struct bt_ctf_field_type *type,
786 struct metadata_context *context);
787
788BT_HIDDEN
789struct bt_ctf_field_type *bt_ctf_field_type_copy(struct bt_ctf_field_type *ft);
790
791#endif /* BABELTRACE_CTF_WRITER_FIELD_TYPES_INTERNAL_H */
This page took 0.094919 seconds and 4 git commands to generate.