diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2014-11-27 19:33:37 -0200 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2014-11-27 19:33:37 -0200 |
commit | a9f05c2a8bc259a6da0be4004d28c75a9cfe7838 (patch) | |
tree | cc3d3d67eaae42e230d1c6c459d76b30b7d70031 | |
parent | 79662291fa9b81984032d3389e6b0d0b20efb704 (diff) |
Uptime meter for FreeBSD.
This will produce too much replicated code.
I think I'll use a lighter abstraction in things like this.
-rw-r--r-- | Makefile.am | 6 | ||||
-rw-r--r-- | freebsd/Platform.c | 33 | ||||
-rw-r--r-- | freebsd/Platform.h | 4 |
3 files changed, 39 insertions, 4 deletions
diff --git a/Makefile.am b/Makefile.am index c651036b..60d50982 100644 --- a/Makefile.am +++ b/Makefile.am @@ -45,10 +45,12 @@ endif if HTOP_FREEBSD myhtopplatsources = freebsd/Platform.c freebsd/FreeBSDProcessList.c \ -freebsd/FreeBSDCRT.c +freebsd/FreeBSDCRT.c \ +freebsd/UptimeMeter.c myhtopplatheaders = freebsd/Platform.h freebsd/FreeBSDProcessList.h \ -freebsd/FreeBSDCRT.h +freebsd/FreeBSDCRT.h \ +freebsd/UptimeMeter.h endif if HTOP_UNSUPPORTED diff --git a/freebsd/Platform.c b/freebsd/Platform.c index b65fec40..acc69595 100644 --- a/freebsd/Platform.c +++ b/freebsd/Platform.c @@ -1,11 +1,21 @@ /* -htop - unsupported/Platform.c +htop - freebsd/Platform.c (C) 2014 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Platform.h" +#include "Meter.h" +#include "CPUMeter.h" +#include "MemoryMeter.h" +#include "SwapMeter.h" +#include "TasksMeter.h" +#include "LoadAverageMeter.h" +#include "UptimeMeter.h" +#include "BatteryMeter.h" +#include "ClockMeter.h" +#include "HostnameMeter.h" /*{ #include "Action.h" @@ -15,3 +25,24 @@ void Platform_setBindings(Htop_Action* keys) { (void) keys; } +MeterClass* Platform_meterTypes[] = { + &CPUMeter_class, + &ClockMeter_class, + &LoadAverageMeter_class, + &LoadMeter_class, + &MemoryMeter_class, + &SwapMeter_class, + &TasksMeter_class, + &UptimeMeter_class, + &BatteryMeter_class, + &HostnameMeter_class, + &AllCPUsMeter_class, + &AllCPUs2Meter_class, + &LeftCPUsMeter_class, + &RightCPUsMeter_class, + &LeftCPUs2Meter_class, + &RightCPUs2Meter_class, + &BlankMeter_class, + NULL +}; + diff --git a/freebsd/Platform.h b/freebsd/Platform.h index 65a31993..dc468b81 100644 --- a/freebsd/Platform.h +++ b/freebsd/Platform.h @@ -3,7 +3,7 @@ #ifndef HEADER_Platform #define HEADER_Platform /* -htop - unsupported/Platform.h +htop - freebsd/Platform.h (C) 2014 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. @@ -13,5 +13,7 @@ in the source distribution for its full text. void Platform_setBindings(Htop_Action* keys); +extern MeterClass* Platform_meterTypes[]; + #endif |