.\" 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_RWread: .\" https://wiki.libsdl.org/SDL_RWread .\" Generated with SDL/build-scripts/wikiheaders.pl .\" revision SDL-prerelease-3.0.0-3508-g7c089f4e5 .\" 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_RWread .\" SDL can be found at https://libsdl.org/ .de URL \$2 \(laURL: \$1 \(ra\$3 .. .if \n[.g] .mso www.tmac .TH SDL_RWread 3 "SDL 3.0.0" "SDL" "SDL3 FUNCTIONS" .SH NAME SDL_RWread \- Read from a data source\[char46] .SH SYNOPSIS .nf .B #include \(dqSDL3/SDL.h\(dq .PP .BI "size_t SDL_RWread(SDL_RWops *context, void *ptr, size_t size); .fi .SH DESCRIPTION This function reads up .BR size bytes from the data source to the area pointed at by .BR ptr \[char46] This function may read less bytes than requested\[char46] It will return zero when the data stream is completely read, or -1 on error\[char46] For streams that support non-blocking operation, if nothing was read because it would require blocking, this function returns -2 to distinguish that this is not an error or end-of-file, and the caller can try again later\[char46] .BR SDL_RWread () is actually a function wrapper that calls the .BR SDL_RWops 's .BR read method appropriately, to simplify application development\[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_RWops structure .TP .I ptr a pointer to a buffer to read data into .TP .I size the number of bytes to read from the data source\[char46] .SH RETURN VALUE Returns the number of bytes read, or 0 on end of file or other error\[char46] .SH AVAILABILITY This function is available since SDL 3\[char46]0\[char46]0\[char46] .SH SEE ALSO .BR SDL_RWclose (3), .BR SDL_RWFromConstMem (3), .BR SDL_RWFromFile (3), .BR SDL_RWFromMem (3), .BR SDL_RWseek (3), .BR SDL_RWwrite (3)