diff options
author | Nathan Scott <nathans@redhat.com> | 2023-08-22 16:11:05 +1000 |
---|---|---|
committer | Nathan Scott <nathans@redhat.com> | 2023-08-30 13:11:57 +1000 |
commit | 0f751e991d399769fb8d7800f7c4bccec2ca7f60 (patch) | |
tree | 34cd7838f7ebf51049816f9acb6a63cea175af06 /darwin/DarwinProcessList.c | |
parent | 68f4f10f012d11bd57bb725fe4113b2af937fc1d (diff) |
Introduce Row and Table classes for screens beyond top-processes
This commit refactors the Process and ProcessList structures such
they each have a new parent - Row and Table, respectively. These
new classes handle screen updates relating to anything that could
be represented in tabular format, e.g. cgroups, filesystems, etc,
without us having to reimplement the display logic repeatedly for
each new entity.
Diffstat (limited to 'darwin/DarwinProcessList.c')
-rw-r--r-- | darwin/DarwinProcessList.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/darwin/DarwinProcessList.c b/darwin/DarwinProcessList.c index c10e772c..1545600e 100644 --- a/darwin/DarwinProcessList.c +++ b/darwin/DarwinProcessList.c @@ -55,20 +55,22 @@ static struct kinfo_proc* ProcessList_getKInfoProcs(size_t* count) { ProcessList* ProcessList_new(Machine* host, Hashtable* pidMatchList) { DarwinProcessList* this = xCalloc(1, sizeof(DarwinProcessList)); - ProcessList* super = &this->super; + Object_setClass(this, Class(ProcessList)); + ProcessList* super = &this->super; ProcessList_init(super, Class(DarwinProcess), host, pidMatchList); return super; } -void ProcessList_delete(ProcessList* this) { - ProcessList_done(this); +void ProcessList_delete(Object* cast) { + DarwinProcessList* this = (DarwinProcessList*) cast; + ProcessList_done(&this->super); free(this); } void ProcessList_goThroughEntries(ProcessList* super) { - const Machine* host = super->host; + const Machine* host = super->super.host; const DarwinMachine* dhost = (const DarwinMachine*) host; DarwinProcessList* dpl = (DarwinProcessList*) super; bool preExisting = true; |