summaryrefslogtreecommitdiffstats
path: root/Process.h
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2021-04-10 11:10:50 +0200
committerBenBE <BenBE@geshi.org>2021-05-23 09:22:21 +0200
commitcdb660adabada0c293ed86ebf5638d435950a03f (patch)
tree210fd0ad96f248ce0c0d9131d3d45a422957a3cf /Process.h
parent94a52cb5c9274fe021b3fc114180294cadb598b4 (diff)
Move mergeCommand to global process struct
Diffstat (limited to 'Process.h')
-rw-r--r--Process.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/Process.h b/Process.h
index 2350775f..2a198441 100644
--- a/Process.h
+++ b/Process.h
@@ -55,6 +55,35 @@ typedef enum ProcessField_ {
struct Settings_;
+/* Holds information about regions of the cmdline that should be
+ * highlighted (e.g. program basename, delimiter, comm). */
+typedef struct ProcessCmdlineHighlight_ {
+ size_t offset; /* first character to highlight */
+ size_t length; /* How many characters to highlight, zero if unused */
+ int attr; /* The attributes used to highlight */
+ int flags; /* Special flags used for selective highlighting, zero for always */
+} ProcessCmdlineHighlight;
+
+/* ProcessMergedCommand is populated by Process_makeCommandStr: It
+ * contains the merged Command string, and the information needed by
+ * Process_writeCommand to color the string. str will be NULL for kernel
+ * threads and zombies */
+typedef struct ProcessMergedCommand_ {
+ char *str; /* merged Command string */
+ size_t maxLen; /* maximum expected length of Command string */
+ size_t highlightCount; /* how many portions of cmdline to highlight */
+ ProcessCmdlineHighlight highlights[8]; /* which portions of cmdline to highlight */
+ bool separateComm : 1; /* whether comm is a separate field */
+ bool unmatchedExe : 1; /* whether exe matched with cmdline */
+ bool cmdlineChanged : 1; /* whether cmdline changed */
+ bool exeChanged : 1; /* whether exe changed */
+ bool commChanged : 1; /* whether comm changed */
+ bool prevMergeSet : 1; /* whether showMergedCommand was set */
+ bool prevPathSet : 1; /* whether showProgramPath was set */
+ bool prevCommSet : 1; /* whether findCommInCmdline was set */
+ bool prevCmdlineSet : 1; /* whether stripExeFromCmdline was set */
+} ProcessMergedCommand;
+
typedef struct Process_ {
/* Super object for emulated OOP */
Object super;
@@ -200,6 +229,11 @@ typedef struct Process_ {
unsigned int tree_right;
unsigned int tree_depth;
unsigned int tree_index;
+
+ /*
+ * Internal state for merged Command display
+ */
+ ProcessMergedCommand mergedCommand;
} Process;
typedef struct ProcessFieldData_ {

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