Files
fastfetch/src/common/FFPlatform.h
T

42 lines
1.0 KiB
C
Raw Normal View History

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
2026-03-29 09:28:49 +08:00
typedef struct FFPlatformSysinfo {
2024-07-02 10:12:26 +08:00
FFstrbuf name;
FFstrbuf release;
FFstrbuf version;
FFstrbuf architecture;
uint32_t pageSize;
} FFPlatformSysinfo;
2026-03-29 09:28:49 +08:00
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
FFstrbuf exePath; // The real path of current exe (empty if unavailable)
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-03-29 09:28:49 +08:00
#ifndef _WIN32
2026-02-10 20:25:50 +08:00
uint32_t uid;
2026-03-29 09:28:49 +08:00
#else
2026-02-10 20:25:50 +08:00
FFstrbuf sid;
2026-03-29 09:28:49 +08:00
#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;
#if _WIN32
uint32_t initCP; // The code page used by the console when the program started
#endif
2023-01-15 15:57:26 +01:00
} FFPlatform;
void ffPlatformInit(FFPlatform* platform);
void ffPlatformDestroy(FFPlatform* platform);