static
struct bt_field_path *resolve_field_path(struct bt_field_class *src_fc,
struct bt_field_class *tgt_fc,
- struct bt_resolve_field_path_context *ctx)
+ struct bt_resolve_field_path_context *ctx,
+ const char *api_func)
{
- BT_ASSERT_PRE_DEV(field_path_is_valid(src_fc, tgt_fc, ctx),
+ BT_ASSERT_PRE_DEV_FROM_FUNC(api_func, "valid-field-class",
+ field_path_is_valid(src_fc, tgt_fc, ctx),
"Invalid target field class: %![req-fc-]+F, %![tgt-fc-]+F",
src_fc, tgt_fc);
return find_field_class_in_ctx(tgt_fc, ctx);
BT_HIDDEN
int bt_resolve_field_paths(struct bt_field_class *fc,
- struct bt_resolve_field_path_context *ctx)
+ struct bt_resolve_field_path_context *ctx,
+ const char *api_func)
{
int ret = 0;
BT_ASSERT(opt_fc->selector_fc);
BT_ASSERT(!opt_fc->selector_field_path);
opt_fc->selector_field_path = resolve_field_path(
- fc, opt_fc->selector_fc, ctx);
+ fc, opt_fc->selector_fc, ctx, __func__);
if (!opt_fc->selector_field_path) {
ret = -1;
goto end;
BT_ASSERT(dyn_array_fc->length_fc);
BT_ASSERT(!dyn_array_fc->length_field_path);
dyn_array_fc->length_field_path = resolve_field_path(
- fc, dyn_array_fc->length_fc, ctx);
+ fc, dyn_array_fc->length_fc, ctx, __func__);
if (!dyn_array_fc->length_field_path) {
ret = -1;
goto end;
BT_ASSERT(!var_fc->selector_field_path);
var_fc->selector_field_path =
resolve_field_path(fc,
- (void *) var_fc->selector_fc, ctx);
+ (void *) var_fc->selector_fc, ctx,
+ __func__);
if (!var_fc->selector_field_path) {
ret = -1;
goto end;
if (bt_field_class_type_is(fc->type, BT_FIELD_CLASS_TYPE_OPTION)) {
struct bt_field_class_option *opt_fc = (void *) fc;
- ret = bt_resolve_field_paths(opt_fc->content_fc, ctx);
+ ret = bt_resolve_field_paths(opt_fc->content_fc, ctx, api_func);
} else if (fc->type == BT_FIELD_CLASS_TYPE_STRUCTURE ||
bt_field_class_type_is(fc->type,
BT_FIELD_CLASS_TYPE_VARIANT)) {
struct bt_named_field_class *named_fc =
container_fc->named_fcs->pdata[i];
- ret = bt_resolve_field_paths(named_fc->fc, ctx);
+ ret = bt_resolve_field_paths(named_fc->fc, ctx,
+ api_func);
if (ret) {
goto end;
}
BT_FIELD_CLASS_TYPE_ARRAY)) {
struct bt_field_class_array *array_fc = (void *) fc;
- ret = bt_resolve_field_paths(array_fc->element_fc, ctx);
+ ret = bt_resolve_field_paths(array_fc->element_fc, ctx,
+ api_func);
}
end: