lib: graph: add "self" and some "private" APIs
[babeltrace.git] / plugins / ctf / common / notif-iter / notif-iter.c
index cc1707ea7bff6a4f2ffbecf976a448e5e8ab0cc0..33808b8e3341251c57d5ae51e1249cd15a65994c 100644 (file)
@@ -103,7 +103,7 @@ struct bt_notif_iter {
        struct stack *stack;
 
        /* Current notification iterator to create notifications (weak) */
-       struct bt_private_connection_private_notification_iterator *notif_iter;
+       struct bt_self_notification_iterator *notif_iter;
 
        /*
         * Current dynamic scope field pointer.
@@ -691,7 +691,7 @@ enum bt_notif_iter_status read_packet_header_begin_state(
                }
 
                notit->dscopes.trace_packet_header =
-                       bt_private_packet_header_field_borrow_private_field(
+                       bt_private_packet_header_field_borrow_field(
                                notit->packet_header_field);
                BT_ASSERT(notit->dscopes.trace_packet_header);
        }
@@ -927,7 +927,7 @@ enum bt_notif_iter_status read_packet_context_begin_state(
                }
 
                notit->dscopes.stream_packet_context =
-                       bt_private_packet_context_field_borrow_private_field(
+                       bt_private_packet_context_field_borrow_field(
                                notit->packet_context_field);
                BT_ASSERT(notit->dscopes.stream_packet_context);
        }
@@ -1105,7 +1105,7 @@ enum bt_notif_iter_status read_event_header_begin_state(
                }
 
                notit->dscopes.event_header =
-                       bt_private_event_header_field_borrow_private_field(
+                       bt_private_event_header_field_borrow_field(
                                notit->event_header_field);
                BT_ASSERT(notit->dscopes.event_header);
        }
@@ -1247,7 +1247,7 @@ enum bt_notif_iter_status after_event_header_state(
                goto end;
        }
 
-       notit->event = bt_private_notification_event_borrow_private_event(
+       notit->event = bt_private_notification_event_borrow_event(
                notit->event_notif);
        BT_ASSERT(notit->event);
 
@@ -1255,7 +1255,7 @@ enum bt_notif_iter_status after_event_header_state(
                int ret;
 
                BT_ASSERT(notit->event);
-               ret = bt_private_event_move_private_header_field(notit->event,
+               ret = bt_private_event_move_header_field(notit->event,
                        notit->event_header_field);
                if (ret) {
                        status = BT_NOTIF_ITER_STATUS_ERROR;
@@ -1269,7 +1269,7 @@ enum bt_notif_iter_status after_event_header_state(
                 * the same value as the event header field within
                 * notit->event.
                 */
-               BT_ASSERT(bt_private_event_borrow_header_private_field(
+               BT_ASSERT(bt_private_event_borrow_header_field(
                        notit->event) == notit->dscopes.event_header);
        }
 
@@ -1295,7 +1295,7 @@ enum bt_notif_iter_status read_event_common_context_begin_state(
        if (event_common_context_fc->in_ir) {
                BT_ASSERT(!notit->dscopes.event_common_context);
                notit->dscopes.event_common_context =
-                       bt_private_event_borrow_common_context_private_field(
+                       bt_private_event_borrow_common_context_field(
                                notit->event);
                BT_ASSERT(notit->dscopes.event_common_context);
        }
@@ -1348,7 +1348,7 @@ enum bt_notif_iter_status read_event_spec_context_begin_state(
        if (event_spec_context_fc->in_ir) {
                BT_ASSERT(!notit->dscopes.event_spec_context);
                notit->dscopes.event_spec_context =
-                       bt_private_event_borrow_specific_context_private_field(
+                       bt_private_event_borrow_specific_context_field(
                                notit->event);
                BT_ASSERT(notit->dscopes.event_spec_context);
        }
@@ -1404,7 +1404,7 @@ enum bt_notif_iter_status read_event_payload_begin_state(
        if (event_payload_fc->in_ir) {
                BT_ASSERT(!notit->dscopes.event_payload);
                notit->dscopes.event_payload =
-                       bt_private_event_borrow_payload_private_field(
+                       bt_private_event_borrow_payload_field(
                                notit->event);
                BT_ASSERT(notit->dscopes.event_payload);
        }
@@ -1690,32 +1690,33 @@ struct bt_private_field *borrow_next_field(struct bt_notif_iter *notit)
        index = stack_top(notit->stack)->index;
        base_field = stack_top(notit->stack)->base;
        BT_ASSERT(base_field);
-       base_fc = bt_private_field_borrow_private_class(base_field);
+       base_fc = bt_private_field_borrow_class(base_field);
        BT_ASSERT(base_fc);
 
-       switch (bt_field_class_get_type(bt_field_class_borrow_from_private(base_fc))) {
+       switch (bt_field_class_get_type(
+               bt_private_field_class_borrow_field_class(base_fc))) {
        case BT_FIELD_CLASS_TYPE_STRUCTURE:
        {
                BT_ASSERT(index <
                        bt_field_class_structure_get_member_count(
-                               bt_field_class_borrow_from_private(
-                                       bt_private_field_borrow_private_class(
+                               bt_private_field_class_borrow_field_class(
+                                       bt_private_field_borrow_class(
                                                base_field))));
                next_field =
-                       bt_private_field_structure_borrow_member_private_field_by_index(
+                       bt_private_field_structure_borrow_member_field_by_index(
                                base_field, index);
                break;
        }
        case BT_FIELD_CLASS_TYPE_STATIC_ARRAY:
        case BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY:
                BT_ASSERT(index < bt_field_array_get_length(
-                       bt_field_borrow_from_private(base_field)));
-               next_field = bt_private_field_array_borrow_element_private_field_by_index(
+                       bt_private_field_borrow_field(base_field)));
+               next_field = bt_private_field_array_borrow_element_field_by_index(
                        base_field, index);
                break;
        case BT_FIELD_CLASS_TYPE_VARIANT:
                BT_ASSERT(index == 0);
-               next_field = bt_private_field_variant_borrow_selected_option_private_field(
+               next_field = bt_private_field_variant_borrow_selected_option_field(
                        base_field);
                break;
        default:
@@ -1843,11 +1844,11 @@ update_def_clock:
 
        field = borrow_next_field(notit);
        BT_ASSERT(field);
-       BT_ASSERT(bt_private_field_borrow_private_class(field) == fc->ir_fc);
+       BT_ASSERT(bt_private_field_borrow_class(field) == fc->ir_fc);
        BT_ASSERT(bt_field_get_class_type(
-               bt_field_borrow_from_private(field)) ==
+               bt_private_field_borrow_field(field)) ==
                BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER ||
-               bt_field_get_class_type(bt_field_borrow_from_private(field)) ==
+               bt_field_get_class_type(bt_private_field_borrow_field(field)) ==
                BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION);
        bt_private_field_unsigned_integer_set_value(field, value);
        stack_top(notit->stack)->index++;
@@ -1890,7 +1891,7 @@ enum bt_bfcr_status bfcr_unsigned_int_char_cb(uint64_t value,
 
        string_field = stack_top(notit->stack)->base;
        BT_ASSERT(bt_field_get_class_type(
-               bt_field_borrow_from_private(string_field)) ==
+               bt_private_field_borrow_field(string_field)) ==
                BT_FIELD_CLASS_TYPE_STRING);
 
        /* Append character */
@@ -1934,11 +1935,11 @@ enum bt_bfcr_status bfcr_signed_int_cb(int64_t value,
 
        field = borrow_next_field(notit);
        BT_ASSERT(field);
-       BT_ASSERT(bt_private_field_borrow_private_class(field) == fc->ir_fc);
+       BT_ASSERT(bt_private_field_borrow_class(field) == fc->ir_fc);
        BT_ASSERT(bt_field_get_class_type(
-               bt_field_borrow_from_private(field)) ==
+               bt_private_field_borrow_field(field)) ==
                BT_FIELD_CLASS_TYPE_SIGNED_INTEGER ||
-               bt_field_get_class_type(bt_field_borrow_from_private(field)) ==
+               bt_field_get_class_type(bt_private_field_borrow_field(field)) ==
                BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION);
        bt_private_field_signed_integer_set_value(field, value);
        stack_top(notit->stack)->index++;
@@ -1962,9 +1963,9 @@ enum bt_bfcr_status bfcr_floating_point_cb(double value,
        BT_ASSERT(fc->in_ir);
        field = borrow_next_field(notit);
        BT_ASSERT(field);
-       BT_ASSERT(bt_private_field_borrow_private_class(field) == fc->ir_fc);
+       BT_ASSERT(bt_private_field_borrow_class(field) == fc->ir_fc);
        BT_ASSERT(bt_field_get_class_type(
-               bt_field_borrow_from_private(field)) ==
+               bt_private_field_borrow_field(field)) ==
                BT_FIELD_CLASS_TYPE_REAL);
        bt_private_field_real_set_value(field, value);
        stack_top(notit->stack)->index++;
@@ -1987,9 +1988,9 @@ enum bt_bfcr_status bfcr_string_begin_cb(
        BT_ASSERT(fc->in_ir);
        field = borrow_next_field(notit);
        BT_ASSERT(field);
-       BT_ASSERT(bt_private_field_borrow_private_class(field) == fc->ir_fc);
+       BT_ASSERT(bt_private_field_borrow_class(field) == fc->ir_fc);
        BT_ASSERT(bt_field_get_class_type(
-               bt_field_borrow_from_private(field)) ==
+               bt_private_field_borrow_field(field)) ==
                BT_FIELD_CLASS_TYPE_STRING);
        ret = bt_private_field_string_clear(field);
        BT_ASSERT(ret == 0);
@@ -2081,7 +2082,7 @@ enum bt_bfcr_status bfcr_compound_begin_cb(
 
        /* Push field */
        BT_ASSERT(field);
-       BT_ASSERT(bt_private_field_borrow_private_class(field) == fc->ir_fc);
+       BT_ASSERT(bt_private_field_borrow_class(field) == fc->ir_fc);
        stack_push(notit->stack, field);
 
        /*
@@ -2096,7 +2097,7 @@ enum bt_bfcr_status bfcr_compound_begin_cb(
                        int ret;
 
                        BT_ASSERT(bt_field_get_class_type(
-                               bt_field_borrow_from_private(field)) ==
+                               bt_private_field_borrow_field(field)) ==
                                BT_FIELD_CLASS_TYPE_STRING);
                        notit->done_filling_string = false;
                        ret = bt_private_field_string_clear(field);
@@ -2125,7 +2126,7 @@ enum bt_bfcr_status bfcr_compound_end_cb(
        }
 
        BT_ASSERT(!stack_empty(notit->stack));
-       BT_ASSERT(bt_private_field_borrow_private_class(stack_top(notit->stack)->base) ==
+       BT_ASSERT(bt_private_field_borrow_class(stack_top(notit->stack)->base) ==
                fc->ir_fc);
 
        /*
@@ -2138,7 +2139,7 @@ enum bt_bfcr_status bfcr_compound_end_cb(
 
                if (array_fc->is_text) {
                        BT_ASSERT(bt_field_get_class_type(
-                               bt_field_borrow_from_private(
+                               bt_private_field_borrow_field(
                                        stack_top(notit->stack)->base)) ==
                                BT_FIELD_CLASS_TYPE_STRING);
                        bt_bfcr_set_unsigned_int_cb(notit->bfcr,
@@ -2243,7 +2244,7 @@ struct ctf_field_class *bfcr_borrow_variant_selected_field_class_cb(
        if (selected_option->fc->in_ir) {
                struct bt_private_field *var_field = stack_top(notit->stack)->base;
 
-               ret = bt_private_field_variant_select_option_private_field(
+               ret = bt_private_field_variant_select_option_field(
                        var_field, option_index);
                if (ret) {
                        BT_LOGW("Cannot select variant field's option field: "
@@ -2264,9 +2265,9 @@ static
 void set_event_default_clock_value(struct bt_notif_iter *notit)
 {
        struct bt_private_event *event =
-               bt_private_notification_event_borrow_private_event(
+               bt_private_notification_event_borrow_event(
                        notit->event_notif);
-       struct bt_stream_class *sc = bt_stream_class_borrow_from_private(
+       struct bt_stream_class *sc = bt_private_stream_class_borrow_stream_class(
                notit->meta.sc->ir_sc);
 
        BT_ASSERT(event);
@@ -2346,7 +2347,7 @@ void notify_new_packet(struct bt_notif_iter *notit,
        }
 
        BT_ASSERT(notit->packet);
-       sc = bt_stream_class_borrow_from_private(notit->meta.sc->ir_sc);
+       sc = bt_private_stream_class_borrow_stream_class(notit->meta.sc->ir_sc);
        BT_ASSERT(sc);
 
        if (bt_stream_class_packets_have_discarded_event_counter_snapshot(sc)) {
@@ -2378,7 +2379,7 @@ void notify_new_packet(struct bt_notif_iter *notit,
        }
 
        if (notit->packet_header_field) {
-               ret = bt_private_packet_move_private_header_field(
+               ret = bt_private_packet_move_header_field(
                        notit->packet, notit->packet_header_field);
                if (ret) {
                        goto end;
@@ -2391,13 +2392,13 @@ void notify_new_packet(struct bt_notif_iter *notit,
                 * the same value as the packet header field within
                 * notit->packet.
                 */
-               BT_ASSERT(bt_private_packet_borrow_header_private_field(
+               BT_ASSERT(bt_private_packet_borrow_header_field(
                        notit->packet) ==
                        notit->dscopes.trace_packet_header);
        }
 
        if (notit->packet_context_field) {
-               ret = bt_private_packet_move_private_context_field(
+               ret = bt_private_packet_move_context_field(
                        notit->packet, notit->packet_context_field);
                if (ret) {
                        goto end;
@@ -2410,7 +2411,7 @@ void notify_new_packet(struct bt_notif_iter *notit,
                 * the same value as the packet header field within
                 * notit->packet.
                 */
-               BT_ASSERT(bt_private_packet_borrow_context_private_field(
+               BT_ASSERT(bt_private_packet_borrow_context_field(
                        notit->packet) ==
                        notit->dscopes.stream_packet_context);
        }
@@ -2558,7 +2559,7 @@ void bt_notif_iter_destroy(struct bt_notif_iter *notit)
 
 enum bt_notif_iter_status bt_notif_iter_get_next_notification(
                struct bt_notif_iter *notit,
-               struct bt_private_connection_private_notification_iterator *notif_iter,
+               struct bt_self_notification_iterator *notif_iter,
                struct bt_private_notification **notification)
 {
        enum bt_notif_iter_status status = BT_NOTIF_ITER_STATUS_OK;
This page took 0.030336 seconds and 4 git commands to generate.