SDL 3.0
SDL_RWops Struct Reference

#include <SDL_rwops.h>

Data Fields

Sint64(* size )(struct SDL_RWops *context)
 
Sint64(* seek )(struct SDL_RWops *context, Sint64 offset, int whence)
 
Sint64(* read )(struct SDL_RWops *context, void *ptr, Sint64 size)
 
Sint64(* write )(struct SDL_RWops *context, const void *ptr, Sint64 size)
 
int(* close )(struct SDL_RWops *context)
 
Uint32 type
 
union {
   struct {
      SDL_bool   autoclose
 
      void *   fp
 
   }   stdio
 
   struct {
      Uint8 *   base
 
      Uint8 *   here
 
      Uint8 *   stop
 
   }   mem
 
   struct {
      void *   data1
 
      void *   data2
 
   }   unknown
 
hidden
 

Detailed Description

This is the read/write operation structure – very basic.

Definition at line 52 of file SDL_rwops.h.

Field Documentation

◆ autoclose

SDL_bool SDL_RWops::autoclose

Definition at line 128 of file SDL_rwops.h.

◆ base

Uint8* SDL_RWops::base

Definition at line 134 of file SDL_rwops.h.

◆ close

int(* SDL_RWops::close) (struct SDL_RWops *context)

Close and free an allocated SDL_RWops structure.

Returns
0 if successful or -1 on write error when flushing data.

Definition at line 101 of file SDL_rwops.h.

◆ data1

void* SDL_RWops::data1

Definition at line 141 of file SDL_rwops.h.

◆ data2

void* SDL_RWops::data2

Definition at line 142 of file SDL_rwops.h.

◆ fp

void* SDL_RWops::fp

Definition at line 129 of file SDL_rwops.h.

◆ here

Uint8* SDL_RWops::here

Definition at line 135 of file SDL_rwops.h.

◆ 

union { ... } SDL_RWops::hidden

◆ 

struct { ... } SDL_RWops::mem

◆ read

Sint64(* SDL_RWops::read) (struct SDL_RWops *context, void *ptr, Sint64 size)

Read up to size bytes from the data stream to the area pointed at by ptr.

It is an error to use a negative size, but this parameter is signed so you definitely cannot overflow the return value on a successful run with enormous amounts of data.

Returns
the number of objects read, or 0 on end of file, or -1 on error.

Definition at line 78 of file SDL_rwops.h.

◆ seek

Sint64(* SDL_RWops::seek) (struct SDL_RWops *context, Sint64 offset, int whence)

Seek to offset relative to whence, one of stdio's whence values: SDL_RW_SEEK_SET, SDL_RW_SEEK_CUR, SDL_RW_SEEK_END

Returns
the final offset in the data stream, or -1 on error.

Definition at line 65 of file SDL_rwops.h.

◆ size

Sint64(* SDL_RWops::size) (struct SDL_RWops *context)

Return the size of the file in this rwops, or -1 if unknown

Definition at line 57 of file SDL_rwops.h.

◆ 

struct { ... } SDL_RWops::stdio

◆ stop

Uint8* SDL_RWops::stop

Definition at line 136 of file SDL_rwops.h.

◆ type

Uint32 SDL_RWops::type

Definition at line 103 of file SDL_rwops.h.

◆ 

struct { ... } SDL_RWops::unknown

◆ write

Sint64(* SDL_RWops::write) (struct SDL_RWops *context, const void *ptr, Sint64 size)

Write exactly size bytes from the area pointed at by ptr to data stream. May write less than requested (error, non-blocking i/o, etc). Returns -1 on error when nothing was written.

It is an error to use a negative size, but this parameter is signed so you definitely cannot overflow the return value on a successful run with enormous amounts of data.

Returns
the number of bytes written, which might be less than size, and -1 on error.

Definition at line 93 of file SDL_rwops.h.


The documentation for this struct was generated from the following file: