- return stream_class->event_header_fc;
-}
-
-int bt_stream_class_set_event_header_field_class(
- struct bt_stream_class *stream_class,
- struct bt_field_class *field_class)
-{
- int ret;
- struct bt_resolve_field_path_context resolve_ctx = {
- .packet_header = NULL,
- .packet_context = NULL,
- .event_header = field_class,
- .event_common_context = NULL,
- .event_specific_context = NULL,
- .event_payload = NULL,
- };
-
- BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
- BT_ASSERT_PRE_NON_NULL(field_class, "Field class");
- BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class);
- BT_ASSERT_PRE(bt_field_class_get_type(field_class) ==
- BT_FIELD_CLASS_TYPE_STRUCTURE,
- "Event header field class is not a structure field class: %!+F",
- field_class);
- resolve_ctx.packet_header =
- bt_stream_class_borrow_trace_class_inline(stream_class)->packet_header_fc;
- resolve_ctx.packet_context = stream_class->packet_context_fc;
- ret = bt_resolve_field_paths(field_class, &resolve_ctx);
- if (ret) {
- goto end;
- }
-
- bt_field_class_make_part_of_trace_class(field_class);
- bt_object_put_ref(stream_class->event_header_fc);
- stream_class->event_header_fc = field_class;
- bt_object_get_no_null_check(stream_class->event_header_fc);
- bt_field_class_freeze(field_class);
- BT_LIB_LOGV("Set stream class's event header field class: %!+S",
- stream_class);
-
-end:
- return ret;