From 0efd97ce561b97870a1a05f1a6269885b4bf87d1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Wed, 13 Sep 2017 16:52:16 -0400 Subject: [PATCH] Docs: structure_set_field_by_name doesn't garantee field replacement MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- include/babeltrace/ctf-ir/fields.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/babeltrace/ctf-ir/fields.h b/include/babeltrace/ctf-ir/fields.h index 525d3dbd..6ad01212 100644 --- a/include/babeltrace/ctf-ir/fields.h +++ b/include/babeltrace/ctf-ir/fields.h @@ -910,8 +910,9 @@ extern struct bt_ctf_field *bt_ctf_field_structure_get_field_by_index( @brief Sets the field of the @structfield \p struct_field named \p name to the @field \p field. -If \p struct_field already contains a field named \p name, then its -reference count is decremented, and \p field replaces it. +If \p struct_field already contains a field named \p name, then it may +either be replaced by \p field and its reference count is decremented, +or \p field's value is assigned to it. The field type of \p field, as returned by bt_ctf_field_get_type(), \em must be equivalent to the field type returned by @@ -936,9 +937,8 @@ bt_ctf_trace_get_packet_header_type() for the parent trace class of bt_ctf_field_type_structure_get_field_type_by_name() for the field type of \p struct_field with the name \p name. @postrefcountsame{struct_field} -@post On success, if there's an existing field in - \p struct_field named \p name, its reference count is - decremented. +@post On success, the field in \p struct_field named \p name + may either be replaced by \p field or have the same value as \p field. @postsuccessrefcountinc{field} @sa bt_ctf_field_structure_get_field_by_index(): Returns the field of a -- 2.34.1