summaryrefslogtreecommitdiffstats
path: root/src/common/FFPlatform.h
diff options
context:
space:
mode:
authorsumuel <samuel@yakubos.org>2026-08-17 20:44:55 +0000
committersumuel <samuel@yakubos.org>2026-08-17 20:44:55 +0000
commit76424950e373d3b04ac3dd13019151bfba3e8423 (patch)
tree4c3cfdbda039e592b9186be3e28f8d7cfd439e8a /src/common/FFPlatform.h
Add the files
Diffstat (limited to 'src/common/FFPlatform.h')
-rw-r--r--src/common/FFPlatform.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/common/FFPlatform.h b/src/common/FFPlatform.h
new file mode 100644
index 0000000..cf8224d
--- /dev/null
+++ b/src/common/FFPlatform.h
@@ -0,0 +1,37 @@
+#pragma once
+
+#include "common/FFstrbuf.h"
+#include "common/FFlist.h"
+
+typedef struct FFPlatformSysinfo {
+ FFstrbuf name;
+ FFstrbuf release;
+ FFstrbuf version;
+ FFstrbuf architecture;
+ uint32_t pageSize;
+} FFPlatformSysinfo;
+
+typedef struct FFPlatform {
+ FFstrbuf homeDir; // Trailing slash included
+ FFstrbuf cacheDir; // Trailing slash included
+ FFlist configDirs; // List of FFstrbuf, trailing slash included
+ FFlist dataDirs; // List of FFstrbuf, trailing slash included
+ FFstrbuf exePath; // The real path of current exe (empty if unavailable)
+ FFstrbuf cwd; // Trailing slash included
+
+ uint32_t pid;
+#ifndef _WIN32
+ uint32_t uid;
+#else
+ FFstrbuf sid;
+#endif
+ FFstrbuf userName;
+ FFstrbuf fullUserName;
+ FFstrbuf hostName;
+ FFstrbuf userShell;
+
+ FFPlatformSysinfo sysinfo;
+} FFPlatform;
+
+void ffPlatformInit(FFPlatform* platform);
+void ffPlatformDestroy(FFPlatform* platform);