summaryrefslogtreecommitdiffstats
path: root/unsupported
diff options
context:
space:
mode:
authorNathan Scott <nathans@redhat.com>2021-03-02 15:58:11 +1100
committerNathan Scott <nathans@redhat.com>2021-03-04 13:40:11 +1100
commit5b50ae3aa3a418f3f84ff2fdb172ab447753814f (patch)
tree17fcbba67e6935b2da236dc8dba4ee7fbfab4177 /unsupported
parent2328e52403dfa52d122a9f7ccbd365beaedb8c9f (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 'unsupported')
-rw-r--r--unsupported/Platform.c10
-rw-r--r--unsupported/Platform.h4
2 files changed, 14 insertions, 0 deletions
diff --git a/unsupported/Platform.c b/unsupported/Platform.c
index 5791acca..9dc457b7 100644
--- a/unsupported/Platform.c
+++ b/unsupported/Platform.c
@@ -64,6 +64,8 @@ const MeterClass* const Platform_meterTypes[] = {
NULL
};
+static const char Platform_unsupported[] = "unsupported";
+
void Platform_init(void) {
/* no platform-specific setup needed */
}
@@ -146,3 +148,11 @@ void Platform_getBattery(double* percent, ACPresence* isOnAC) {
*percent = NAN;
*isOnAC = AC_ERROR;
}
+
+void Platform_getHostname(char* buffer, size_t size) {
+ String_safeStrncpy(buffer, Platform_unsupported, size);
+}
+
+void Platform_getRelease(char** string) {
+ *string = xStrdup(Platform_unsupported);
+}
diff --git a/unsupported/Platform.h b/unsupported/Platform.h
index 9b98fd97..837daca4 100644
--- a/unsupported/Platform.h
+++ b/unsupported/Platform.h
@@ -57,4 +57,8 @@ bool Platform_getNetworkIO(NetworkIOData* data);
void Platform_getBattery(double *percent, ACPresence *isOnAC);
+void Platform_getHostname(char* buffer, size_t size);
+
+void Platform_getRelease(char** string);
+
#endif

© 2014-2024 Faster IT GmbH | imprint | privacy policy