From 5b50ae3aa3a418f3f84ff2fdb172ab447753814f Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Tue, 2 Mar 2021 15:58:11 +1100 Subject: Separate display from sampling in SysArch and Hostname Meters Several of our newer meters have merged coding concerns in terms of extracting values and displaying those values. This commit rectifies that for the SysArch and Hostname meters, allowing use of this code with alternative front/back ends. The SysArch code is also refined to detect whether the platform has an os-release file at all and/or the sys/utsname.h header via configure.ac. --- linux/Platform.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'linux/Platform.h') diff --git a/linux/Platform.h b/linux/Platform.h index f932c583..c2a86f73 100644 --- a/linux/Platform.h +++ b/linux/Platform.h @@ -14,6 +14,7 @@ in the source distribution for its full text. #include "Action.h" #include "BatteryMeter.h" #include "DiskIOMeter.h" +#include "Generic.h" #include "Meter.h" #include "NetworkIOMeter.h" #include "Process.h" @@ -72,4 +73,12 @@ bool Platform_getNetworkIO(NetworkIOData* data); void Platform_getBattery(double *percent, ACPresence *isOnAC); +static inline void Platform_getHostname(char* buffer, size_t size) { + Generic_Hostname(buffer, size); +} + +static inline void Platform_getRelease(char** string) { + *string = Generic_OSRelease(); +} + #endif -- cgit v1.2.3