summaryrefslogtreecommitdiffstats
path: root/Process.h
diff options
context:
space:
mode:
authorNathan Scott <nathans@redhat.com>2023-05-02 09:02:22 +1000
committerNathan Scott <nathans@redhat.com>2023-05-08 13:06:07 +1000
commit0bdade1b6cb40c5bd374a93ac0489058a7421bb5 (patch)
tree0e0225f7dbf6867402c5ed3481a705d01941f42e /Process.h
parente4ebe18b67c366d367231a1123b057c82018cf5b (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 'Process.h')
-rw-r--r--Process.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/Process.h b/Process.h
index db32ecc1..ad89fd45 100644
--- a/Process.h
+++ b/Process.h
@@ -82,7 +82,7 @@ typedef enum ProcessState_ {
SLEEPING
} ProcessState;
-struct Settings_;
+struct Machine_;
/* Holds information about regions of the cmdline that should be
* highlighted (e.g. program basename, delimiter, comm). */
@@ -108,9 +108,8 @@ typedef struct Process_ {
/* Super object for emulated OOP */
Object super;
- /* Pointer to quasi-global data structures */
- const struct ProcessList_* processList;
- const struct Settings_* settings;
+ /* Pointer to quasi-global data */
+ const struct Machine_* host;
/* Process identifier */
pid_t pid;
@@ -305,7 +304,7 @@ extern uint8_t Process_fieldWidths[LAST_PROCESSFIELD];
extern int Process_pidDigits;
extern int Process_uidDigits;
-typedef Process* (*Process_New)(const struct Settings_*);
+typedef Process* (*Process_New)(const struct Machine_*);
typedef void (*Process_WriteField)(const Process*, RichString*, ProcessField);
typedef int (*Process_CompareByKey)(const Process*, const Process*, ProcessField);
@@ -389,7 +388,7 @@ void Process_done(Process* this);
extern const ProcessClass Process_class;
-void Process_init(Process* this, const struct Settings_* settings);
+void Process_init(Process* this, const struct Machine_* host);
void Process_toggleTag(Process* this);

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