X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=include%2Fbabeltrace%2Fctf-ir%2Fevent-types-internal.h;h=5bc46c4ee427f3753b53b93f0d1f9e02febd0e01;hb=d480b699c96186b69cb91eac28e8f3128fdec7bb;hp=d5290f575cda586d10cefdb1e44670e891610b97;hpb=de3dd40e6fcad56e227f5fc8a8290fbaa88b4e07;p=babeltrace.git diff --git a/include/babeltrace/ctf-ir/event-types-internal.h b/include/babeltrace/ctf-ir/event-types-internal.h index d5290f57..5bc46c4e 100644 --- a/include/babeltrace/ctf-ir/event-types-internal.h +++ b/include/babeltrace/ctf-ir/event-types-internal.h @@ -31,8 +31,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -62,7 +62,7 @@ struct bt_ctf_field_path { }; struct bt_ctf_field_type { - struct bt_ctf_base base; + struct bt_object base; struct bt_declaration *declaration; type_freeze_func freeze; type_serialize_func serialize; @@ -77,6 +77,14 @@ struct bt_ctf_field_type_integer { struct bt_ctf_field_type parent; struct declaration_integer declaration; struct bt_ctf_clock *mapped_clock; + + /* + * This is what the user sets and is never modified by internal + * code. + * + * This field must contain a `BT_CTF_BYTE_ORDER_*` value. + */ + enum bt_ctf_byte_order user_byte_order; }; struct enumeration_mapping { @@ -95,16 +103,30 @@ struct enumeration_mapping { struct bt_ctf_field_type_enumeration { struct bt_ctf_field_type parent; struct bt_ctf_field_type *container; - GPtrArray *entries; /* Array of pointers to struct enum_mapping */ + GPtrArray *entries; /* Array of ptrs to struct enumeration_mapping */ struct declaration_enum declaration; }; struct bt_ctf_field_type_floating_point { struct bt_ctf_field_type parent; struct declaration_float declaration; + + /* + * The `declaration` field above contains 3 pointers pointing + * to the fields below. This avoids unnecessary dynamic + * allocations. + */ struct declaration_integer sign; struct declaration_integer mantissa; struct declaration_integer exp; + + /* + * This is what the user sets and is never modified by internal + * code. + * + * This field must contain a `BT_CTF_BYTE_ORDER_*` value. + */ + enum bt_ctf_byte_order user_byte_order; }; struct structure_field { @@ -216,10 +238,18 @@ int bt_ctf_field_type_sequence_set_length_field_path( struct bt_ctf_field_type *type, struct bt_ctf_field_path *path); +BT_HIDDEN +struct bt_ctf_field_path *bt_ctf_field_type_sequence_get_length_field_path( + struct bt_ctf_field_type *type); + BT_HIDDEN int bt_ctf_field_type_variant_set_tag_field_path(struct bt_ctf_field_type *type, struct bt_ctf_field_path *path); +BT_HIDDEN +struct bt_ctf_field_path *bt_ctf_field_type_variant_get_tag_field_path( + struct bt_ctf_field_type *type); + BT_HIDDEN int bt_ctf_field_type_variant_set_tag(struct bt_ctf_field_type *type, struct bt_ctf_field_type *tag); @@ -230,4 +260,12 @@ int bt_ctf_field_type_variant_set_field_index( struct bt_ctf_field_type *variant, struct bt_ctf_field_type *field, int index); +BT_HIDDEN +int bt_ctf_field_type_array_set_element_type(struct bt_ctf_field_type *array, + struct bt_ctf_field_type *element_type); + +BT_HIDDEN +int bt_ctf_field_type_sequence_set_element_type(struct bt_ctf_field_type *array, + struct bt_ctf_field_type *element_type); + #endif /* BABELTRACE_CTF_IR_EVENT_TYPES_INTERNAL_H */