ir: fields.c: fix public function names to get/set struct. field
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 12 Jun 2017 22:03:40 +0000 (18:03 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 14 Jun 2017 19:06:56 +0000 (15:06 -0400)
To remain symmetric, use bt_ctf_field_structure_get_field_by_name() and
bt_ctf_field_structure_set_field_by_name(), as it is possible that
bt_ctf_field_structure_set_field_by_index() exists in the future.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
include/babeltrace/ctf-ir/fields.h
lib/ctf-ir/event.c
lib/ctf-ir/fields.c
plugins/lttng-utils/copy.c

index 144b1e31773b296a7396708ed7716e8f9909f869..15468f4f014c5763ed091710f3afb15e7c27aafe 100644 (file)
@@ -85,13 +85,14 @@ contained fields with the following getters if such fields do not exist
 yet:
 
 - bt_ctf_field_enumeration_get_container()
-- bt_ctf_field_structure_get_field()
+- bt_ctf_field_structure_get_field_by_name()
 - bt_ctf_field_array_get_field()
 - bt_ctf_field_sequence_get_field()
 - bt_ctf_field_variant_get_field()
 
 If you already have a field object, you can also assign it to a specific
-name within a @structfield with bt_ctf_field_structure_set_field().
+name within a @structfield with
+bt_ctf_field_structure_set_field_by_name().
 
 You can get a reference to the @ft which was used to create a field with
 bt_ctf_field_get_type(). You can get the
@@ -828,10 +829,10 @@ contains an ordered list of zero or more named @fields which can be
 different @fts, and which is described by a @structft.
 
 To set the value of a specific field of a structure field, you need to
-first get the field with bt_ctf_field_structure_get_field() or
+first get the field with bt_ctf_field_structure_get_field_by_name() or
 bt_ctf_field_structure_get_field_by_index(). If you already have a
 field object, you can assign it to a specific name within a structure
-field with bt_ctf_field_structure_set_field().
+field with bt_ctf_field_structure_set_field_by_name().
 
 @sa ctfirstructfieldtype
 @sa ctfirfields
@@ -861,8 +862,8 @@ exist.
 
 @sa bt_ctf_field_structure_get_field_by_index(): Returns the field of a
        given structure field by index.
-@sa bt_ctf_field_structure_set_field(): Sets the field of a given
-       structure field.
+@sa bt_ctf_field_structure_set_field_by_name(): Sets the field of a
+       given structure field by name.
 */
 extern struct bt_ctf_field *bt_ctf_field_structure_get_field_by_name(
                struct bt_ctf_field *struct_field, const char *name);
@@ -888,10 +889,10 @@ extern struct bt_ctf_field *bt_ctf_field_structure_get_field_by_name(
 @postrefcountsame{struct_field}
 @postsuccessrefcountretinc
 
-@sa bt_ctf_field_structure_get_field(): Returns the field of a
+@sa bt_ctf_field_structure_get_field_by_name(): Returns the field of a
+       given structure field by name.
+@sa bt_ctf_field_structure_set_field_by_name(): Sets the field of a
        given structure field by name.
-@sa bt_ctf_field_structure_set_field(): Sets the field of a given
-       structure field.
 */
 extern struct bt_ctf_field *bt_ctf_field_structure_get_field_by_index(
                struct bt_ctf_field *struct_field, uint64_t index);
@@ -933,10 +934,11 @@ bt_ctf_trace_get_packet_header_type() for the parent trace class of
 
 @sa bt_ctf_field_structure_get_field_by_index(): Returns the field of a
        given structure field by index.
-@sa bt_ctf_field_structure_get_field(): Returns the field of a
+@sa bt_ctf_field_structure_get_field_by_name(): Returns the field of a
        given structure field by name.
 */
-extern int bt_ctf_field_structure_set_field(struct bt_ctf_field *struct_field,
+extern int bt_ctf_field_structure_set_field_by_name(
+               struct bt_ctf_field *struct_field,
                const char *name, struct bt_ctf_field *field);
 
 /** @} */
index d1a7f777658b0cc2b010d89842d7942fc453d067..47eeed46202520f4753523ae7e54e49774622c31 100644 (file)
@@ -340,8 +340,8 @@ int bt_ctf_event_set_payload(struct bt_ctf_event *event,
        }
 
        if (name) {
-               ret = bt_ctf_field_structure_set_field(event->fields_payload,
-                       name, payload);
+               ret = bt_ctf_field_structure_set_field_by_name(
+                       event->fields_payload, name, payload);
        } else {
                struct bt_ctf_field_type *payload_type;
 
index e9c6d8bee399d9f0844e33dce121bf52ed466f22..3ee3b9502dce12f0a45eceb1e6080b57938aced6 100644 (file)
@@ -662,7 +662,7 @@ error:
        return ret_field;
 }
 
-int bt_ctf_field_structure_set_field(struct bt_ctf_field *field,
+int bt_ctf_field_structure_set_field_by_name(struct bt_ctf_field *field,
                const char *name, struct bt_ctf_field *value)
 {
        int ret = 0;
index d3a6878b6f5e58208fff069ca85d15cc0ddb39c2..db828c42eab08a64334804281ce1401be6bd52a7 100644 (file)
@@ -1805,7 +1805,8 @@ int copy_set_debug_info_stream_event_context(FILE *err,
                                goto error;
                        }
 
-                       ret = bt_ctf_field_structure_set_field(writer_event_context,
+                       ret = bt_ctf_field_structure_set_field_by_name(
+                                       writer_event_context,
                                        field_name, copy_field);
                        if (ret) {
                                fprintf(err, "[error] %s in %s:%d\n", __func__,
This page took 0.027269 seconds and 4 git commands to generate.