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.
This commit is contained in:
Nathan Scott
2020-11-19 12:32:07 +11:00
parent 329011bb98
commit c75c5ef9c6
15 changed files with 157 additions and 86 deletions

View File

@ -131,11 +131,20 @@ const MeterClass* const Platform_meterTypes[] = {
NULL
};
void Platform_setBindings(Htop_Action* keys) {
(void) keys;
int Platform_numberOfFields = 100;
void Platform_init(void) {
/* no platform-specific setup needed */
}
int Platform_numberOfFields = 100;
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() {
struct timeval bootTime, currTime;

View File

@ -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);