Function sdl2_sys::SDL_RWseek

source ·
pub unsafe extern "C" fn SDL_RWseek(
    context: *mut SDL_RWops,
    offset: Sint64,
    whence: c_int
) -> Sint64
Expand description

Seek within an SDL_RWops data stream.

This function seeks to byte offset, relative to whence.

whence may be any of the following values:

  • RW_SEEK_SET: seek from the beginning of data
  • RW_SEEK_CUR: seek relative to current read point
  • RW_SEEK_END: seek relative to the end of data

If this stream can not seek, it will return -1.

SDL_RWseek() is actually a wrapper function that calls the SDL_RWops’s seek 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 offset an offset in bytes, relative to whence location; can be negative \param whence any of RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END \returns the final offset in the data stream after the seek or -1 on error.

\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_RWtell \sa SDL_RWwrite