Create process, poll and send output to console buffer

This commit is contained in:
Krzosa Karol
2024-08-07 07:51:50 +02:00
parent 7b8b8c751d
commit 327f352872
8 changed files with 51 additions and 17 deletions

View File

@@ -208,14 +208,14 @@ For(arr.reverse_iter()) {
}
*/
#define IterRemove(a) for (int i = 0; i < (a).len; i += 1)
#define IterRemovePrepare(a) \
auto &it = (a)[i]; \
bool remove_item = false; \
defer { \
if (remove_item) { \
(a).ordered_remove(it); \
i -= 1; \
} \
#define IterRemovePrepare(a) \
auto &it = (a)[i]; \
bool remove_item = false; \
defer { \
if (remove_item) { \
Remove(&(a), it); \
i -= 1; \
} \
}
#define ForItem(it, array) for (auto &it : (array))
#define For(array) ForItem(it, array)

View File

@@ -46,7 +46,7 @@ struct Process {
char platform[6 * 8];
};
Process RunCmd(String command_line, String working_dir);
Process CreateCommandLineProcess(String command_line, String working_dir);
bool WaitForExit(Process *process);
bool PollExitCode(Process *process);
void KillProcess(Process *process);

View File

@@ -318,7 +318,7 @@ static void Win32ProcessError(Process *process, String cmd) {
Win32CloseProcess(process);
}
Process RunCmd(String command_line, String working_dir) {
Process CreateCommandLineProcess(String command_line, String working_dir) {
Process process = {};
Win32Process *p = (Win32Process *)process.platform;