diff options
author | Nathan Scott <nathans@redhat.com> | 2020-11-19 12:32:07 +1100 |
---|---|---|
committer | Nathan Scott <nathans@redhat.com> | 2020-11-19 12:32:07 +1100 |
commit | c75c5ef9c6631127e5c0f3ace4b59e4acadd04e5 (patch) | |
tree | b34cc2a215743f92f063bb4e1578a6888181992a /darwin | |
parent | 329011bb982b7dda02e6901173e6fc34bcaa2645 (diff) |
Minor cleanups to platform-specific init and done
Move platform-specific code out of the htop.c main function
and into the platform sub-directories - primarily this is
the Linux procfs path check and sensors setup/teardown; not
needed on any other platforms. No functional changes here.
Diffstat (limited to 'darwin')
-rw-r--r-- | darwin/Platform.c | 13 | ||||
-rw-r--r-- | darwin/Platform.h | 11 |
2 files changed, 18 insertions, 6 deletions
diff --git a/darwin/Platform.c b/darwin/Platform.c index bf9645b3..0deca555 100644 --- a/darwin/Platform.c +++ b/darwin/Platform.c @@ -131,12 +131,21 @@ const MeterClass* const Platform_meterTypes[] = { NULL }; +int Platform_numberOfFields = 100; + +void Platform_init(void) { + /* no platform-specific setup needed */ +} + +void Platform_done(void) { + /* no platform-specific cleanup needed */ +} + void Platform_setBindings(Htop_Action* keys) { + /* no platform-specific key bindings */ (void) keys; } -int Platform_numberOfFields = 100; - int Platform_getUptime() { struct timeval bootTime, currTime; int mib[2] = { CTL_KERN, KERN_BOOTTIME }; diff --git a/darwin/Platform.h b/darwin/Platform.h index 40b7d730..e1f83553 100644 --- a/darwin/Platform.h +++ b/darwin/Platform.h @@ -19,20 +19,23 @@ in the source distribution for its full text. #include "ProcessLocksScreen.h" #include "SignalsPanel.h" +extern ProcessFieldData Process_fields[]; extern ProcessField Platform_defaultFields[]; +extern int Platform_numberOfFields; + extern const SignalItem Platform_signals[]; extern const unsigned int Platform_numberOfSignals; -extern ProcessFieldData Process_fields[]; - extern const MeterClass* const Platform_meterTypes[]; -void Platform_setBindings(Htop_Action* keys); +void Platform_init(void); -extern int Platform_numberOfFields; +void Platform_done(void); + +void Platform_setBindings(Htop_Action* keys); int Platform_getUptime(void); |