2023-01-15 15:57:26 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
2026-01-06 09:48:38 +08:00
|
|
|
#include "common/FFstrbuf.h"
|
|
|
|
|
#include "common/FFlist.h"
|
2023-01-15 15:57:26 +01:00
|
|
|
|
2024-07-02 10:12:26 +08:00
|
|
|
typedef struct FFPlatformSysinfo
|
|
|
|
|
{
|
|
|
|
|
FFstrbuf name;
|
|
|
|
|
FFstrbuf release;
|
|
|
|
|
FFstrbuf version;
|
|
|
|
|
FFstrbuf architecture;
|
|
|
|
|
uint32_t pageSize;
|
|
|
|
|
} FFPlatformSysinfo;
|
|
|
|
|
|
|
|
|
|
typedef struct FFPlatform
|
|
|
|
|
{
|
2023-01-15 15:57:26 +01:00
|
|
|
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
|
2026-01-15 15:03:38 +08:00
|
|
|
FFstrbuf exePath; // The real path of current exe (empty if unavailable)
|
2026-02-20 23:59:03 +08:00
|
|
|
FFstrbuf cwd; // Trailing slash included
|
2023-01-15 15:57:26 +01:00
|
|
|
|
2026-02-12 13:56:55 +08:00
|
|
|
uint32_t pid;
|
2026-02-10 20:25:50 +08:00
|
|
|
#ifndef _WIN32
|
|
|
|
|
uint32_t uid;
|
|
|
|
|
#else
|
|
|
|
|
FFstrbuf sid;
|
|
|
|
|
#endif
|
2023-01-15 15:57:26 +01:00
|
|
|
FFstrbuf userName;
|
2025-04-09 14:58:36 +08:00
|
|
|
FFstrbuf fullUserName;
|
2023-01-15 15:57:26 +01:00
|
|
|
FFstrbuf hostName;
|
|
|
|
|
FFstrbuf userShell;
|
|
|
|
|
|
2024-07-02 10:12:26 +08:00
|
|
|
FFPlatformSysinfo sysinfo;
|
2023-01-15 15:57:26 +01:00
|
|
|
} FFPlatform;
|
|
|
|
|
|
|
|
|
|
void ffPlatformInit(FFPlatform* platform);
|
|
|
|
|
void ffPlatformDestroy(FFPlatform* platform);
|