From c68b1d2b2680e1550227e4d6ddbdaf6ceffb0a02 Mon Sep 17 00:00:00 2001 From: Max Wash Date: Mon, 15 Jun 2026 17:41:08 +0100 Subject: [PATCH] runtime: update fx api usage --- bshell.runtime/command/native-command.c | 2 +- bshell.runtime/format/table.c | 2 +- bshell.runtime/runtime/cmdcall.c | 15 ++++++--------- bshell.runtime/runtime/eval.c | 4 ++-- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/bshell.runtime/command/native-command.c b/bshell.runtime/command/native-command.c index 221953d..60a3793 100644 --- a/bshell.runtime/command/native-command.c +++ b/bshell.runtime/command/native-command.c @@ -144,7 +144,7 @@ static enum bshell_status process_record( } fx_string *record = fx_string_create_from_cstr( - fx_stringstream_ptr(cmd_p->cmd_tmp)); + fx_stringstream_get_cstr(cmd_p->cmd_tmp)); bshell_pipeline_write_value( pipeline, FX_VALUE_OBJECT(record), diff --git a/bshell.runtime/format/table.c b/bshell.runtime/format/table.c index 40dee3a..26de402 100644 --- a/bshell.runtime/format/table.c +++ b/bshell.runtime/format/table.c @@ -347,7 +347,7 @@ enum bshell_status bshell_table_ctx_print_record( } size_t to_write = fx_stringstream_get_length(strm); - const char *s = fx_stringstream_ptr(strm); + const char *s = fx_stringstream_get_cstr(strm); bool overflow = false; if (to_write > c->col_width) { to_write = c->col_width - 2; diff --git a/bshell.runtime/runtime/cmdcall.c b/bshell.runtime/runtime/cmdcall.c index 5e0d5c7..bb61b85 100644 --- a/bshell.runtime/runtime/cmdcall.c +++ b/bshell.runtime/runtime/cmdcall.c @@ -140,7 +140,7 @@ static bshell_command *resolve_native_command_local( } bshell_command *result - = bshell_native_command_create(fx_path_ptr(cmd_path)); + = bshell_native_command_create(fx_path_get_cstr(cmd_path)); fx_path_unref(cmd_path); return result; } @@ -171,19 +171,16 @@ static bshell_command *resolve_native_command( fx_foreach(v, it) { const char *tok = NULL; - fx_value_get_cstr(v, &tok); - fx_path *dir_path = fx_path_create_from_cstr(tok); - const fx_path *parts[] = {dir_path, cmd_name_path}; fx_path *full_path - = fx_path_join(parts, sizeof parts / sizeof parts[0]); - fx_path_unref(dir_path); + = fx_path_join_list(2, v, &FX_VALUE_OBJECT(cmd_name)); if (!fx_path_is_file(full_path)) { fx_path_unref(full_path); continue; } - result = bshell_native_command_create(fx_path_ptr(full_path)); + result = bshell_native_command_create( + fx_path_get_cstr(full_path)); fx_path_unref(full_path); break; } @@ -254,8 +251,8 @@ static enum bshell_status process_args(struct bshell_cmdcall_p *cmdcall) for (i32 i = cmdcall->cmd_args.count - 1; i >= 0; i--) { fx_stringstream_reset(str); fx_value_to_string(&cmdcall->cmd_args.items[i], str, NULL); - fx_string *arg_str - = fx_string_create_from_cstr(fx_stringstream_ptr(str)); + fx_string *arg_str = fx_string_create_from_cstr( + fx_stringstream_get_cstr(str)); fx_array_push_back( cmdcall->cmd_args_processed, FX_VALUE_OBJECT(arg_str)); diff --git a/bshell.runtime/runtime/eval.c b/bshell.runtime/runtime/eval.c index d10b707..75f271c 100644 --- a/bshell.runtime/runtime/eval.c +++ b/bshell.runtime/runtime/eval.c @@ -220,7 +220,7 @@ static enum bshell_status eval_instruction( fx_value_unset(&y); const fx_property *prop - = fx_type_get_property(ty, fx_stringstream_ptr(strm)); + = fx_type_get_property(ty, fx_stringstream_get_cstr(strm)); fx_stringstream_unref(strm); if (!prop) { @@ -267,7 +267,7 @@ static enum bshell_status eval_instruction( fx_value_to_string(&x, strm, NULL); fx_string_prepend_cstr( result, - fx_stringstream_ptr(strm)); + fx_stringstream_get_cstr(strm)); fx_value_unset(&x); arg--; }