diff options
author | Nathan Scott <nathans@redhat.com> | 2021-03-02 15:58:11 +1100 |
---|---|---|
committer | Nathan Scott <nathans@redhat.com> | 2021-03-04 13:40:11 +1100 |
commit | 5b50ae3aa3a418f3f84ff2fdb172ab447753814f (patch) | |
tree | 17fcbba67e6935b2da236dc8dba4ee7fbfab4177 /darwin/Platform.h | |
parent | 2328e52403dfa52d122a9f7ccbd365beaedb8c9f (diff) |
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.
Diffstat (limited to 'darwin/Platform.h')
-rw-r--r-- | darwin/Platform.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/darwin/Platform.h b/darwin/Platform.h index 2a97270a..59c2b9c7 100644 --- a/darwin/Platform.h +++ b/darwin/Platform.h @@ -16,6 +16,7 @@ in the source distribution for its full text. #include "CPUMeter.h" #include "DarwinProcess.h" #include "DiskIOMeter.h" +#include "Generic.h" #include "NetworkIOMeter.h" #include "ProcessLocksScreen.h" #include "SignalsPanel.h" @@ -67,4 +68,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 |