Rename bt_ctf_X -> bt_X, maintain backward compat. for pre-2.0 CTF writer
[babeltrace.git] / lib / ctf-ir / event-class.c
index b8bd96ece18384c66ab317e1baa6f29f78783d7f..4c969978b27220fbd54f225d99cdf232ba9f9504 100644 (file)
 #include <stdlib.h>
 
 static
-void bt_ctf_event_class_destroy(struct bt_object *obj);
+void bt_event_class_destroy(struct bt_object *obj);
 
-struct bt_ctf_event_class *bt_ctf_event_class_create(const char *name)
+struct bt_event_class *bt_event_class_create(const char *name)
 {
        struct bt_value *obj = NULL;
-       struct bt_ctf_event_class *event_class = NULL;
+       struct bt_event_class *event_class = NULL;
 
        BT_LOGD("Creating event class object: name=\"%s\"",
                name);
@@ -63,14 +63,14 @@ struct bt_ctf_event_class *bt_ctf_event_class_create(const char *name)
                goto error;
        }
 
-       event_class = g_new0(struct bt_ctf_event_class, 1);
+       event_class = g_new0(struct bt_event_class, 1);
        if (!event_class) {
                BT_LOGE_STR("Failed to allocate one event class.");
                goto error;
        }
 
-       bt_object_init(event_class, bt_ctf_event_class_destroy);
-       event_class->fields = bt_ctf_field_type_structure_create();
+       bt_object_init(event_class, bt_event_class_destroy);
+       event_class->fields = bt_field_type_structure_create();
        if (!event_class->fields) {
                BT_LOGE_STR("Cannot create event class's initial payload field type object.");
                goto error;
@@ -89,10 +89,10 @@ struct bt_ctf_event_class *bt_ctf_event_class_create(const char *name)
                goto error;
        }
 
-       event_class->log_level = BT_CTF_EVENT_CLASS_LOG_LEVEL_UNSPECIFIED;
+       event_class->log_level = BT_EVENT_CLASS_LOG_LEVEL_UNSPECIFIED;
        BT_PUT(obj);
        BT_LOGD("Created event class object: addr=%p, name=\"%s\"",
-               event_class, bt_ctf_event_class_get_name(event_class));
+               event_class, bt_event_class_get_name(event_class));
        return event_class;
 
 error:
@@ -101,7 +101,7 @@ error:
        return event_class;
 }
 
-const char *bt_ctf_event_class_get_name(struct bt_ctf_event_class *event_class)
+const char *bt_event_class_get_name(struct bt_event_class *event_class)
 {
        const char *name = NULL;
 
@@ -116,7 +116,7 @@ end:
        return name;
 }
 
-int64_t bt_ctf_event_class_get_id(struct bt_ctf_event_class *event_class)
+int64_t bt_event_class_get_id(struct bt_event_class *event_class)
 {
        int64_t ret = 0;
 
@@ -132,7 +132,7 @@ end:
        return ret;
 }
 
