ir: rename event-fields/event-types -> fields/field-types
[babeltrace.git] / formats / ctf / ir / event.c
index 85edf6942081f7705e81eeded43eb83ac846397b..8ddf8034617ec76dde8503e4f2ae93709930ef98 100644 (file)
  * 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>
@@ -349,7 +346,8 @@ int bt_ctf_event_class_set_payload_type(struct bt_ctf_event_class *event_class,
        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;
        }
@@ -374,7 +372,7 @@ int bt_ctf_event_class_add_field(struct bt_ctf_event_class *event_class,
        }
 
        if (bt_ctf_field_type_get_type_id(event_class->fields) !=
-               CTF_TYPE_STRUCT) {
+               BT_CTF_TYPE_ID_STRUCT) {
                ret = -1;
                goto end;
        }
@@ -396,7 +394,7 @@ int bt_ctf_event_class_get_field_count(
        }
 
        if (bt_ctf_field_type_get_type_id(event_class->fields) !=
-               CTF_TYPE_STRUCT) {
+               BT_CTF_TYPE_ID_STRUCT) {
                ret = -1;
                goto end;
        }
@@ -418,7 +416,7 @@ int bt_ctf_event_class_get_field(struct bt_ctf_event_class *event_class,
        }
 
        if (bt_ctf_field_type_get_type_id(event_class->fields) !=
-               CTF_TYPE_STRUCT) {
+               BT_CTF_TYPE_ID_STRUCT) {
                ret = -1;
                goto end;
        }
@@ -440,7 +438,7 @@ struct bt_ctf_field_type *bt_ctf_event_class_get_field_by_name(
        }
 
        if (bt_ctf_field_type_get_type_id(event_class->fields) !=
-               CTF_TYPE_STRUCT) {
+               BT_CTF_TYPE_ID_STRUCT) {
                goto end;
        }
 
@@ -485,7 +483,7 @@ int bt_ctf_event_class_set_context_type(
                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;
        }
@@ -525,6 +523,10 @@ int bt_ctf_event_class_set_stream_id(struct bt_ctf_event_class *event_class,
        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;
@@ -830,7 +832,8 @@ int bt_ctf_event_set_payload_field(struct bt_ctf_event *event,
                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;
        }
@@ -1030,7 +1033,8 @@ int set_integer_field_value(struct bt_ctf_field* field, uint64_t value)
        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;
This page took 0.027321 seconds and 4 git commands to generate.