From: Philippe Proulx Date: Mon, 27 Jul 2015 12:40:33 +0000 (-0400) Subject: ir: add internal field path getters X-Git-Tag: v2.0.0-pre1~1205 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=32fe3f28047342b3b0ad04ce0c03bfb97e11127f ir: add internal field path getters Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- diff --git a/formats/ctf/ir/event-types.c b/formats/ctf/ir/event-types.c index 450f8d58..9d2bd39b 100644 --- a/formats/ctf/ir/event-types.c +++ b/formats/ctf/ir/event-types.c @@ -2221,6 +2221,18 @@ end: return ret; } +BT_HIDDEN +struct bt_ctf_field_path *bt_ctf_field_type_sequence_get_length_field_path( + struct bt_ctf_field_type *type) +{ + struct bt_ctf_field_type_sequence *sequence; + + sequence = container_of(type, struct bt_ctf_field_type_sequence, + parent); + + return sequence->length_field_path; +} + BT_HIDDEN int bt_ctf_field_type_variant_set_tag_field_path(struct bt_ctf_field_type *type, struct bt_ctf_field_path *path) @@ -2243,6 +2255,18 @@ end: return ret; } +BT_HIDDEN +struct bt_ctf_field_path *bt_ctf_field_type_variant_get_tag_field_path( + struct bt_ctf_field_type *type) +{ + struct bt_ctf_field_type_variant *variant; + + variant = container_of(type, struct bt_ctf_field_type_variant, + parent); + + return variant->tag_path; +} + BT_HIDDEN int bt_ctf_field_type_variant_set_tag(struct bt_ctf_field_type *type, struct bt_ctf_field_type *tag) diff --git a/include/babeltrace/ctf-ir/event-types-internal.h b/include/babeltrace/ctf-ir/event-types-internal.h index d5290f57..3adae331 100644 --- a/include/babeltrace/ctf-ir/event-types-internal.h +++ b/include/babeltrace/ctf-ir/event-types-internal.h @@ -216,10 +216,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);