mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 04:04:35 +03:00
Improving Command display/sort
This commit is contained in:

committed by
BenBE

parent
42c842c190
commit
09fe94da18
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user