mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-15 05:24:36 +03:00
Rework enum ProcessField
Use only one enum instead of a global and a platform specific one. Drop Platform_numberOfFields global variable. Set known size of Process_fields array
This commit is contained in:

committed by
cgzones

parent
d872e36308
commit
89473cc9ae
@ -59,8 +59,6 @@ const MeterClass* const Platform_meterTypes[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
int Platform_numberOfFields = 100;
|
||||
|
||||
ProcessPidColumn Process_pidColumns[] = {
|
||||
{ .id = 0, .label = NULL },
|
||||
};
|
||||
|
@ -23,8 +23,6 @@ extern ProcessField Platform_defaultFields[];
|
||||
|
||||
extern const MeterClass* const Platform_meterTypes[];
|
||||
|
||||
extern int Platform_numberOfFields;
|
||||
|
||||
extern char Process_pidFormat[20];
|
||||
|
||||
extern ProcessPidColumn Process_pidColumns[];
|
||||
|
15
unsupported/ProcessField.h
Normal file
15
unsupported/ProcessField.h
Normal file
@ -0,0 +1,15 @@
|
||||
#ifndef HEADER_UnsupportedProcessField
|
||||
#define HEADER_UnsupportedProcessField
|
||||
/*
|
||||
htop - unsupported/ProcessField.h
|
||||
(C) 2020 htop dev team
|
||||
Released under the GNU GPLv2, see the COPYING file
|
||||
in the source distribution for its full text.
|
||||
*/
|
||||
|
||||
|
||||
#define PLATFORM_PROCESS_FIELDS \
|
||||
// End of list
|
||||
|
||||
|
||||
#endif /* HEADER_UnsupportedProcessField */
|
@ -9,7 +9,7 @@ in the source distribution for its full text.
|
||||
#include "UnsupportedProcess.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
ProcessFieldData Process_fields[] = {
|
||||
ProcessFieldData Process_fields[LAST_PROCESSFIELD] = {
|
||||
[0] = { .name = "", .title = NULL, .description = NULL, .flags = 0, },
|
||||
[PID] = { .name = "PID", .title = " PID ", .description = "Process/thread ID", .flags = 0, },
|
||||
[COMM] = { .name = "Command", .title = "Command ", .description = "Command line", .flags = 0, },
|
||||
@ -35,7 +35,6 @@ ProcessFieldData Process_fields[] = {
|
||||
[TIME] = { .name = "TIME", .title = " TIME+ ", .description = "Total time the process has spent in user and system time", .flags = 0, },
|
||||
[NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, },
|
||||
[TGID] = { .name = "TGID", .title = " TGID ", .description = "Thread group ID (i.e. process ID)", .flags = 0, },
|
||||
[100] = { .name = "*** report bug! ***", .title = NULL, .description = NULL, .flags = 0, },
|
||||
};
|
||||
|
||||
Process* UnsupportedProcess_new(Settings* settings) {
|
||||
|
@ -11,7 +11,7 @@ in the source distribution for its full text.
|
||||
|
||||
#define Process_delete UnsupportedProcess_delete
|
||||
|
||||
extern ProcessFieldData Process_fields[];
|
||||
extern ProcessFieldData Process_fields[LAST_PROCESSFIELD];
|
||||
|
||||
Process* UnsupportedProcess_new(Settings* settings);
|
||||
|
||||
|
Reference in New Issue
Block a user