+struct bt_ctf_field_type *bt_ctf_event_class_get_payload_type(
+ struct bt_ctf_event_class *event_class)
+{
+ struct bt_ctf_field_type *payload = NULL;
+
+ if (!event_class) {
+ goto end;
+ }
+
+ bt_ctf_field_type_get(event_class->fields);
+ payload = event_class->fields;
+end:
+ return payload;
+}
+
+int bt_ctf_event_class_set_payload_type(struct bt_ctf_event_class *event_class,
+ struct bt_ctf_field_type *payload)
+{
+ int ret = 0;
+
+ if (!event_class || !payload) {
+ ret = -1;
+ goto end;
+ }
+
+ bt_ctf_field_type_get(payload);
+ bt_ctf_field_type_put(event_class->fields);
+ event_class->fields = payload;
+end:
+ return ret;
+}
+