summaryrefslogtreecommitdiff
path: root/os.h
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-01-08 13:45:57 -0500
committerpommicket <pommicket@gmail.com>2023-01-09 13:23:50 -0500
commitea70e513d8a927680f2795d4bad9aba788f32d77 (patch)
tree882054649e65718a3eea60cd84788e527e37225d /os.h
parentff6abceefdcf3bd1521d88173323c93abf71eb6b (diff)
building on windows
still needs lots more testing
Diffstat (limited to 'os.h')
-rw-r--r--os.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/os.h b/os.h
index 0af10cb..d2920db 100644
--- a/os.h
+++ b/os.h
@@ -84,10 +84,7 @@ typedef struct Process Process;
// zero everything except what you're using
typedef struct {
- bool stdin_blocking;
- bool stdout_blocking;
bool separate_stderr;
- bool stderr_blocking; // not applicable if separate_stderr is false.
const char *working_directory;
} ProcessSettings;
@@ -106,7 +103,7 @@ typedef struct {
int process_get_id(void);
// 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);
+Process *process_run_ex(const char *command, const ProcessSettings *settings);
// like process_run_ex, but with the default settings
Process *process_run(const char *command);
// returns the error last error produced, or NULL if there was no error.
@@ -115,7 +112,7 @@ const char *process_geterr(Process *process);
// returns:
// -2 on error
// or a non-negative number indicating the number of bytes written.
-// If stdin is set to blocking, fewer than `size` bytes will be written only if an error occured.
+// Currently, this does a blocking write.
long long process_write(Process *process, const char *data, size_t size);
// read from stdout+stderr
// returns:
@@ -123,7 +120,7 @@ long long process_write(Process *process, const char *data, size_t size);
// -1 if no data is available right now
// 0 on end of file
// or a positive number indicating the number of bytes read to data (at most size)
-// If stdout is set to blocking, fewer than `size` bytes will be read only if an error occured or end-of-file was reached.
+// This does a nonblocking read.
long long process_read(Process *process, char *data, size_t size);
// like process_read, but reads stderr.
// this function ALWAYS RETURNS -2 if separate_stderr is not specified in the ProcessSettings.