diff options
author | pommicket <pommicket@gmail.com> | 2022-12-05 11:05:47 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-12-05 11:05:47 -0500 |
commit | 4dc976bc793af39ebad715ef669b335657926f65 (patch) | |
tree | da899fcc20114dc9a426463b186b082de882c1a1 /process.h | |
parent | 0d39cca457e51bdf7bb7d9942a522e52bbedfa1f (diff) |
start lsp
Diffstat (limited to 'process.h')
-rw-r--r-- | process.h | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -4,11 +4,25 @@ typedef struct Process Process; +// zero everything except what you're using +typedef struct { + bool stdin_blocking; + bool stdout_blocking; +} ProcessSettings; + // 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); +// like process_run_ex, but with the default settings bool process_run(Process *process, char const *command); // returns the error last error produced, or NULL if there was no error. char const *process_geterr(Process *process); +// write to stdin +// returns: +// -2 on error +// or a non-negative number indicating the number of bytes written. +long long process_write(Process *process, const char *data, size_t size); +// read from stdout+stderr // returns: // -2 on error // -1 if no data is available right now |