From a39fe52e530cc40ae74194f885e80246bea47f90 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Fri, 20 Mar 2015 14:04:21 -0400 Subject: [PATCH] ir: make bt_ctf_field_copy() public 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-fields.c | 1 - include/babeltrace/ctf-ir/event-fields-internal.h | 3 --- include/babeltrace/ctf-ir/event-fields.h | 14 ++++++++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/formats/ctf/ir/event-fields.c b/formats/ctf/ir/event-fields.c index 257ad523..29c5397f 100644 --- a/formats/ctf/ir/event-fields.c +++ b/formats/ctf/ir/event-fields.c @@ -1081,7 +1081,6 @@ end: return ret; } -BT_HIDDEN struct bt_ctf_field *bt_ctf_field_copy(struct bt_ctf_field *field) { int ret; diff --git a/include/babeltrace/ctf-ir/event-fields-internal.h b/include/babeltrace/ctf-ir/event-fields-internal.h index 88f372dd..34f8fad4 100644 --- a/include/babeltrace/ctf-ir/event-fields-internal.h +++ b/include/babeltrace/ctf-ir/event-fields-internal.h @@ -102,7 +102,4 @@ BT_HIDDEN int bt_ctf_field_serialize(struct bt_ctf_field *field, struct ctf_stream_pos *pos); -BT_HIDDEN -struct bt_ctf_field *bt_ctf_field_copy(struct bt_ctf_field *field); - #endif /* BABELTRACE_CTF_WRITER_EVENT_FIELDS_INTERNAL_H */ diff --git a/include/babeltrace/ctf-ir/event-fields.h b/include/babeltrace/ctf-ir/event-fields.h index b102d632..1d8f6439 100644 --- a/include/babeltrace/ctf-ir/event-fields.h +++ b/include/babeltrace/ctf-ir/event-fields.h @@ -336,6 +336,20 @@ extern int bt_ctf_field_string_append_len( extern struct bt_ctf_field_type *bt_ctf_field_get_type( struct bt_ctf_field *field); +/* + * bt_ctf_field_copy: get a field's deep copy. + * + * Get a field's deep copy. The created field copy shares the source's + * associated field types. + * + * On success, the returned copy has its reference count set to 1. + * + * @param field Field instance. + * + * Returns the field copy on success, NULL on error. + */ +extern struct bt_ctf_field *bt_ctf_field_copy(struct bt_ctf_field *field); + /* * bt_ctf_field_get and bt_ctf_field_put: increment and decrement the * field's reference count. -- 2.34.1