Rename bt_ctf_X -> bt_X, maintain backward compat. for pre-2.0 CTF writer
[babeltrace.git] / plugins / ctf / common / utils / utils.c
index 9af59dab68de70c4d0d50800df25c7d2d94405e3..02c488c5058e0aaf06c6ae02a74c608182ce6a3d 100644 (file)
 
 #include "utils.h"
 
-struct bt_ctf_stream_class *ctf_utils_stream_class_from_packet_header(
-               struct bt_ctf_trace *trace,
-               struct bt_ctf_field *packet_header_field)
+struct bt_stream_class *ctf_utils_stream_class_from_packet_header(
+               struct bt_trace *trace,
+               struct bt_field *packet_header_field)
 {
-       struct bt_ctf_field *stream_id_field = NULL;
-       struct bt_ctf_stream_class *stream_class = NULL;
+       struct bt_field *stream_id_field = NULL;
+       struct bt_stream_class *stream_class = NULL;
        uint64_t stream_id = -1ULL;
        int ret;
 
@@ -40,13 +40,13 @@ struct bt_ctf_stream_class *ctf_utils_stream_class_from_packet_header(
                goto single_stream_class;
        }
 
-       stream_id_field = bt_ctf_field_structure_get_field_by_name(
+       stream_id_field = bt_field_structure_get_field_by_name(
                packet_header_field, "stream_id");
        if (!stream_id_field) {
                goto single_stream_class;
        }
 
-       ret = bt_ctf_field_unsigned_integer_get_value(stream_id_field,
+       ret = bt_field_unsigned_integer_get_value(stream_id_field,
                &stream_id);
        if (ret) {
                stream_id = -1ULL;
@@ -55,13 +55,13 @@ struct bt_ctf_stream_class *ctf_utils_stream_class_from_packet_header(
        if (stream_id == -1ULL) {
 single_stream_class:
                /* Single stream class */
-               if (bt_ctf_trace_get_stream_class_count(trace) == 0) {
+               if (bt_trace_get_stream_class_count(trace) == 0) {
                        goto end;
                }
 
-               stream_class = bt_ctf_trace_get_stream_class_by_index(trace, 0);
+               stream_class = bt_trace_get_stream_class_by_index(trace, 0);
        } else {
-               stream_class = bt_ctf_trace_get_stream_class_by_id(trace,
+               stream_class = bt_trace_get_stream_class_by_id(trace,
                        stream_id);
        }
 
This page took 0.02614 seconds and 4 git commands to generate.