SDL_RWops functions

I can’t find any good documentation on SDL_RWops structures. Does anyone know what the return values of the Read, Write, and Seek functions represent?

From the header file:

/* Seek to 'offset' relative to whence, one of stdio's whence

values:
SEEK_SET, SEEK_CUR, SEEK_END
Returns the final offset in the data source.
*/
int (SDLCALL *seek)(struct SDL_RWops *context, int offset, int
whence);

/* Read up to 'num' objects each of size 'objsize' from the data
   source to the area pointed at by 'ptr'.
   Returns the number of objects read, or -1 if the read failed.
 */
int (SDLCALL *read)(struct SDL_RWops *context, void *ptr, int size,

int maxnum);

/* Write exactly 'num' objects each of size 'objsize' from the area
   pointed at by 'ptr' to data source.
   Returns 'num', or -1 if the write failed.
 */
int (SDLCALL *write)(struct SDL_RWops *context, const void *ptr, int

size, int num);

Ken Rogoway
Homebrew Software
http://www.homebrewsoftware.com/> ----- Original Message -----

From: sdl-bounces@lists.libsdl.org [mailto:sdl-bounces at lists.libsdl.org] On
Behalf Of Mason Wheeler
Sent: Saturday, April 19, 2008 9:48 PM
To: sdl at lists.libsdl.org
Subject: [SDL] SDL_RWops functions

I can’t find any good documentation on SDL_RWops structures. Does anyone
know what the return values of the Read, Write, and Seek functions
represent?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

No virus found in this incoming message.
Checked by AVG.
Version: 7.5.524 / Virus Database: 269.23.2/1387 - Release Date: 4/19/2008
11:31 AM

No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.524 / Virus Database: 269.23.2/1387 - Release Date: 4/19/2008
11:31 AM