diff options
author | Daniel Lange <DLange@git.local> | 2024-01-10 12:40:37 +0100 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2024-01-10 12:40:37 +0100 |
commit | 7271b076b82785ffca73ee9e4ae84cabb77018ee (patch) | |
tree | e8270dd60ec096bee8157dbadf029e15ed584592 /netbsd/NetBSDProcess.c | |
parent | f288666edc9180a2e81e6655951878124f321df6 (diff) | |
download | debian_htop-upstream.tar.gz debian_htop-upstream.tar.bz2 debian_htop-upstream.zip |
New upstream version 3.3.0upstream/3.3.0upstream
Diffstat (limited to 'netbsd/NetBSDProcess.c')
-rw-r--r-- | netbsd/NetBSDProcess.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/netbsd/NetBSDProcess.c b/netbsd/NetBSDProcess.c index 4d4ac4e..f58cdf2 100644 --- a/netbsd/NetBSDProcess.c +++ b/netbsd/NetBSDProcess.c @@ -8,6 +8,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "netbsd/NetBSDProcess.h" #include <stdlib.h> @@ -212,10 +214,10 @@ const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = { }; -Process* NetBSDProcess_new(const Settings* settings) { +Process* NetBSDProcess_new(const Machine* host) { NetBSDProcess* this = xCalloc(1, sizeof(NetBSDProcess)); Object_setClass(this, Class(NetBSDProcess)); - Process_init(&this->super, settings); + Process_init(&this->super, host); return &this->super; } @@ -225,16 +227,20 @@ void Process_delete(Object* cast) { free(this); } -static void NetBSDProcess_writeField(const Process* this, RichString* str, ProcessField field) { +static void NetBSDProcess_rowWriteField(const Row* super, RichString* str, ProcessField field) { + const NetBSDProcess* np = (const NetBSDProcess*) super; + char buffer[256]; buffer[255] = '\0'; int attr = CRT_colors[DEFAULT_COLOR]; + //size_t n = sizeof(buffer) - 1; switch (field) { // add NetBSD-specific fields here default: - Process_writeField(this, str, field); + Process_writeField(&np->super, str, field); return; } + RichString_appendWide(str, attr, buffer); } @@ -254,11 +260,18 @@ static int NetBSDProcess_compareByKey(const Process* v1, const Process* v2, Proc const ProcessClass NetBSDProcess_class = { .super = { - .extends = Class(Process), - .display = Process_display, - .delete = Process_delete, - .compare = Process_compare + .super = { + .extends = Class(Process), + .display = Row_display, + .delete = Process_delete, + .compare = Process_compare + }, + .isHighlighted = Process_rowIsHighlighted, + .isVisible = Process_rowIsVisible, + .matchesFilter = Process_rowMatchesFilter, + .compareByParent = Process_compareByParent, + .sortKeyString = Process_rowGetSortKey, + .writeField = NetBSDProcess_rowWriteField }, - .writeField = NetBSDProcess_writeField, .compareByKey = NetBSDProcess_compareByKey }; |