From: Philippe Proulx Date: Sun, 14 Aug 2016 19:14:22 +0000 (-0400) Subject: ir: make bt_ctf_field_type_copy() public X-Git-Tag: v2.0.0-pre1~791 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=06629ab3b4650e8a5aaf056572577bb299c5ac22 ir: make bt_ctf_field_type_copy() public This function can be useful for some source plugins which support aliases in their metadata description: the base type is created once, then one copy is created for each instance (possibly with a different tag if it's a variant alias, for example). The copy and all its children have their valid flag reset to 0 (as well as their frozen flag). This means that they are not considered valid after the copy operation. The length and tag field paths of resp. sequence and variant field types will be resolved later when this copy is used as one of the types of an event class, a stream class, or a trace, and when it's about to be frozen in those contexts. Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- diff --git a/formats/ctf/ir/field-types.c b/formats/ctf/ir/field-types.c index 5aecd99c..49919ca2 100644 --- a/formats/ctf/ir/field-types.c +++ b/formats/ctf/ir/field-types.c @@ -2372,7 +2372,6 @@ void bt_ctf_field_type_set_native_byte_order(struct bt_ctf_field_type *type, } } -BT_HIDDEN struct bt_ctf_field_type *bt_ctf_field_type_copy(struct bt_ctf_field_type *type) { struct bt_ctf_field_type *copy = NULL; diff --git a/include/babeltrace/ctf-ir/field-types-internal.h b/include/babeltrace/ctf-ir/field-types-internal.h index d3a4b0c1..c718a2be 100644 --- a/include/babeltrace/ctf-ir/field-types-internal.h +++ b/include/babeltrace/ctf-ir/field-types-internal.h @@ -191,11 +191,6 @@ BT_HIDDEN void bt_ctf_field_type_set_native_byte_order( struct bt_ctf_field_type *type, int byte_order); -/* Deep copy a field type */ -BT_HIDDEN -struct bt_ctf_field_type *bt_ctf_field_type_copy( - struct bt_ctf_field_type *type); - BT_HIDDEN int bt_ctf_field_type_structure_get_field_name_index( struct bt_ctf_field_type *structure, const char *name); diff --git a/include/babeltrace/ctf-ir/field-types.h b/include/babeltrace/ctf-ir/field-types.h index 3be4a5a0..c4b6b683 100644 --- a/include/babeltrace/ctf-ir/field-types.h +++ b/include/babeltrace/ctf-ir/field-types.h @@ -851,6 +851,9 @@ extern struct bt_ctf_field_path *bt_ctf_field_type_sequence_get_length_field_pat extern int bt_ctf_field_type_compare(struct bt_ctf_field_type *type_a, struct bt_ctf_field_type *type_b); +extern struct bt_ctf_field_type *bt_ctf_field_type_copy( + struct bt_ctf_field_type *type); + /* * bt_ctf_field_type_get_type_id: get a field type's bt_ctf_type_id. *