summaryrefslogtreecommitdiffstats
path: root/openbsd
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2020-12-15 19:44:52 +0100
committercgzones <cgzones@googlemail.com>2020-12-19 21:13:32 +0100
commit9f68c8d34142746a16ea3883d736a0955977e625 (patch)
treefd9e6beb513616093a2ce41b35fa9d48afffa7c6 /openbsd
parent89473cc9ae950bbb5e291d1f186d372f66f66394 (diff)
Merge Process_pidColumns into Process_fields and rework auto-fit for PID-like columns
Diffstat (limited to 'openbsd')
-rw-r--r--openbsd/OpenBSDProcess.c30
-rw-r--r--openbsd/OpenBSDProcess.h4
2 files changed, 14 insertions, 20 deletions
diff --git a/openbsd/OpenBSDProcess.c b/openbsd/OpenBSDProcess.c
index 0ac08c66..642e9bea 100644
--- a/openbsd/OpenBSDProcess.c
+++ b/openbsd/OpenBSDProcess.c
@@ -16,7 +16,7 @@ in the source distribution for its full text.
#include "XUtils.h"
-ProcessFieldData Process_fields[LAST_PROCESSFIELD] = {
+const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = {
[0] = {
.name = "",
.title = NULL,
@@ -25,9 +25,10 @@ ProcessFieldData Process_fields[LAST_PROCESSFIELD] = {
},
[PID] = {
.name = "PID",
- .title = " PID ",
+ .title = "PID",
.description = "Process/thread ID",
.flags = 0,
+ .pidColumn = true,
},
[COMM] = {
.name = "Command",
@@ -43,21 +44,24 @@ ProcessFieldData Process_fields[LAST_PROCESSFIELD] = {
},
[PPID] = {
.name = "PPID",
- .title = " PPID ",
+ .title = "PPID",
.description = "Parent process ID",
.flags = 0,
+ .pidColumn = true,
},
[PGRP] = {
.name = "PGRP",
- .title = " PGRP ",
+ .title = "PGRP",
.description = "Process group ID",
.flags = 0,
+ .pidColumn = true,
},
[SESSION] = {
.name = "SESSION",
- .title = " SESN ",
+ .title = "SESN",
.description = "Process's session ID",
.flags = 0,
+ .pidColumn = true,
},
[TTY_NR] = {
.name = "TTY_NR",
@@ -67,9 +71,10 @@ ProcessFieldData Process_fields[LAST_PROCESSFIELD] = {
},
[TPGID] = {
.name = "TPGID",
- .title = " TPGID ",
+ .title = "TPGID",
.description = "Process ID of the fg process group of the controlling terminal",
.flags = 0,
+ .pidColumn = true,
},
[MINFLT] = {
.name = "MINFLT",
@@ -163,22 +168,13 @@ ProcessFieldData Process_fields[LAST_PROCESSFIELD] = {
},
[TGID] = {
.name = "TGID",
- .title = " TGID ",
+ .title = "TGID",
.description = "Thread group ID (i.e. process ID)",
.flags = 0,
+ .pidColumn = true,
},
};
-ProcessPidColumn Process_pidColumns[] = {
- { .id = PID, .label = "PID" },
- { .id = PPID, .label = "PPID" },
- { .id = TPGID, .label = "TPGID" },
- { .id = TGID, .label = "TGID" },
- { .id = PGRP, .label = "PGRP" },
- { .id = SESSION, .label = "SESN" },
- { .id = 0, .label = NULL },
-};
-
Process* OpenBSDProcess_new(const Settings* settings) {
OpenBSDProcess* this = xCalloc(sizeof(OpenBSDProcess), 1);
Object_setClass(this, Class(OpenBSDProcess));
diff --git a/openbsd/OpenBSDProcess.h b/openbsd/OpenBSDProcess.h
index 6b28025a..6aab29a0 100644
--- a/openbsd/OpenBSDProcess.h
+++ b/openbsd/OpenBSDProcess.h
@@ -25,9 +25,7 @@ typedef struct OpenBSDProcess_ {
extern const ProcessClass OpenBSDProcess_class;
-extern ProcessFieldData Process_fields[LAST_PROCESSFIELD];
-
-extern ProcessPidColumn Process_pidColumns[];
+extern const ProcessFieldData Process_fields[LAST_PROCESSFIELD];
Process* OpenBSDProcess_new(const Settings* settings);

© 2014-2024 Faster IT GmbH | imprint | privacy policy