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>
yet:
- bt_ctf_field_enumeration_get_container()
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
- 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
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
different @fts, and which is described by a @structft.
To set the value of a specific field of a structure field, you need to
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
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
@sa ctfirstructfieldtype
@sa ctfirfields
@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_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);
*/
extern struct bt_ctf_field *bt_ctf_field_structure_get_field_by_name(
struct bt_ctf_field *struct_field, const char *name);
@postrefcountsame{struct_field}
@postsuccessrefcountretinc
@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.
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);
*/
extern struct bt_ctf_field *bt_ctf_field_structure_get_field_by_index(
struct bt_ctf_field *struct_field, uint64_t index);
@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_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.
*/
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);
/** @} */
const char *name, struct bt_ctf_field *field);
/** @} */
- 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;
} else {
struct bt_ctf_field_type *payload_type;
-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;
const char *name, struct bt_ctf_field *value)
{
int ret = 0;
- 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__,
field_name, copy_field);
if (ret) {
fprintf(err, "[error] %s in %s:%d\n", __func__,