From 32fe3f28047342b3b0ad04ce0c03bfb97e11127f Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Mon, 27 Jul 2015 08:40:33 -0400 Subject: [PATCH] ir: add internal field path getters MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- formats/ctf/ir/event-types.c | 24 +++++++++++++++++++ .../babeltrace/ctf-ir/event-types-internal.h | 8 +++++++ 2 files changed, 32 insertions(+) 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); -- 2.34.1