+const struct bt_value *bt_field_class_borrow_user_attributes_const(
+ const struct bt_field_class *fc)
+{
+ BT_ASSERT_PRE_DEV_FC_NON_NULL(fc);
+ return fc->user_attributes;
+}
+
+struct bt_value *bt_field_class_borrow_user_attributes(
+ struct bt_field_class *field_class)
+{
+ return (void *) bt_field_class_borrow_user_attributes_const(
+ (void *) field_class);
+}
+
+
+void bt_field_class_set_user_attributes(
+ struct bt_field_class *fc,
+ const struct bt_value *user_attributes)
+{
+ BT_ASSERT_PRE_FC_NON_NULL(fc);
+ BT_ASSERT_PRE_USER_ATTRS_NON_NULL(user_attributes);
+ BT_ASSERT_PRE_USER_ATTRS_IS_MAP(user_attributes);
+ BT_ASSERT_PRE_DEV_FC_HOT(fc);
+ bt_object_put_ref_no_null_check(fc->user_attributes);
+ fc->user_attributes = (void *) user_attributes;
+ bt_object_get_ref_no_null_check(fc->user_attributes);
+}
+
+static
+const struct bt_value *bt_named_field_class_borrow_user_attributes_const(
+ const struct bt_named_field_class *named_fc)
+{
+ return named_fc->user_attributes;
+}
+
+static
+void set_named_field_class_user_attributes(
+ struct bt_named_field_class *named_fc,
+ const struct bt_value *user_attributes, const char *api_func)
+{
+ BT_ASSERT_PRE_USER_ATTRS_NON_NULL_FROM_FUNC(api_func, user_attributes);
+ BT_ASSERT_PRE_USER_ATTRS_NON_NULL_FROM_FUNC(api_func, user_attributes);
+ bt_object_put_ref_no_null_check(named_fc->user_attributes);
+ named_fc->user_attributes = (void *) user_attributes;
+ bt_object_get_ref_no_null_check(named_fc->user_attributes);
+}
+
+const struct bt_value *
+bt_field_class_structure_member_borrow_user_attributes_const(
+ const struct bt_field_class_structure_member *member)
+{
+ BT_ASSERT_PRE_STRUCT_FC_MEMBER_NON_NULL(member);
+ return bt_named_field_class_borrow_user_attributes_const(
+ (const void *) member);
+}
+
+struct bt_value *
+bt_field_class_structure_member_borrow_user_attributes(
+ struct bt_field_class_structure_member *member)
+{
+ BT_ASSERT_PRE_STRUCT_FC_MEMBER_NON_NULL(member);
+ return (void *) bt_named_field_class_borrow_user_attributes_const(
+ (void *) member);
+}
+
+void bt_field_class_structure_member_set_user_attributes(
+ struct bt_field_class_structure_member *member,
+ const struct bt_value *user_attributes)
+{
+ BT_ASSERT_PRE_STRUCT_FC_MEMBER_NON_NULL(member);
+ BT_ASSERT_PRE_DEV_HOT("structure-field-class-member",
+ (struct bt_named_field_class *) member,
+ "Structure field class member", ".");
+ set_named_field_class_user_attributes((void *) member,
+ user_attributes, __func__);
+}
+
+const struct bt_value *bt_field_class_variant_option_borrow_user_attributes_const(
+ const struct bt_field_class_variant_option *option)
+{
+ BT_ASSERT_PRE_VAR_FC_OPT_NON_NULL(option);
+ return bt_named_field_class_borrow_user_attributes_const(
+ (const void *) option);
+}
+
+struct bt_value *bt_field_class_variant_option_borrow_user_attributes(
+ struct bt_field_class_variant_option *option)
+{
+ BT_ASSERT_PRE_VAR_FC_OPT_NON_NULL(option);
+ return (void *) bt_named_field_class_borrow_user_attributes_const(
+ (void *) option);
+}
+
+void bt_field_class_variant_option_set_user_attributes(
+ struct bt_field_class_variant_option *option,
+ const struct bt_value *user_attributes)
+{
+ BT_ASSERT_PRE_VAR_FC_OPT_NON_NULL(option);
+ BT_ASSERT_PRE_DEV_HOT("variant-field-class-option",
+ (struct bt_named_field_class *) option,
+ "Variant field class option", ".");
+ set_named_field_class_user_attributes((void *) option,
+ user_attributes, __func__);
+}
+