.\" This manpage content is licensed under Creative Commons .\" Attribution 4.0 International (CC BY 4.0) .\" https://creativecommons.org/licenses/by/4.0/ .\" This manpage was generated from SDL's wiki page for SDL_WriteIO: .\" https://wiki.libsdl.org/SDL_WriteIO .\" Generated with SDL/build-scripts/wikiheaders.pl .\" revision SDL-3.1.0 .\" Please report issues in this manpage's content at: .\" https://github.com/libsdl-org/sdlwiki/issues/new .\" Please report issues in the generation of this manpage from the wiki at: .\" https://github.com/libsdl-org/SDL/issues/new?title=Misgenerated%20manpage%20for%20SDL_WriteIO .\" SDL can be found at https://libsdl.org/ .de URL \$2 \(laURL: \$1 \(ra\$3 .. .if \n[.g] .mso www.tmac .TH SDL_WriteIO 3 "SDL 3.1.0" "SDL" "SDL3 FUNCTIONS" .SH NAME SDL_WriteIO \- Write to an .BR SDL_IOStream data stream\[char46] .SH SYNOPSIS .nf .B #include \(dqSDL3/SDL.h\(dq .PP .BI "size_t SDL_WriteIO(SDL_IOStream *context, const void *ptr, size_t size); .fi .SH DESCRIPTION This function writes exactly .BR size bytes from the area pointed at by .BR ptr to the stream\[char46] If this fails for any reason, it'll return less than .BR size to demonstrate how far the write progressed\[char46] On success, it returns .BR num \[char46] On error, this function still attempts to write as much as possible, so it might return a positive value less than the requested write size\[char46] If the function failed to write anything and there was an actual error, it will return -1\[char46] For streams that support non-blocking operation, if nothing was written because it would require blocking, this function returns -2 to distinguish that this is not an error and the caller can try again later\[char46] It is an error to specify a negative .BR size , but this parameter is signed so you definitely cannot overflow the return value on a successful run with enormous amounts of data\[char46] .SH FUNCTION PARAMETERS .TP .I context a pointer to an .BR SDL_IOStream structure .TP .I ptr a pointer to a buffer containing data to write .TP .I size the number of bytes to write .SH RETURN VALUE Returns the number of bytes written, which will be less than .BR num on error; call .BR SDL_GetError () for more information\[char46] .SH AVAILABILITY This function is available since SDL 3\[char46]0\[char46]0\[char46] .SH SEE ALSO .BR SDL_IOprintf (3), .BR SDL_ReadIO (3), .BR SDL_SeekIO (3)