diff options
author | pommicket <pommicket@gmail.com> | 2023-01-02 13:36:38 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-01-02 13:36:38 -0500 |
commit | c0d0117a963cf8e4dfb28b919087d8a8ecbbca6e (patch) | |
tree | 0c412921f82f141cf733e8de4b4b02152446dba5 /os.h | |
parent | 1dc24e79ec7cf80e06b9c4e7cc55e18857b624c1 (diff) |
fix up restructuring
Diffstat (limited to 'os.h')
-rw-r--r-- | os.h | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -89,11 +89,11 @@ typedef struct { // get process ID of this process int process_get_id(void); -// execute the given command (like if it was passed to system()). -// returns false on failure -bool process_run_ex(Process *proc, const char *command, const ProcessSettings *props); +// execute the given command (like if it was passed to system()), creating a new Process object. +// returns a valid process object on failure, but it will have an error, according to process_geterr +Process *process_run_ex(const char *command, const ProcessSettings *props); // like process_run_ex, but with the default settings -bool process_run(Process *process, const char *command); +Process *process_run(const char *command); // returns the error last error produced, or NULL if there was no error. const char *process_geterr(Process *process); // write to stdin @@ -119,6 +119,7 @@ long long process_read_stderr(Process *process, char *data, size_t size); // If message is not NULL, it will be set to a description of what happened (e.g. "exited successfully") int process_check_status(Process *process, char *message, size_t message_size); // kills process if still running +// this also frees any resources used by `process`. void process_kill(Process *process); #endif // OS_H_ |