Platform: add current working directory (cwd) to FFPlatform structure and initialization

This commit is contained in:
Carter Li
2026-02-20 23:59:03 +08:00
committed by 李通洲
parent 4996986ce6
commit a1e20270ad
6 changed files with 35 additions and 0 deletions
+3
View File
@@ -70,6 +70,7 @@ bool ffPrintTitle(FFTitleOptions* options)
FF_FORMAT_ARG(instance.state.platform.sid, "user-id"),
#endif
FF_FORMAT_ARG(instance.state.platform.pid, "pid"),
FF_FORMAT_ARG(instance.state.platform.cwd, "cwd"),
}));
}
@@ -139,6 +140,7 @@ bool ffGenerateTitleJsonResult(FF_MAYBE_UNUSED FFTitleOptions* options, yyjson_m
yyjson_mut_obj_add_strbuf(doc, obj, "exePath", &instance.state.platform.exePath);
yyjson_mut_obj_add_strbuf(doc, obj, "userShell", &instance.state.platform.userShell);
yyjson_mut_obj_add_uint(doc, obj, "pid", instance.state.platform.pid);
yyjson_mut_obj_add_strbuf(doc, obj, "cwd", &instance.state.platform.cwd);
return true;
}
@@ -183,5 +185,6 @@ FFModuleBaseInfo ffTitleModuleInfo = {
{"Full user name", "full-user-name"},
{"UID (*nix) / SID (Windows)", "user-id"},
{"PID of current process", "pid"},
{"Current working directory", "cwd"},
}))
};