Function sdl2_sys::SDL_RWwrite
source · pub unsafe extern "C" fn SDL_RWwrite(
context: *mut SDL_RWops,
ptr: *const c_void,
size: usize,
num: usize,
) -> usize
Expand description
Write to an SDL_RWops data stream.
This function writes exactly num
objects each of size size
from the
area pointed at by ptr
to the stream. If this fails for any reason, it’ll
return less than num
to demonstrate how far the write progressed. On
success, it returns num
.
SDL_RWwrite is actually a function wrapper that calls the SDL_RWops’s
write
method appropriately, to simplify application development.
Prior to SDL 2.0.10, this function was a macro.
\param context a pointer to an SDL_RWops structure \param ptr a pointer to a buffer containing data to write \param size the size of an object to write, in bytes \param num the number of objects to write \returns the number of objects written, which will be less than num on error; call SDL_GetError() for more information.
\since This function is available since SDL 2.0.10.
\sa SDL_RWclose \sa SDL_RWFromConstMem \sa SDL_RWFromFile \sa SDL_RWFromFP \sa SDL_RWFromMem \sa SDL_RWread \sa SDL_RWseek