Add convenience functions to get process IOStreams
This commit is contained in:
1 parent
7ff015ceae
commit
f6f49de134
6 files changed
+83
-5
No files matched your search
@@ -153,6 +153,38 @@ done:
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_IOStream *SDL_GetProcessOutputStream(SDL_Process *process)
|
||||
{
|
||||
if (!process) {
|
||||
SDL_InvalidParamError("process");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SDL_IOStream *io = (SDL_IOStream *)SDL_GetPointerProperty(process->props, SDL_PROP_PROCESS_STDOUT_POINTER, NULL);
|
||||
if (!io) {
|
||||
SDL_SetError("Process not created with I/O enabled");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return io;
|
||||
}
|
||||
|
||||
SDL_IOStream *SDL_GetProcessInputStream(SDL_Process *process)
|
||||
{
|
||||
if (!process) {
|
||||
SDL_InvalidParamError("process");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SDL_IOStream *io = (SDL_IOStream *)SDL_GetPointerProperty(process->props, SDL_PROP_PROCESS_STDIN_POINTER, NULL);
|
||||
if (!io) {
|
||||
SDL_SetError("Process not created with I/O enabled");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return io;
|
||||
}
|
||||
|
||||
SDL_bool SDL_KillProcess(SDL_Process *process, SDL_bool force)
|
||||
{
|
||||
if (!process) {
|
||||
|
||||
Reference in new issue
Block a user