2022-07-25 14:20:07 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "fastfetch.h"
|
|
|
|
|
|
2024-11-14 10:04:57 +08:00
|
|
|
typedef enum __attribute__((__packed__)) FFvarianttype
|
2022-07-25 14:20:07 +02:00
|
|
|
{
|
|
|
|
|
FF_VARIANT_TYPE_STRING,
|
|
|
|
|
FF_VARIANT_TYPE_BOOL,
|
|
|
|
|
FF_VARIANT_TYPE_INT
|
|
|
|
|
} FFvarianttype;
|
|
|
|
|
|
|
|
|
|
typedef union FFvariant
|
|
|
|
|
{
|
|
|
|
|
const char* strValue;
|
|
|
|
|
int32_t intValue;
|
|
|
|
|
struct
|
|
|
|
|
{
|
|
|
|
|
bool boolValueSet;
|
|
|
|
|
bool boolValue;
|
|
|
|
|
};
|
|
|
|
|
} FFvariant;
|
|
|
|
|
|
2022-07-25 14:45:41 +02:00
|
|
|
#define FF_VARIANT_NULL ((FFvariant){.strValue = NULL})
|
|
|
|
|
|
2023-06-24 10:59:53 +08:00
|
|
|
FFvariant ffSettingsGetDConf(const char* key, FFvarianttype type);
|
|
|
|
|
FFvariant ffSettingsGetGSettings(const char* schemaName, const char* path, const char* key, FFvarianttype type);
|
2025-09-04 16:17:01 +08:00
|
|
|
FFvariant ffSettingsGetGnome(const char* dconfKey, const char* gsettingsSchemaName, const char* gsettingsPath, const char* gsettingsKey, FFvarianttype type);
|
2023-06-24 10:59:53 +08:00
|
|
|
FFvariant ffSettingsGetXFConf(const char* channelName, const char* propertyName, FFvarianttype type);
|
2025-09-04 13:46:18 +08:00
|
|
|
typedef bool FFTestXfconfPropCallback(void* data, const char* propertyName); // Return false to break loop
|
|
|
|
|
FFvariant ffSettingsGetXFConfFirstMatch(const char* channelName, const char* propertyPrefix, FFvarianttype type, void* data, FFTestXfconfPropCallback* cb);
|
2022-07-25 14:20:07 +02:00
|
|
|
|
2023-06-24 10:59:53 +08:00
|
|
|
int ffSettingsGetSQLite3Int(const char* dbPath, const char* query);
|
|
|
|
|
bool ffSettingsGetSQLite3String(const char* dbPath, const char* query, FFstrbuf* result);
|
2022-07-25 14:20:07 +02:00
|
|
|
|
|
|
|
|
#ifdef __ANDROID__
|
2023-06-16 09:18:07 +08:00
|
|
|
bool ffSettingsGetAndroidProperty(const char* propName, FFstrbuf* result);
|
2023-06-15 10:03:12 +08:00
|
|
|
#elif defined(__FreeBSD__)
|
|
|
|
|
bool ffSettingsGetFreeBSDKenv(const char* propName, FFstrbuf* result);
|
2022-07-25 14:20:07 +02:00
|
|
|
#endif
|