From c75c5ef9c6631127e5c0f3ace4b59e4acadd04e5 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Thu, 19 Nov 2020 12:32:07 +1100 Subject: 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. --- solaris/Platform.c | 17 +++++++++++++---- solaris/Platform.h | 8 ++++++-- 2 files changed, 19 insertions(+), 6 deletions(-) (limited to 'solaris') diff --git a/solaris/Platform.c b/solaris/Platform.c index 7eff2d5f..d31c0a8d 100644 --- a/solaris/Platform.c +++ b/solaris/Platform.c @@ -119,14 +119,23 @@ const MeterClass* const Platform_meterTypes[] = { NULL }; -void Platform_setBindings(Htop_Action* keys) { - (void) keys; -} - int Platform_numberOfFields = LAST_PROCESSFIELD; extern char Process_pidFormat[20]; +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_getUptime() { int boot_time = 0; int curr_time = time(NULL); diff --git a/solaris/Platform.h b/solaris/Platform.h index 051a64da..0c2e44a2 100644 --- a/solaris/Platform.h +++ b/solaris/Platform.h @@ -45,12 +45,16 @@ extern ProcessField Platform_defaultFields[]; extern const MeterClass* const Platform_meterTypes[]; -void Platform_setBindings(Htop_Action* keys); - extern int Platform_numberOfFields; extern char Process_pidFormat[20]; +void Platform_init(void); + +void Platform_done(void); + +void Platform_setBindings(Htop_Action* keys); + int Platform_getUptime(void); void Platform_getLoadAverage(double* one, double* five, double* fifteen); -- cgit v1.2.3