+
+ switch (byte_order) {
+ case BT_CTF_BYTE_ORDER_NETWORK:
+ case BT_CTF_BYTE_ORDER_BIG_ENDIAN:
+ internal_byte_order = BIG_ENDIAN;
+ break;
+ case BT_CTF_BYTE_ORDER_LITTLE_ENDIAN:
+ internal_byte_order = LITTLE_ENDIAN;
+ break;
+ default:
+ ret = -1;
+ goto end;
+ }
+
+ stream_class->byte_order = internal_byte_order;
+
+ /* Set native byte order to little or big endian */
+ bt_ctf_field_type_set_native_byte_order(
+ stream_class->event_header_type, stream_class->byte_order);
+ bt_ctf_field_type_set_native_byte_order(
+ stream_class->packet_context_type, stream_class->byte_order);
+ bt_ctf_field_type_set_native_byte_order(
+ stream_class->event_context_type, stream_class->byte_order);
+
+ /* Set all events' native byte order */
+ for (i = 0; i < stream_class->event_classes->len; i++) {
+ bt_ctf_event_class_set_native_byte_order(
+ g_ptr_array_index(stream_class->event_classes, i),
+ stream_class->byte_order);
+ bt_ctf_event_class_freeze(
+ g_ptr_array_index(stream_class->event_classes, i));
+ }