lib: add aliases for Babeltrace structure types
[babeltrace.git] / plugins / ctf / common / metadata / ctf-meta.h
index 5f4dce53587a91c6e7263ab5d5035d576f80272e..b4d56a45d87b95cbb4b42daab10dfd10b31f04a4 100644 (file)
@@ -66,7 +66,7 @@ struct ctf_field_class {
        bool in_ir;
 
        /* Weak, set during translation. NULL if `in_ir` is false below. */
-       struct bt_private_field_class *ir_fc;
+       bt_field_class *ir_fc;
 };
 
 struct ctf_field_class_bit_array {
@@ -84,7 +84,7 @@ struct ctf_field_class_int {
        int64_t storing_index;
 
        /* Owned by this */
-       struct bt_private_clock_class *mapped_clock_class;
+       bt_clock_class *mapped_clock_class;
 };
 
 struct ctf_range {
@@ -198,7 +198,7 @@ struct ctf_event_class {
        struct ctf_field_class *payload_fc;
 
        /* Weak, set during translation */
-       struct bt_private_event_class *ir_ec;
+       bt_event_class *ir_ec;
 };
 
 struct ctf_stream_class {
@@ -224,10 +224,10 @@ struct ctf_stream_class {
        GHashTable *event_classes_by_id;
 
        /* Owned by this */
-       struct bt_private_clock_class *default_clock_class;
+       bt_clock_class *default_clock_class;
 
        /* Weak, set during translation */
-       struct bt_private_stream_class *ir_sc;
+       bt_stream_class *ir_sc;
 };
 
 enum ctf_trace_class_env_entry_type {
@@ -246,7 +246,6 @@ struct ctf_trace_class_env_entry {
 };
 
 struct ctf_trace_class {
-       GString *name;
        unsigned int major;
        unsigned int minor;
        uint8_t uuid[16];
@@ -258,7 +257,7 @@ struct ctf_trace_class {
 
        uint64_t stored_value_count;
 
-       /* Array of `struct bt_private_clock_class *` (owned by this) */
+       /* Array of `bt_clock_class *` (owned by this) */
        GPtrArray *clock_classes;
 
        /* Array of `struct ctf_stream_class *` */
@@ -270,7 +269,7 @@ struct ctf_trace_class {
        bool is_translated;
 
        /* Weak, set during translation */
-       struct bt_private_trace *ir_tc;
+       bt_trace_class *ir_tc;
 };
 
 static inline
@@ -472,7 +471,7 @@ static inline
 void _ctf_field_class_int_destroy(struct ctf_field_class_int *fc)
 {
        BT_ASSERT(fc);
-       bt_object_put_ref(fc->mapped_clock_class);
+       bt_clock_class_put_ref(fc->mapped_clock_class);
        g_free(fc);
 }
 
@@ -480,7 +479,7 @@ static inline
 void _ctf_field_class_enum_destroy(struct ctf_field_class_enum *fc)
 {
        BT_ASSERT(fc);
-       bt_object_put_ref(fc->base.mapped_clock_class);
+       bt_clock_class_put_ref(fc->base.mapped_clock_class);
 
        if (fc->mappings) {
                uint64_t i;
@@ -1108,7 +1107,8 @@ void ctf_field_class_int_copy_content(
        dst_fc->is_signed = src_fc->is_signed;
        dst_fc->disp_base = src_fc->disp_base;
        dst_fc->encoding = src_fc->encoding;
-       dst_fc->mapped_clock_class = bt_object_get_ref(src_fc->mapped_clock_class);
+       dst_fc->mapped_clock_class = src_fc->mapped_clock_class;
+       bt_clock_class_get_ref(dst_fc->mapped_clock_class);
        dst_fc->storing_index = src_fc->storing_index;
 }
 
@@ -1397,7 +1397,7 @@ void ctf_stream_class_destroy(struct ctf_stream_class *sc)
        ctf_field_class_destroy(sc->packet_context_fc);
        ctf_field_class_destroy(sc->event_header_fc);
        ctf_field_class_destroy(sc->event_common_context_fc);
-       bt_object_put_ref(sc->default_clock_class);
+       bt_clock_class_put_ref(sc->default_clock_class);
        g_free(sc);
 }
 
@@ -1449,11 +1449,9 @@ struct ctf_trace_class *ctf_trace_class_create(void)
        struct ctf_trace_class *tc = g_new0(struct ctf_trace_class, 1);
 
        BT_ASSERT(tc);
-       tc->name = g_string_new(NULL);
        tc->default_byte_order = -1;
-       BT_ASSERT(tc->name);
        tc->clock_classes = g_ptr_array_new_with_free_func(
-               (GDestroyNotify) bt_object_put_ref);
+               (GDestroyNotify) bt_clock_class_put_ref);
        BT_ASSERT(tc->clock_classes);
        tc->stream_classes = g_ptr_array_new_with_free_func(
                (GDestroyNotify) ctf_stream_class_destroy);
@@ -1470,10 +1468,6 @@ void ctf_trace_class_destroy(struct ctf_trace_class *tc)
                return;
        }
 
-       if (tc->name) {
-               g_string_free(tc->name, TRUE);
-       }
-
        ctf_field_class_destroy(tc->packet_header_fc);
 
        if (tc->clock_classes) {
@@ -1548,19 +1542,18 @@ end:
 }
 
 static inline
-struct bt_private_clock_class *ctf_trace_class_borrow_clock_class_by_name(
+bt_clock_class *ctf_trace_class_borrow_clock_class_by_name(
                struct ctf_trace_class *tc, const char *name)
 {
        uint64_t i;
-       struct bt_private_clock_class *ret_cc = NULL;
+       bt_clock_class *ret_cc = NULL;
 
        BT_ASSERT(tc);
        BT_ASSERT(name);
 
        for (i = 0; i < tc->clock_classes->len; i++) {
-               struct bt_private_clock_class *cc = tc->clock_classes->pdata[i];
-               const char *cc_name = bt_clock_class_get_name(
-                       bt_private_clock_class_borrow_clock_class(cc));
+               bt_clock_class *cc = tc->clock_classes->pdata[i];
+               const char *cc_name = bt_clock_class_get_name(cc);
 
                BT_ASSERT(cc_name);
                if (strcmp(cc_name, name) == 0) {
This page took 0.026636 seconds and 4 git commands to generate.