ir: make bt_ctf_field_type_copy() public
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Sun, 14 Aug 2016 19:14:22 +0000 (15:14 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 27 May 2017 17:41:38 +0000 (13:41 -0400)
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 <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
formats/ctf/ir/field-types.c
include/babeltrace/ctf-ir/field-types-internal.h
include/babeltrace/ctf-ir/field-types.h

index 5aecd99c4fbfc5f95d2a2a12b9ce3c9e0ba5ec2f..49919ca2fe008796111955d76655c2f72f733d2a 100644 (file)
@@ -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;
index d3a4b0c17edbbb302636e246296924b933a8ba2f..c718a2be4b1ae0ea739da4a322bc0de4691d1d10 100644 (file)
@@ -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);
index 3be4a5a0182d48bcc525e1276680b879fdd864dc..c4b6b683c57cc7455faf15bdb5ba8c66be186448 100644 (file)
@@ -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.
  *
This page took 0.027426 seconds and 4 git commands to generate.