fx.io: update all path parameters to be fx_values

This commit is contained in:
2026-07-12 22:15:14 +01:00
parent e9a1bfbde2
commit 24bcb18543
9 changed files with 178 additions and 142 deletions
+4 -1
View File
@@ -11,7 +11,10 @@ int main(int argc, const char **argv)
fx_directory *dir;
fx_result result = fx_directory_open(
NULL, FX_RV_PATH(path), FX_DIRECTORY_OPEN_CREATE_INTERMEDIATE, &dir);
NULL,
FX_CSTR(path),
FX_DIRECTORY_OPEN_CREATE_INTERMEDIATE,
&dir);
if (fx_result_is_error(result)) {
fx_throw(result);
return -1;
+1 -1
View File
@@ -9,7 +9,7 @@ int main(int argc, const char **argv)
const char *path = argv[1];
fx_directory *dir;
fx_result result = fx_directory_open(NULL, FX_RV_PATH(path), 0, &dir);
fx_result result = fx_directory_open(NULL, FX_CSTR(path), 0, &dir);
if (fx_result_is_error(result)) {
fx_throw(result);
return -1;
+1 -3
View File
@@ -6,10 +6,9 @@
int main(int argc, const char **argv)
{
fx_file *dest;
fx_path *path = fx_path_create_from_cstr("data.txt");
fx_result result = fx_file_open(
NULL,
path,
FX_CSTR("data.txt"),
FX_FILE_WRITE_ONLY | FX_FILE_CREATE,
&dest);
if (fx_result_is_error(result)) {
@@ -23,7 +22,6 @@ int main(int argc, const char **argv)
printf("done. read %zu bytes total.\n", nr_read);
fx_path_unref(path);
fx_file_unref(dest);
return 0;
}
+7 -5
View File
@@ -12,17 +12,19 @@ int main(int argc, const char **argv)
}
fx_directory *dir = NULL;
fx_path *path = fx_path_create_from_cstr(argv[1]);
fx_result result = fx_directory_open(FX_DIRECTORY_ROOT, path, 0, &dir);
fx_result result = fx_directory_open(
FX_DIRECTORY_ROOT,
FX_CSTR(argv[1]),
0,
&dir);
if (fx_result_is_error(result)) {
fx_throw(result);
return -1;
}
fx_iterator *it = fx_directory_begin(
dir,
FX_DIRECTORY_ITERATE_PARENT_FIRST);
fx_iterator *it
= fx_directory_begin(dir, FX_DIRECTORY_ITERATE_PARENT_FIRST);
fx_foreach(val, it)
{
fx_directory_entry *entry = NULL;