Files
fastfetch/src/detection/physicaldisk/physicaldisk.h
T

37 lines
976 B
C
Raw Normal View History

2023-12-18 10:43:20 +08:00
#include "fastfetch.h"
#include "modules/physicaldisk/option.h"
2023-12-18 10:43:20 +08:00
2025-08-14 09:47:14 +08:00
#define FF_PHYSICALDISK_TEMP_UNSET (-DBL_MAX)
2023-12-26 19:23:26 +08:00
typedef enum __attribute__((__packed__)) FFPhysicalDiskType
2023-12-18 10:43:20 +08:00
{
FF_PHYSICALDISK_TYPE_NONE = 0,
// If neither is set, it's unknown
FF_PHYSICALDISK_TYPE_HDD = 1 << 0,
FF_PHYSICALDISK_TYPE_SSD = 1 << 1,
FF_PHYSICALDISK_TYPE_FIXED = 1 << 2,
FF_PHYSICALDISK_TYPE_REMOVABLE = 1 << 3,
2023-12-24 22:34:45 +08:00
2023-12-25 08:55:17 +08:00
FF_PHYSICALDISK_TYPE_READWRITE = 1 << 4,
FF_PHYSICALDISK_TYPE_READONLY = 1 << 5,
FF_PHYSICALDISK_TYPE_FORCE_UNSIGNED = UINT8_MAX,
2023-12-18 10:43:20 +08:00
} FFPhysicalDiskType;
static_assert(sizeof(FFPhysicalDiskType) == sizeof(uint8_t), "");
2023-12-18 10:43:20 +08:00
typedef struct FFPhysicalDiskResult
{
FFstrbuf name;
FFstrbuf interconnect;
FFstrbuf serial;
FFstrbuf devPath;
FFstrbuf revision;
2023-12-18 10:43:20 +08:00
FFPhysicalDiskType type;
uint64_t size;
2023-12-26 19:23:26 +08:00
double temperature;
2023-12-18 10:43:20 +08:00
} FFPhysicalDiskResult;
const char* ffDetectPhysicalDisk(FFlist* result, FFPhysicalDiskOptions* options);