Improve process logic
This commit is contained in:
@@ -24,7 +24,7 @@ String GetAbsolutePath(Allocator arena, String relative);
|
||||
bool IsValid(const FileIter &it);
|
||||
void Advance(FileIter *it);
|
||||
FileIter IterateFiles(Allocator allocator, String path);
|
||||
bool InitOS();
|
||||
void InitOS(void (*error_proc)(const char *, ...));
|
||||
|
||||
String GetExePath(Allocator allocator);
|
||||
String GetExeDir(Allocator allocator);
|
||||
@@ -34,26 +34,18 @@ bool IsFile(String path);
|
||||
String GetWorkingDir(Allocator arena);
|
||||
bool IsAbsolute(String path);
|
||||
|
||||
struct StdoutPollInfo {
|
||||
int64_t size_read;
|
||||
int64_t size_available;
|
||||
};
|
||||
|
||||
struct Process {
|
||||
bool is_valid;
|
||||
String error_message;
|
||||
bool exited;
|
||||
int exit_code;
|
||||
char platform[6 * 8];
|
||||
bool is_valid;
|
||||
int exit_code;
|
||||
char platform[6 * 8];
|
||||
|
||||
int64_t view_id; // text editor view
|
||||
bool scroll_to_end;
|
||||
};
|
||||
|
||||
Process CreateCommandLineProcess(String command_line, String working_dir);
|
||||
bool PollExitCode(Process *process);
|
||||
void CloseProcess(Process *process);
|
||||
void KillProcess(Process *process);
|
||||
StdoutPollInfo PollStdout(Process *process, char *buffer, int64_t buffer_size);
|
||||
void WriteStdin(Process *process, String string);
|
||||
void CloseStdin(Process *process);
|
||||
Process SpawnProcess(String command_line, String working_dir, String write_stdin = {});
|
||||
bool IsValid(Process *process);
|
||||
void KillProcess(Process *process);
|
||||
String PollStdout(Allocator allocator, Process *process);
|
||||
void WriteStdin(Process *process, String string);
|
||||
void CloseStdin(Process *process);
|
||||
Reference in New Issue
Block a user