This is the fourth part in cmd.exe's engine rewrite.
It concerns: - start of decoupling parsing from execution by introducing ad hoc structure to hold parsing result to be passed for execution (done here for redirection, and if conditions), - refactor execution code with putting into helpers: + change of input/output streams + save / restore of input/output streams before / after execution
Note: - the handling of fd > 2 is clearly wrong, but it just mimics the current implementation. More work will be required afterwards (likely using directly CRT low level I/O), - I kept a few specific debug channels in place. They will be removed (or simplified at some point), but they could be useful to debug remaining issues.
-- v3: programs/cmd: Separate IF command parsing from execution. programs/cmd: Let errorlevel be a signed integer. programs/cmd: Create helper to execute a command. programs/cmd: Introduce structure CMD_REDIRECTION. programs/cmd: Introduce a helper to set std handles.