Linux: dynamically adjust the SECATTR column width

SELinux contexts can be quite long; adjust the column width dynamically
at each cycle to the longest value.

Also with the recent addition of multiple screens, over-long columns can
be moved into their own screen.
This commit is contained in:
Christian Göttsche
2021-12-04 19:57:47 +01:00
committed by BenBE
parent 6133cac721
commit 3ba695293c
5 changed files with 39 additions and 2 deletions

View File

@ -279,6 +279,9 @@ typedef struct ProcessFieldData_ {
/* Whether the column should be sorted in descending order by default */
bool defaultSortDesc;
/* Whether the column width is dynamically adjusted (the minimum width is determined by the title length) */
bool autoWidth;
} ProcessFieldData;
// Implemented in platform-specific code:
@ -286,6 +289,7 @@ void Process_writeField(const Process* this, RichString* str, ProcessField field
int Process_compare(const void* v1, const void* v2);
void Process_delete(Object* cast);
extern const ProcessFieldData Process_fields[LAST_PROCESSFIELD];
extern uint8_t Process_fieldWidths[LAST_PROCESSFIELD];
#define PROCESS_MIN_PID_DIGITS 5
#define PROCESS_MAX_PID_DIGITS 19
#define PROCESS_MIN_UID_DIGITS 5
@ -406,4 +410,7 @@ void Process_makeCommandStr(Process* this);
void Process_writeCommand(const Process* this, int attr, int baseAttr, RichString* str);
void Process_resetFieldWidths(void);
void Process_updateFieldWidth(ProcessField key, size_t width);
#endif