summaryrefslogtreecommitdiff
path: root/os.h
diff options
context:
space:
mode:
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.