diff options
author | Nathan Scott <nathans@redhat.com> | 2023-05-02 09:02:22 +1000 |
---|---|---|
committer | Nathan Scott <nathans@redhat.com> | 2023-05-08 13:06:07 +1000 |
commit | 0bdade1b6cb40c5bd374a93ac0489058a7421bb5 (patch) | |
tree | 0e0225f7dbf6867402c5ed3481a705d01941f42e /unsupported/UnsupportedProcess.c | |
parent | e4ebe18b67c366d367231a1123b057c82018cf5b (diff) |
Introduce Machine class for host-specific info (split from ProcessList)
First stage in sanitizing the process list structure so that htop
can support other types of lists too (cgroups, filesystems, ...),
in the not-too-distant future.
This introduces struct Machine for system-wide information while
keeping process-list information in ProcessList (now much less).
Next step is to propogate this separation into each platform, to
match these core changes.
Diffstat (limited to 'unsupported/UnsupportedProcess.c')
-rw-r--r-- | unsupported/UnsupportedProcess.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/unsupported/UnsupportedProcess.c b/unsupported/UnsupportedProcess.c index 2aca0488..4d8cb080 100644 --- a/unsupported/UnsupportedProcess.c +++ b/unsupported/UnsupportedProcess.c @@ -44,10 +44,10 @@ const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = { [TGID] = { .name = "TGID", .title = "TGID", .description = "Thread group ID (i.e. process ID)", .flags = 0, .pidColumn = true, }, }; -Process* UnsupportedProcess_new(const Settings* settings) { +Process* UnsupportedProcess_new(const Machine* host) { Process* this = xCalloc(1, sizeof(UnsupportedProcess)); Object_setClass(this, Class(UnsupportedProcess)); - Process_init(this, settings); + Process_init(this, host); return this; } @@ -60,7 +60,7 @@ void Process_delete(Object* cast) { static void UnsupportedProcess_writeField(const Process* this, RichString* str, ProcessField field) { const UnsupportedProcess* up = (const UnsupportedProcess*) this; - bool coloring = this->settings->highlightMegabytes; + bool coloring = this->host->settings->highlightMegabytes; char buffer[256]; buffer[255] = '\0'; int attr = CRT_colors[DEFAULT_COLOR]; size_t n = sizeof(buffer) - 1; |