X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace%2Fctf-ir%2Fevent-types-internal.h;h=3adae33118f7d4f89d63b3758ef430178e316c9f;hb=32fe3f28047342b3b0ad04ce0c03bfb97e11127f;hp=ca0cf0280c0393525923770077bc22b5744aebee;hpb=aa4e271c0a4467105f3909779875746ca3eeeedf;p=babeltrace.git diff --git a/include/babeltrace/ctf-ir/event-types-internal.h b/include/babeltrace/ctf-ir/event-types-internal.h index ca0cf028..3adae331 100644 --- a/include/babeltrace/ctf-ir/event-types-internal.h +++ b/include/babeltrace/ctf-ir/event-types-internal.h @@ -28,10 +28,10 @@ */ #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_ref ref_count; + struct bt_ctf_base base; struct bt_declaration *declaration; type_freeze_func freeze; type_serialize_func serialize; @@ -123,6 +123,7 @@ struct bt_ctf_field_type_variant { struct bt_ctf_field_type parent; GString *tag_name; struct bt_ctf_field_type_enumeration *tag; + struct bt_ctf_field_path *tag_path; GHashTable *field_name_to_index; GPtrArray *fields; /* Array of pointers to struct structure_field */ struct declaration_variant declaration; @@ -200,6 +201,12 @@ BT_HIDDEN int bt_ctf_field_type_structure_get_field_name_index( struct bt_ctf_field_type *structure, const char *name); +/* Replace an existing field's type in a structure */ +BT_HIDDEN +int bt_ctf_field_type_structure_set_field_index( + struct bt_ctf_field_type *structure, + struct bt_ctf_field_type *field, int index); + BT_HIDDEN int bt_ctf_field_type_variant_get_field_name_index( struct bt_ctf_field_type *variant, const char *name); @@ -208,4 +215,27 @@ BT_HIDDEN 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); + +/* Replace an existing field's type in a variant */ +BT_HIDDEN +int bt_ctf_field_type_variant_set_field_index( + struct bt_ctf_field_type *variant, + struct bt_ctf_field_type *field, int index); + #endif /* BABELTRACE_CTF_IR_EVENT_TYPES_INTERNAL_H */