From 69f439eff387a6ecb52734e400b297a3c85f2285 Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Tue, 21 Sep 2021 08:35:19 +0200 Subject: New upstream version 3.1.0 --- unsupported/Platform.c | 58 ++++++++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 25 deletions(-) (limited to 'unsupported/Platform.c') diff --git a/unsupported/Platform.c b/unsupported/Platform.c index 94e1b7c..6fbe518 100644 --- a/unsupported/Platform.c +++ b/unsupported/Platform.c @@ -6,19 +6,24 @@ Released under the GNU GPLv2, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + +#include "unsupported/Platform.h" + #include -#include "Platform.h" -#include "Macros.h" #include "CPUMeter.h" -#include "MemoryMeter.h" -#include "SwapMeter.h" -#include "TasksMeter.h" -#include "LoadAverageMeter.h" #include "ClockMeter.h" #include "DateMeter.h" #include "DateTimeMeter.h" #include "HostnameMeter.h" +#include "LoadAverageMeter.h" +#include "Macros.h" +#include "MemoryMeter.h" +#include "MemorySwapMeter.h" +#include "SwapMeter.h" +#include "SysArchMeter.h" +#include "TasksMeter.h" #include "UptimeMeter.h" @@ -39,9 +44,11 @@ const MeterClass* const Platform_meterTypes[] = { &LoadMeter_class, &MemoryMeter_class, &SwapMeter_class, + &MemorySwapMeter_class, &TasksMeter_class, &BatteryMeter_class, &HostnameMeter_class, + &SysArchMeter_class, &UptimeMeter_class, &AllCPUsMeter_class, &AllCPUs2Meter_class, @@ -59,6 +66,8 @@ const MeterClass* const Platform_meterTypes[] = { NULL }; +static const char Platform_unsupported[] = "unsupported"; + void Platform_init(void) { /* no platform-specific setup needed */ } @@ -86,13 +95,15 @@ int Platform_getMaxPid() { return 1; } -double Platform_setCPUValues(Meter* this, int cpu) { +double Platform_setCPUValues(Meter* this, unsigned int cpu) { (void) cpu; double* v = this->values; v[CPU_METER_FREQUENCY] = NAN; v[CPU_METER_TEMPERATURE] = NAN; + this->curItems = 1; + return 0.0; } @@ -104,25 +115,20 @@ void Platform_setSwapValues(Meter* this) { (void) this; } -bool Process_isThread(const Process* this) { - (void) this; - return false; -} - char* Platform_getProcessEnv(pid_t pid) { (void) pid; return NULL; } char* Platform_getInodeFilename(pid_t pid, ino_t inode) { - (void)pid; - (void)inode; - return NULL; + (void)pid; + (void)inode; + return NULL; } FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid) { - (void)pid; - return NULL; + (void)pid; + return NULL; } bool Platform_getDiskIO(DiskIOData* data) { @@ -130,14 +136,8 @@ bool Platform_getDiskIO(DiskIOData* data) { return false; } -bool Platform_getNetworkIO(unsigned long int* bytesReceived, - unsigned long int* packetsReceived, - unsigned long int* bytesTransmitted, - unsigned long int* packetsTransmitted) { - *bytesReceived = 0; - *packetsReceived = 0; - *bytesTransmitted = 0; - *packetsTransmitted = 0; +bool Platform_getNetworkIO(NetworkIOData* data) { + (void)data; return false; } @@ -145,3 +145,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); +} -- cgit v1.2.3