diff options
author | Narendran Gopalakrishnan <g_narendran142@yahoo.com> | 2020-10-17 16:24:45 +0530 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2020-11-24 19:05:48 +0100 |
commit | 09fe94da18d33d2c4e1fe415e8346fa99b9944b4 (patch) | |
tree | d5d405e4bfdbbe8e4940ffe92f8b50def3cb6122 /Process.h | |
parent | 42c842c190912de58ccf3f41bd58c452c595e40d (diff) |
Improving Command display/sort
Diffstat (limited to 'Process.h')
-rw-r--r-- | Process.h | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -67,7 +67,7 @@ typedef struct Process_ { pid_t pid; pid_t ppid; pid_t tgid; - char* comm; + char* comm; /* use Process_getCommand() for a decorated command line */ int commLen; int indent; @@ -127,14 +127,18 @@ extern char Process_pidFormat[20]; typedef Process*(*Process_New)(const struct Settings_*); typedef void (*Process_WriteField)(const Process*, RichString*, ProcessField); +typedef const char* (*Process_GetCommandStr)(const Process*); typedef struct ProcessClass_ { const ObjectClass super; const Process_WriteField writeField; + const Process_GetCommandStr getCommandStr; } ProcessClass; #define As_Process(this_) ((const ProcessClass*)((this_)->super.klass)) +#define Process_getCommand(this_) As_Process(this_)->getCommandStr((const Process*)(this_)) + static inline pid_t Process_getParentPid(const Process* this) { return this->tgid == this->pid ? this->ppid : this->tgid; } |