X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=plugins%2Fctf%2Fcommon%2Futils%2Futils.c;h=10662a80c8881803cba65251d648645989fc42ec;hb=0b29603d15c2b685ecb2359242b733edc0a09d83;hp=9af59dab68de70c4d0d50800df25c7d2d94405e3;hpb=a429c321800ac785c3e86e7ebe6c18a7279f05a4;p=babeltrace.git diff --git a/plugins/ctf/common/utils/utils.c b/plugins/ctf/common/utils/utils.c index 9af59dab..10662a80 100644 --- a/plugins/ctf/common/utils/utils.c +++ b/plugins/ctf/common/utils/utils.c @@ -27,12 +27,12 @@ #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_borrow_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_borrow_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_integer_unsigned_get_value(stream_id_field, &stream_id); if (ret) { stream_id = -1ULL; @@ -55,17 +55,16 @@ 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_borrow_stream_class_by_index(trace, 0); } else { - stream_class = bt_ctf_trace_get_stream_class_by_id(trace, + stream_class = bt_trace_borrow_stream_class_by_id(trace, stream_id); } end: - bt_put(stream_id_field); return stream_class; }