diff options
author | Nathan Scott <nathans@redhat.com> | 2023-08-31 11:56:43 +1000 |
---|---|---|
committer | Nathan Scott <nathans@redhat.com> | 2023-08-31 14:13:16 +1000 |
commit | b74673fe37fd379fc350789e696470556776d815 (patch) | |
tree | cbe4f036962c439f9c07a9c96302f5908f6410b0 /ProcessList.h | |
parent | 214166a049c2a6ac454dbb37b85b04c039a6a17a (diff) |
Rename ProcessList to ProcessTable throughout
Following up with some discusson from a few months back,
where it was proposed that ProcessTable is a better name.
This data structure is definitely not a list ... if it
was one-dimensional it'd be a set, but in practice it has
much more in common with a two-dimensional table.
The Process table is a familiar operating system concept
for many people too so it resonates a little in that way
as well.
Diffstat (limited to 'ProcessList.h')
-rw-r--r-- | ProcessList.h | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/ProcessList.h b/ProcessList.h deleted file mode 100644 index 9710a0a5..00000000 --- a/ProcessList.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef HEADER_ProcessList -#define HEADER_ProcessList -/* -htop - ProcessList.h -(C) 2004,2005 Hisham H. Muhammad -Released under the GNU GPLv2+, see the COPYING file -in the source distribution for its full text. -*/ - -#include "config.h" // IWYU pragma: keep - -#include <limits.h> -#include <stdbool.h> -#include <stdint.h> -#include <sys/time.h> -#include <sys/types.h> - -#include "Hashtable.h" -#include "Machine.h" -#include "Object.h" -#include "Panel.h" -#include "Process.h" -#include "RichString.h" -#include "Table.h" - - -typedef struct ProcessList_ { - Table super; - - Hashtable* pidMatchList; - - unsigned int totalTasks; - unsigned int runningTasks; - unsigned int userlandThreads; - unsigned int kernelThreads; -} ProcessList; - -/* Implemented by platforms */ -ProcessList* ProcessList_new(Machine* host, Hashtable* pidMatchList); -void ProcessList_delete(Object* cast); -void ProcessList_goThroughEntries(ProcessList* this); - -void ProcessList_init(ProcessList* this, const ObjectClass* klass, Machine* host, Hashtable* pidMatchList); - -void ProcessList_done(ProcessList* this); - -extern const TableClass ProcessList_class; - -static inline void ProcessList_add(ProcessList* this, Process* process) { - Table_add(&this->super, &process->super); -} - -Process* ProcessList_getProcess(ProcessList* this, pid_t pid, bool* preExisting, Process_New constructor); - -static inline Process* ProcessList_findProcess(ProcessList* this, pid_t pid) { - return (Process*) Table_findRow(&this->super, pid); -} - -#endif |