*/
#include <babeltrace/ctf-ir/event-types.h>
-#include <babeltrace/ctf-ir/event-types-internal.h>
+#include <babeltrace/ctf-ir/field-path.h>
#include <babeltrace/ctf-ir/event.h>
#include <babeltrace/ctf-ir/stream-class.h>
#include <babeltrace/ctf-ir/trace.h>
int expected_index;
int actual_index;
int i = 0;
- const struct bt_ctf_field_path *field_path;
+ struct bt_ctf_field_path *field_path = NULL;
va_list ap;
va_start(ap, root);
-
if (bt_ctf_field_type_is_sequence(field_type)) {
- field_path = ((struct bt_ctf_field_type_sequence *)
- field_type)->length_field_path;
+ field_path = bt_ctf_field_type_sequence_get_length_field_path(
+ field_type);
} else if (bt_ctf_field_type_is_variant(field_type)) {
- field_path = ((struct bt_ctf_field_type_variant *)
- field_type)->tag_path;
- } else {
- ret = -1;
- goto end;
+ field_path = bt_ctf_field_type_variant_get_tag_field_path(
+ field_type);
}
if (!field_path) {
goto end;
}
- if (field_path->root != root) {
+ if (bt_ctf_field_path_get_root(field_path) != root) {
ret = -1;
goto end;
}
- len = field_path->path_indexes->len;
+ len = bt_ctf_field_path_get_index_count(field_path);
while (true) {
expected_index = va_arg(ap, int);
break;
}
- actual_index = g_array_index(field_path->path_indexes, int, i);
+ actual_index = bt_ctf_field_path_get_index(field_path, i);
- if (actual_index != expected_index) {
+ if (actual_index == INT_MIN) {
ret = -1;
goto end;
}
}
end:
+ BT_PUT(field_path);
va_end(ap);
return ret;