SDL_GetProcessInput(3)
π SDL_GetProcessInput β the SDL3 functions era π
okay bestie, we're in the SDL3 FUNCTIONS section of the manual and this one is genuinely a little cutie. let's get into it π«Ά
β¨ NAME β¨
SDL_GetProcessInput β grab the SDL_IOStream that's wired up to a process's standard input. like, the little tube you yell into so the process hears you π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_process.h>
SDL_IOStream * SDL_GetProcessInput(SDL_Process *process);
π DESCRIPTION π
so here's the vibe check first, because there's a prerequisite and she is not optional:
the process has to have been made either
- with
SDL_CreateProcess()andpipe_stdioset totrue, or - with
SDL_CreateProcessWithProperties()andSDL_PROP_PROCESS_CREATE_STDIN_NUMBERset toSDL_PROCESS_STDIO_APP.
no cap, if you didn't set that up, this function is giving nothing.
now the messy part, and lowkey it's the thing that gets everyone π β writing to this stream can return less data than you expected if the process hasn't read its input yet. why? because the process might be blocked, sitting there waiting for its output to be read. mutual standoff energy fr fr π
so if that's happening, you may need to call SDL_GetProcessOutput() and read the output in parallel with writing input. yes, at the same time. iconic multitasking, that's the assignment π
π FUNCTION PARAMETERS π
processβ the process you want the input stream for. your main character. the one you're feeding π
π¦ RETURN VALUE π¦
returns the input stream, or NULL on failure π β and if you get that NULL, call SDL_GetError() for more information. she will tell you what went wrong, just ask her π
π₯ THREAD SAFETY π₯
it is safe to call this function from any thread. go wild, bestie, every thread gets a turn β¨
β AVAILABILITY β
this function is available since SDL 3.2.0. so if you're on something older... nope, not for you π
π SEE ALSO π
and that's the whole page, bestie! no crumbs left π
ok final sign-off: this lil masterpiece comes to you from Simple Directmedia Layer, and the version riding shotgun is SDL 3.4.18. that's the source, that's the version, that's the whole footer moment β periodt π β¨π§
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms