Conversation
4f8697c to
8ef5992
Compare
|
After switching from merged to standard mode: |
|
Moving this item back a few releases, as we'd run into several issues I noticed:
Thus even though I'd really like to bring this refactoring in ASAP it's causing too much noise to justify it right now. |
1efa15d to
6dd225d
Compare
6dd225d to
4d124d9
Compare
4d124d9 to
a3f49a4
Compare
ea60a21 to
cf22f73
Compare
da55a7a to
f075725
Compare
|
Maybe you could refactor everything process command related into a C++ like class: stuct ProcessCommand {
char* fullCommand;
char* comm;
char* exe;
int startIndexOfExeInFullCommand;
int endIndexOfExeInFullCommand;
int startIndexOfCommInFullCommand;
int endIndexOfCommInFullCommand;
...and then have public methods void ProcessCommand_updateExe(ProcessCommand* pc, const char* exe);
void ProcessCommand_updateComm(ProcessCommand* pc, const char* comm);
void ProcessCommand_updateFullCommand(ProcessCommand* pc, const char* fullCommand);
void ProcessCommand_format(const ProcessCommand* pc, RichString* str);and no code outside of these public functions (and maybe some private static ones) reads/writes any of the data fields of the ProcessCommand struct directly. Another thought: does it make sense to colour common command-path prefixes as gray (like |
|
The first step I'm working on right now is bringing all the required fields into the common code base, i.e. the following fields:
After this I planned to make the common code paths (like extracting the basename from the command line, more homogeneous. Abstracting them away in a pseudo-class might be worth a look, but most implementations will likely use one of two implementations anyway: Extract from NUL-terminated vs. extract from blank-separated, where the first may trigger the second one internally via heuristic (e.g. for Chrome, wine). When setting the command line I more or less already know most of the fields, thus a per-OS split of the "calculate-internal-fields" routine doesn't make much sense. It's extracting this routine and bring it to a common code-base that's currently the hardest part. But to facilitate this I need to have all required fields in the common code-base first, which is ATM still WIP. |
f075725 to
d7d7441
Compare
c7f0593 to
1a46ea8
Compare
This field held practically the same value as cmdlineBasenameEnd
…te the fields purpose
b69258f to
88eab5f
Compare
Refer to htop-dev#388 PR for more details.
Refer to htop-dev#388 PR for more details.
Refer to htop-dev#388 PR for more details.
This is some refactoring work for
makeCommandStrto make this suitable for platform independent use.Changes include:
cmdline,commandexeto platform-independentProcessstructure.ProcessMergeCommandto platform-independentProcessstructure.procExeDeletedto platform-independentProcessstructure.The current state is mostly some PoC and still WIP.