* SOFTWARE.
*/
-#include <babeltrace/ctf-writer/event.h>
-#include <babeltrace/ctf-writer/event-types.h>
-#include <babeltrace/ctf-writer/event-fields.h>
-#include <babeltrace/ctf-ir/event-fields-internal.h>
-#include <babeltrace/ctf-ir/event-types-internal.h>
+#include <babeltrace/ctf-ir/fields-internal.h>
+#include <babeltrace/ctf-ir/field-types-internal.h>
#include <babeltrace/ctf-ir/event-internal.h>
#include <babeltrace/ctf-ir/stream-class.h>
#include <babeltrace/ctf-ir/stream-class-internal.h>
int ret = 0;
if (!event_class || !payload ||
- bt_ctf_field_type_get_type_id(payload) != CTF_TYPE_STRUCT) {
+ bt_ctf_field_type_get_type_id(payload) !=
+ BT_CTF_TYPE_ID_STRUCT) {
ret = -1;
goto end;
}
}
if (bt_ctf_field_type_get_type_id(event_class->fields) !=
- CTF_TYPE_STRUCT) {
+ BT_CTF_TYPE_ID_STRUCT) {
ret = -1;
goto end;
}
}
if (bt_ctf_field_type_get_type_id(event_class->fields) !=
- CTF_TYPE_STRUCT) {
+ BT_CTF_TYPE_ID_STRUCT) {
ret = -1;
goto end;
}
}
if (bt_ctf_field_type_get_type_id(event_class->fields) !=
- CTF_TYPE_STRUCT) {
+ BT_CTF_TYPE_ID_STRUCT) {
ret = -1;
goto end;
}
}
if (bt_ctf_field_type_get_type_id(event_class->fields) !=
- CTF_TYPE_STRUCT) {
+ BT_CTF_TYPE_ID_STRUCT) {
goto end;
}
goto end;
}
- if (bt_ctf_field_type_get_type_id(context) != CTF_TYPE_STRUCT) {
+ if (bt_ctf_field_type_get_type_id(context) != BT_CTF_TYPE_ID_STRUCT) {
ret = -1;
goto end;
}
ret = bt_ctf_attributes_set_field_value(event_class->attributes,
"stream_id", obj);
+ if (event_class->frozen) {
+ bt_ctf_attributes_freeze(event_class->attributes);
+ }
+
end:
BT_PUT(obj);
return ret;
goto end;
}
- if (bt_ctf_field_type_get_type_id(payload_type) != CTF_TYPE_STRUCT) {
+ if (bt_ctf_field_type_get_type_id(payload_type) !=
+ BT_CTF_TYPE_ID_STRUCT) {
ret = -1;
goto end;
}
field_type = bt_ctf_field_get_type(field);
assert(field_type);
- if (bt_ctf_field_type_get_type_id(field_type) != CTF_TYPE_INTEGER) {
+ if (bt_ctf_field_type_get_type_id(field_type) !=
+ BT_CTF_TYPE_ID_INTEGER) {
/* Not an integer and the value is unset, error. */
ret = -1;
goto end;