mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-04 04:04:17 +01:00
Bios (FreeBSD): code refactor
This commit is contained in:
@@ -1,14 +1,6 @@
|
||||
#include "bios.h"
|
||||
|
||||
#include <kenv.h>
|
||||
|
||||
static void kenvLookup(const char* name, FFstrbuf* result)
|
||||
{
|
||||
ffStrbufEnsureFree(result, 255);
|
||||
int len = kenv(KENV_GET, name, result->chars, 256);
|
||||
if(len > 0)
|
||||
result->length = (uint32_t) len;
|
||||
}
|
||||
#include "common/settings.h"
|
||||
|
||||
void ffDetectBios(FFBiosResult* bios)
|
||||
{
|
||||
@@ -18,9 +10,8 @@ void ffDetectBios(FFBiosResult* bios)
|
||||
ffStrbufInit(&bios->biosVendor);
|
||||
ffStrbufInit(&bios->biosVersion);
|
||||
|
||||
//https://wiki.ghostbsd.org/index.php/Kenv
|
||||
kenvLookup("smbios.bios.reldate", &bios->biosDate);
|
||||
kenvLookup("smbios.system.product", &bios->biosRelease);
|
||||
kenvLookup("smbios.bios.vendor", &bios->biosVendor);
|
||||
kenvLookup("smbios.bios.version", &bios->biosVersion);
|
||||
ffSettingsGetFreeBSDKenv("smbios.bios.reldate", &bios->biosDate);
|
||||
ffSettingsGetFreeBSDKenv("smbios.bios.revision", &bios->biosRelease);
|
||||
ffSettingsGetFreeBSDKenv("smbios.bios.vendor", &bios->biosVendor);
|
||||
ffSettingsGetFreeBSDKenv("smbios.bios.version", &bios->biosVersion);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user