-int bt_ctf_event_class_set_id(struct bt_ctf_event_class *event_class,
+int bt_event_class_set_id(struct bt_event_class *event_class,
                uint64_t id_param)
 {
        int ret = 0;
@@ -147,8 +147,8 @@ int bt_ctf_event_class_set_id(struct bt_ctf_event_class *event_class,
        if (event_class->frozen) {
                BT_LOGW("Invalid parameter: event class is frozen: "
                        "addr=%p, name=\"%s\", id=%" PRId64,
-                       event_class, bt_ctf_event_class_get_name(event_class),
-                       bt_ctf_event_class_get_id(event_class));
+                       event_class, bt_event_class_get_name(event_class),
+                       bt_event_class_get_id(event_class));
                ret = -1;
                goto end;
        }
@@ -156,7 +156,7 @@ int bt_ctf_event_class_set_id(struct bt_ctf_event_class *event_class,
        if (id < 0) {
                BT_LOGW("Invalid parameter: invalid event class's ID: "
                        "addr=%p, name=\"%s\", id=%" PRIu64,
-                       event_class, bt_ctf_event_class_get_name(event_class),
+                       event_class, bt_event_class_get_name(event_class),
                        id_param);
                ret = -1;
                goto end;
@@ -165,20 +165,20 @@ int bt_ctf_event_class_set_id(struct bt_ctf_event_class *event_class,
        event_class->id = id;
        BT_LOGV("Set event class's ID: "
                "addr=%p, name=\"%s\", id=%" PRId64,
-               event_class, bt_ctf_event_class_get_name(event_class), id);
+               event_class, bt_event_class_get_name(event_class), id);
 
 end:
        return ret;
 }
 
-enum bt_ctf_event_class_log_level bt_ctf_event_class_get_log_level(
-               struct bt_ctf_event_class *event_class)
+enum bt_event_class_log_level bt_event_class_get_log_level(
+               struct bt_event_class *event_class)
 {
-       enum bt_ctf_event_class_log_level log_level;
+       enum bt_event_class_log_level log_level;
 
        if (!event_class) {
                BT_LOGW_STR("Invalid parameter: event class is NULL.");
-               log_level = BT_CTF_EVENT_CLASS_LOG_LEVEL_UNKNOWN;
+               log_level = BT_EVENT_CLASS_LOG_LEVEL_UNKNOWN;
                goto end;
        }
 
@@ -188,8 +188,8 @@ end:
        return log_level;
 }
 
-int bt_ctf_event_class_set_log_level(struct bt_ctf_event_class *event_class,
-               enum bt_ctf_event_class_log_level log_level)
+int bt_event_class_set_log_level(struct bt_event_class *event_class,
+               enum bt_event_class_log_level log_level)
 {
        int ret = 0;
 
@@ -202,35 +202,35 @@ int bt_ctf_event_class_set_log_level(struct bt_ctf_event_class *event_class,
        if (event_class->frozen) {
                BT_LOGW("Invalid parameter: event class is frozen: "
                        "addr=%p, name=\"%s\", id=%" PRId64,
-                       event_class, bt_ctf_event_class_get_name(event_class),
-                       bt_ctf_event_class_get_id(event_class));
+                       event_class, bt_event_class_get_name(event_class),
+                       bt_event_class_get_id(event_class));
                ret = -1;
                goto end;
        }
 
        switch (log_level) {
-       case BT_CTF_EVENT_CLASS_LOG_LEVEL_UNSPECIFIED:
-       case BT_CTF_EVENT_CLASS_LOG_LEVEL_EMERGENCY:
-       case BT_CTF_EVENT_CLASS_LOG_LEVEL_ALERT:
-       case BT_CTF_EVENT_CLASS_LOG_LEVEL_CRITICAL:
-       case BT_CTF_EVENT_CLASS_LOG_LEVEL_ERROR:
-       case BT_CTF_EVENT_CLASS_LOG_LEVEL_WARNING:
-       case BT_CTF_EVENT_CLASS_LOG_LEVEL_NOTICE:
-       case BT_CTF_EVENT_CLASS_LOG_LEVEL_INFO:
-       case BT_CTF_EVENT_CLASS_LOG_LEVEL_DEBUG_SYSTEM:
-       case BT_CTF_EVENT_CLASS_LOG_LEVEL_DEBUG_PROGRAM:
-       case BT_CTF_EVENT_CLASS_LOG_LEVEL_DEBUG_PROCESS:
-       case BT_CTF_EVENT_CLASS_LOG_LEVEL_DEBUG_MODULE:
-       case BT_CTF_EVENT_CLASS_LOG_LEVEL_DEBUG_UNIT:
-       case BT_CTF_EVENT_CLASS_LOG_LEVEL_DEBUG_FUNCTION:
-       case BT_CTF_EVENT_CLASS_LOG_LEVEL_DEBUG_LINE:
-       case BT_CTF_EVENT_CLASS_LOG_LEVEL_DEBUG:
+       case BT_EVENT_CLASS_LOG_LEVEL_UNSPECIFIED:
+       case BT_EVENT_CLASS_LOG_LEVEL_EMERGENCY:
+       case BT_EVENT_CLASS_LOG_LEVEL_ALERT:
+       case BT_EVENT_CLASS_LOG_LEVEL_CRITICAL:
+       case BT_EVENT_CLASS_LOG_LEVEL_ERROR:
+       case BT_EVENT_CLASS_LOG_LEVEL_WARNING:
+       case BT_EVENT_CLASS_LOG_LEVEL_NOTICE:
+       case BT_EVENT_CLASS_LOG_LEVEL_INFO:
+       case BT_EVENT_CLASS_LOG_LEVEL_DEBUG_SYSTEM:
+       case BT_EVENT_CLASS_LOG_LEVEL_DEBUG_PROGRAM:
+       case BT_EVENT_CLASS_LOG_LEVEL_DEBUG_PROCESS:
+       case BT_EVENT_CLASS_LOG_LEVEL_DEBUG_MODULE:
+       case BT_EVENT_CLASS_LOG_LEVEL_DEBUG_UNIT:
+       case BT_EVENT_CLASS_LOG_LEVEL_DEBUG_FUNCTION:
+       case BT_EVENT_CLASS_LOG_LEVEL_DEBUG_LINE:
+       case BT_EVENT_CLASS_LOG_LEVEL_DEBUG:
                break;
        default:
                BT_LOGW("Invalid parameter: unknown event class log level: "
                        "addr=%p, name=\"%s\", id=%" PRId64 ", log-level=%d",
-                       event_class, bt_ctf_event_class_get_name(event_class),
-                       bt_ctf_event_class_get_id(event_class), log_level);
+                       event_class, bt_event_class_get_name(event_class),
+                       bt_event_class_get_id(event_class), log_level);
                ret = -1;
                goto end;
        }
@@ -238,16 +238,16 @@ int bt_ctf_event_class_set_log_level(struct bt_ctf_event_class *event_class,
        event_class->log_level = log_level;
        BT_LOGV("Set event class's log level: "
                "addr=%p, name=\"%s\", id=%" PRId64 ", log-level=%s",
-               event_class, bt_ctf_event_class_get_name(event_class),
-               bt_ctf_event_class_get_id(event_class),
-               bt_ctf_event_class_log_level_string(log_level));
+               event_class, bt_event_class_get_name(event_class),
+               bt_event_class_get_id(event_class),
+               bt_event_class_log_level_string(log_level));
 
 end:
        return ret;
 }
 
-const char *bt_ctf_event_class_get_emf_uri(
-               struct bt_ctf_event_class *event_class)
+const char *bt_event_class_get_emf_uri(
+               struct bt_event_class *event_class)
 {
        const char *emf_uri = NULL;
 
@@ -264,7 +264,7 @@ end:
        return emf_uri;
 }
 
-int bt_ctf_event_class_set_emf_uri(struct bt_ctf_event_class *event_class,
+int bt_event_class_set_emf_uri(struct bt_event_class *event_class,
                const char *emf_uri)
 {
        int ret = 0;
@@ -284,8 +284,8 @@ int bt_ctf_event_class_set_emf_uri(struct bt_ctf_event_class *event_class,
        if (event_class->frozen) {
                BT_LOGW("Invalid parameter: event class is frozen: "
                        "addr=%p, name=\"%s\", id=%" PRId64,
-                       event_class, bt_ctf_event_class_get_name(event_class),
-                       bt_ctf_event_class_get_id(event_class));
+                       event_class, bt_event_class_get_name(event_class),
+                       bt_event_class_get_id(event_class));
                ret = -1;
                goto end;
        }
@@ -294,32 +294,32 @@ int bt_ctf_event_class_set_emf_uri(struct bt_ctf_event_class *event_class,
                g_string_assign(event_class->emf_uri, emf_uri);
                BT_LOGV("Set event class's EMF URI: "
                        "addr=%p, name=\"%s\", id=%" PRId64 ", emf-uri=\"%s\"",
-                       event_class, bt_ctf_event_class_get_name(event_class),
-                       bt_ctf_event_class_get_id(event_class), emf_uri);
+                       event_class, bt_event_class_get_name(event_class),
+                       bt_event_class_get_id(event_class), emf_uri);
        } else {
                g_string_assign(event_class->emf_uri, "");
                BT_LOGV("Reset event class's EMF URI: "
                        "addr=%p, name=\"%s\", id=%" PRId64,
-                       event_class, bt_ctf_event_class_get_name(event_class),
-                       bt_ctf_event_class_get_id(event_class));
+                       event_class, bt_event_class_get_name(event_class),
+                       bt_event_class_get_id(event_class));
        }
 
 end:
        return ret;
 }
 
-struct bt_ctf_stream_class *bt_ctf_event_class_get_stream_class(
-               struct bt_ctf_event_class *event_class)
+struct bt_stream_class *bt_event_class_get_stream_class(
+               struct bt_event_class *event_class)
 {
        return event_class ?
-               bt_get(bt_ctf_event_class_borrow_stream_class(event_class)) :
+               bt_get(bt_event_class_borrow_stream_class(event_class)) :
                NULL;
 }
 
-struct bt_ctf_field_type *bt_ctf_event_class_get_payload_type(
-               struct bt_ctf_event_class *event_class)
+struct bt_field_type *bt_event_class_get_payload_type(
+               struct bt_event_class *event_class)
 {
-       struct bt_ctf_field_type *payload = NULL;
+       struct bt_field_type *payload = NULL;
 
        if (!event_class) {
                BT_LOGW_STR("Invalid parameter: event class is NULL.");
@@ -332,8 +332,8 @@ 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 bt_event_class_set_payload_type(struct bt_event_class *event_class,
+               struct bt_field_type *payload)
 {
        int ret = 0;
 
@@ -343,15 +343,15 @@ int bt_ctf_event_class_set_payload_type(struct bt_ctf_event_class *event_class,
                goto end;
        }
 
-       if (payload && bt_ctf_field_type_get_type_id(payload) !=
-                       BT_CTF_FIELD_TYPE_ID_STRUCT) {
+       if (payload && bt_field_type_get_type_id(payload) !=
+                       BT_FIELD_TYPE_ID_STRUCT) {
                BT_LOGW("Invalid parameter: event class's payload field type must be a structure: "
                        "addr=%p, name=\"%s\", id=%" PRId64 ", "
                        "payload-ft-addr=%p, payload-ft-id=%s",
-                       event_class, bt_ctf_event_class_get_name(event_class),
-                       bt_ctf_event_class_get_id(event_class), payload,
-                       bt_ctf_field_type_id_string(
-                               bt_ctf_field_type_get_type_id(payload)));
+                       event_class, bt_event_class_get_name(event_class),
+                       bt_event_class_get_id(event_class), payload,
+                       bt_field_type_id_string(
+                               bt_field_type_get_type_id(payload)));
                ret = -1;
                goto end;
        }
@@ -361,14 +361,14 @@ int bt_ctf_event_class_set_payload_type(struct bt_ctf_event_class *event_class,
        BT_LOGV("Set event class's payload field type: "
                "event-class-addr=%p, event-class-name=\"%s\", "
                "event-class-id=%" PRId64 ", payload-ft-addr=%p",
-               event_class, bt_ctf_event_class_get_name(event_class),
-               bt_ctf_event_class_get_id(event_class), payload);
+               event_class, bt_event_class_get_name(event_class),
+               bt_event_class_get_id(event_class), payload);
 end:
        return ret;
 }
 
-int bt_ctf_event_class_add_field(struct bt_ctf_event_class *event_class,
-               struct bt_ctf_field_type *type,
+int bt_event_class_add_field(struct bt_event_class *event_class,
+               struct bt_field_type *type,
                const char *name)
 {
        int ret = 0;
@@ -381,11 +381,11 @@ int bt_ctf_event_class_add_field(struct bt_ctf_event_class *event_class,
                goto end;
        }
 
-       if (bt_ctf_validate_identifier(name)) {
+       if (bt_identifier_is_valid(name)) {
                BT_LOGW("Invalid parameter: event class's payload field type's field name is not a valid CTF identifier: "
                        "addr=%p, name=\"%s\", id=%" PRId64 ", field-name=\"%s\"",
-                       event_class, bt_ctf_event_class_get_name(event_class),
-                       bt_ctf_event_class_get_id(event_class),
+                       event_class, bt_event_class_get_name(event_class),
+                       bt_event_class_get_id(event_class),
                        name);
                ret = -1;
                goto end;
@@ -394,8 +394,8 @@ int bt_ctf_event_class_add_field(struct bt_ctf_event_class *event_class,
        if (event_class->frozen) {
                BT_LOGW("Invalid parameter: event class is frozen: "
                        "addr=%p, name=\"%s\", id=%" PRId64,
-                       event_class, bt_ctf_event_class_get_name(event_class),
-                       bt_ctf_event_class_get_id(event_class));
+                       event_class, bt_event_class_get_name(event_class),
+                       bt_event_class_get_id(event_class));
                ret = -1;
                goto end;
        }
@@ -403,27 +403,27 @@ int bt_ctf_event_class_add_field(struct bt_ctf_event_class *event_class,
        if (!event_class->fields) {
                BT_LOGW("Event class has no payload field type: "
                        "addr=%p, name=\"%s\", id=%" PRId64,
-                       event_class, bt_ctf_event_class_get_name(event_class),
-                       bt_ctf_event_class_get_id(event_class));
+                       event_class, bt_event_class_get_name(event_class),
+                       bt_event_class_get_id(event_class));
                ret = -1;
                goto end;
        }
 
-       assert(bt_ctf_field_type_get_type_id(event_class->fields) ==
-               BT_CTF_FIELD_TYPE_ID_STRUCT);
-       ret = bt_ctf_field_type_structure_add_field(event_class->fields,
+       assert(bt_field_type_get_type_id(event_class->fields) ==
+               BT_FIELD_TYPE_ID_STRUCT);
+       ret = bt_field_type_structure_add_field(event_class->fields,
                type, name);
        BT_LOGV("Added field to event class's payload field type: "
                "event-class-addr=%p, event-class-name=\"%s\", "
                "event-class-id=%" PRId64 ", field-name=\"%s\", ft-addr=%p",
-               event_class, bt_ctf_event_class_get_name(event_class),
-               bt_ctf_event_class_get_id(event_class), name, type);
+               event_class, bt_event_class_get_name(event_class),
+               bt_event_class_get_id(event_class), name, type);
 end:
        return ret;
 }
 
-int64_t bt_ctf_event_class_get_payload_type_field_count(
-               struct bt_ctf_event_class *event_class)
+int64_t bt_event_class_get_payload_type_field_count(
+               struct bt_event_class *event_class)
 {
        int64_t ret;
 
@@ -436,22 +436,22 @@ int64_t bt_ctf_event_class_get_payload_type_field_count(
        if (!event_class->fields) {
                BT_LOGV("Event class has no payload field type: "
                        "addr=%p, name=\"%s\", id=%" PRId64,
-                       event_class, bt_ctf_event_class_get_name(event_class),
-                       bt_ctf_event_class_get_id(event_class));
+                       event_class, bt_event_class_get_name(event_class),
+                       bt_event_class_get_id(event_class));
                ret = (int64_t) -1;
                goto end;
        }
 
-       assert(bt_ctf_field_type_get_type_id(event_class->fields) ==
-               BT_CTF_FIELD_TYPE_ID_STRUCT);
-       ret = bt_ctf_field_type_structure_get_field_count(event_class->fields);
+       assert(bt_field_type_get_type_id(event_class->fields) ==
+               BT_FIELD_TYPE_ID_STRUCT);
+       ret = bt_field_type_structure_get_field_count(event_class->fields);
 end:
        return ret;
 }
 
-int bt_ctf_event_class_get_payload_type_field_by_index(
-               struct bt_ctf_event_class *event_class,
-               const char **field_name, struct bt_ctf_field_type **field_type,
+int bt_event_class_get_payload_type_field_by_index(
+               struct bt_event_class *event_class,
+               const char **field_name, struct bt_field_type **field_type,
                uint64_t index)
 {
        int ret;
@@ -465,26 +465,26 @@ int bt_ctf_event_class_get_payload_type_field_by_index(
        if (!event_class->fields) {
                BT_LOGV("Event class has no payload field type: "
                        "addr=%p, name=\"%s\", id=%" PRId64 ", index=%" PRIu64,
-                       event_class, bt_ctf_event_class_get_name(event_class),
-                       bt_ctf_event_class_get_id(event_class), index);
+                       event_class, bt_event_class_get_name(event_class),
+                       bt_event_class_get_id(event_class), index);
                ret = -1;
                goto end;
        }
 
-       assert(bt_ctf_field_type_get_type_id(event_class->fields) ==
-               BT_CTF_FIELD_TYPE_ID_STRUCT);
-       ret = bt_ctf_field_type_structure_get_field(event_class->fields,
+       assert(bt_field_type_get_type_id(event_class->fields) ==
+               BT_FIELD_TYPE_ID_STRUCT);
+       ret = bt_field_type_structure_get_field_by_index(event_class->fields,
                field_name, field_type, index);
 end:
        return ret;
 }
 
-struct bt_ctf_field_type *
-bt_ctf_event_class_get_payload_type_field_type_by_name(
-               struct bt_ctf_event_class *event_class, const char *name)
+struct bt_field_type *
+bt_event_class_get_payload_type_field_type_by_name(
+               struct bt_event_class *event_class, const char *name)
 {
        GQuark name_quark;
-       struct bt_ctf_field_type *field_type = NULL;
+       struct bt_field_type *field_type = NULL;
 
        if (!event_class || !name) {
                BT_LOGW("Invalid parameter: event class or name is NULL: "
@@ -496,13 +496,13 @@ bt_ctf_event_class_get_payload_type_field_type_by_name(
        if (!event_class->fields) {
                BT_LOGV("Event class has no payload field type: "
                        "addr=%p, name=\"%s\", id=%" PRId64,
-                       event_class, bt_ctf_event_class_get_name(event_class),
-                       bt_ctf_event_class_get_id(event_class));
+                       event_class, bt_event_class_get_name(event_class),
+                       bt_event_class_get_id(event_class));
                goto end;
        }
 
-       assert(bt_ctf_field_type_get_type_id(event_class->fields) ==
-               BT_CTF_FIELD_TYPE_ID_STRUCT);
+       assert(bt_field_type_get_type_id(event_class->fields) ==
+               BT_FIELD_TYPE_ID_STRUCT);
        name_quark = g_quark_try_string(name);
        if (!name_quark) {
                BT_LOGE("Cannot get GQuark: string=\"%s\"", name);
@@ -513,16 +513,16 @@ bt_ctf_event_class_get_payload_type_field_type_by_name(
         * No need to increment field_type's reference count since getting it
         * from the structure already does.
         */
-       field_type = bt_ctf_field_type_structure_get_field_type_by_name(
+       field_type = bt_field_type_structure_get_field_type_by_name(
                event_class->fields, name);
 end:
        return field_type;
 }
 
-struct bt_ctf_field_type *bt_ctf_event_class_get_context_type(
-               struct bt_ctf_event_class *event_class)
+struct bt_field_type *bt_event_class_get_context_type(
+               struct bt_event_class *event_class)
 {
-       struct bt_ctf_field_type *context_type = NULL;
+       struct bt_field_type *context_type = NULL;
 
        if (!event_class) {
                BT_LOGW_STR("Invalid parameter: event class is NULL.");
@@ -532,8 +532,8 @@ struct bt_ctf_field_type *bt_ctf_event_class_get_context_type(
        if (!event_class->context) {
                BT_LOGV("Event class has no context field type: "
                        "addr=%p, name=\"%s\", id=%" PRId64,
-                       event_class, bt_ctf_event_class_get_name(event_class),
-                       bt_ctf_event_class_get_id(event_class));
+                       event_class, bt_event_class_get_name(event_class),
+                       bt_event_class_get_id(event_class));
                goto end;
        }
 
@@ -543,9 +543,9 @@ end:
        return context_type;
 }
 
-int bt_ctf_event_class_set_context_type(
-               struct bt_ctf_event_class *event_class,
-               struct bt_ctf_field_type *context)
+int bt_event_class_set_context_type(
+               struct bt_event_class *event_class,
+               struct bt_field_type *context)
 {
        int ret = 0;
 
@@ -558,21 +558,21 @@ int bt_ctf_event_class_set_context_type(
        if (event_class->frozen) {
                BT_LOGW("Invalid parameter: event class is frozen: "
                        "addr=%p, name=\"%s\", id=%" PRId64,
-                       event_class, bt_ctf_event_class_get_name(event_class),
-                       bt_ctf_event_class_get_id(event_class));
+                       event_class, bt_event_class_get_name(event_class),
+                       bt_event_class_get_id(event_class));
                ret = -1;
                goto end;
        }
 
-       if (context && bt_ctf_field_type_get_type_id(context) !=
-                       BT_CTF_FIELD_TYPE_ID_STRUCT) {
+       if (context && bt_field_type_get_type_id(context) !=
+                       BT_FIELD_TYPE_ID_STRUCT) {
                BT_LOGW("Invalid parameter: event class's context field type must be a structure: "
                        "addr=%p, name=\"%s\", id=%" PRId64 ", "
                        "context-ft-id=%s",
-                       event_class, bt_ctf_event_class_get_name(event_class),
-                       bt_ctf_event_class_get_id(event_class),
-                       bt_ctf_field_type_id_string(
-                               bt_ctf_field_type_get_type_id(context)));
+                       event_class, bt_event_class_get_name(event_class),
+                       bt_event_class_get_id(event_class),
+                       bt_field_type_id_string(
+                               bt_field_type_get_type_id(context)));
                ret = -1;
                goto end;
        }
@@ -582,34 +582,34 @@ int bt_ctf_event_class_set_context_type(
        BT_LOGV("Set event class's context field type: "
                "event-class-addr=%p, event-class-name=\"%s\", "
                "event-class-id=%" PRId64 ", context-ft-addr=%p",
-               event_class, bt_ctf_event_class_get_name(event_class),
-               bt_ctf_event_class_get_id(event_class), context);
+               event_class, bt_event_class_get_name(event_class),
+               bt_event_class_get_id(event_class), context);
 end:
        return ret;
 
 }
 
 /* Pre-2.0 CTF writer backward compatibility */
-void bt_ctf_event_class_get(struct bt_ctf_event_class *event_class)
+void bt_ctf_event_class_get(struct bt_event_class *event_class)
 {
        bt_get(event_class);
 }
 
 /* Pre-2.0 CTF writer backward compatibility */
-void bt_ctf_event_class_put(struct bt_ctf_event_class *event_class)
+void bt_ctf_event_class_put(struct bt_event_class *event_class)
 {
        bt_put(event_class);
 }
 
 static
-void bt_ctf_event_class_destroy(struct bt_object *obj)
+void bt_event_class_destroy(struct bt_object *obj)
 {
-       struct bt_ctf_event_class *event_class;
+       struct bt_event_class *event_class;
 
-       event_class = container_of(obj, struct bt_ctf_event_class, base);
+       event_class = container_of(obj, struct bt_event_class, base);
        BT_LOGD("Destroying event class: addr=%p, name=\"%s\", id=%" PRId64,
-               event_class, bt_ctf_event_class_get_name(event_class),
-               bt_ctf_event_class_get_id(event_class));
+               event_class, bt_event_class_get_name(event_class),
+               bt_event_class_get_id(event_class));
        g_string_free(event_class->name, TRUE);
        g_string_free(event_class->emf_uri, TRUE);
        BT_LOGD_STR("Putting context field type.");
@@ -620,7 +620,7 @@ void bt_ctf_event_class_destroy(struct bt_object *obj)
 }
 
 BT_HIDDEN
-void bt_ctf_event_class_freeze(struct bt_ctf_event_class *event_class)
+void bt_event_class_freeze(struct bt_event_class *event_class)
 {
        assert(event_class);
 
@@ -629,17 +629,17 @@ void bt_ctf_event_class_freeze(struct bt_ctf_event_class *event_class)
        }
 
        BT_LOGD("Freezing event class: addr=%p, name=\"%s\", id=%" PRId64,
-               event_class, bt_ctf_event_class_get_name(event_class),
-               bt_ctf_event_class_get_id(event_class));
+               event_class, bt_event_class_get_name(event_class),
+               bt_event_class_get_id(event_class));
        event_class->frozen = 1;
        BT_LOGD_STR("Freezing event class's context field type.");
-       bt_ctf_field_type_freeze(event_class->context);
+       bt_field_type_freeze(event_class->context);
        BT_LOGD_STR("Freezing event class's payload field type.");
-       bt_ctf_field_type_freeze(event_class->fields);
+       bt_field_type_freeze(event_class->fields);
 }
 
 BT_HIDDEN
-int bt_ctf_event_class_serialize(struct bt_ctf_event_class *event_class,
+int bt_event_class_serialize(struct bt_event_class *event_class,
                struct metadata_context *context)
 {
        int ret = 0;
@@ -650,8 +650,8 @@ int bt_ctf_event_class_serialize(struct bt_ctf_event_class *event_class,
        BT_LOGD("Serializing event class's metadata: "
                "event-class-addr=%p, event-class-name=\"%s\", "
                "event-class-id=%" PRId64 ", metadata-context-addr=%p",
-               event_class, bt_ctf_event_class_get_name(event_class),
-               bt_ctf_event_class_get_id(event_class), context);
+               event_class, bt_event_class_get_name(event_class),
+               bt_event_class_get_id(event_class), context);
        context->current_indentation_level = 1;
        g_string_assign(context->field_name, "");
        g_string_append(context->string, "event {\n");
@@ -663,10 +663,10 @@ int bt_ctf_event_class_serialize(struct bt_ctf_event_class *event_class,
        g_string_append_printf(context->string, "\tid = %" PRId64 ";\n",
                event_class->id);
        g_string_append_printf(context->string, "\tstream_id = %" PRId64 ";\n",
-               bt_ctf_stream_class_get_id(
-                       bt_ctf_event_class_borrow_stream_class(event_class)));
+               bt_stream_class_get_id(
+                       bt_event_class_borrow_stream_class(event_class)));
 
-       if (event_class->log_level != BT_CTF_EVENT_CLASS_LOG_LEVEL_UNSPECIFIED) {
+       if (event_class->log_level != BT_EVENT_CLASS_LOG_LEVEL_UNSPECIFIED) {
                g_string_append_printf(context->string, "\tloglevel = %d;\n",
                        (int) event_class->log_level);
        }
@@ -680,7 +680,7 @@ int bt_ctf_event_class_serialize(struct bt_ctf_event_class *event_class,
        if (event_class->context) {
                g_string_append(context->string, "\tcontext := ");
                BT_LOGD_STR("Serializing event class's context field type metadata.");
-               ret = bt_ctf_field_type_serialize(event_class->context,
+               ret = bt_field_type_serialize(event_class->context,
                        context);
                if (ret) {
                        BT_LOGW("Cannot serialize event class's context field type's metadata: "
@@ -694,7 +694,7 @@ int bt_ctf_event_class_serialize(struct bt_ctf_event_class *event_class,
        if (event_class->fields) {
                g_string_append(context->string, "\tfields := ");
                BT_LOGD_STR("Serializing event class's payload field type metadata.");
-               ret = bt_ctf_field_type_serialize(event_class->fields, context);
+               ret = bt_field_type_serialize(event_class->fields, context);
                if (ret) {
                        BT_LOGW("Cannot serialize event class's payload field type's metadata: "
                                "ret=%d", ret);
This page took 0.038436 seconds and 4 git commands to generate.