SDL  2.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)
 
size_t(* read )(struct SDL_RWops *context, void *ptr, size_t size, size_t maxnum)
 
size_t(* write )(struct SDL_RWops *context, const void *ptr, size_t size, size_t num)
 
int(* close )(struct SDL_RWops *context)
 
Uint32 type
 
union {
   struct {
      SDL_bool   append
 
      void *   h
 
      struct {
         void *   data
 
         size_t   size
 
         size_t   left
 
      }   buffer
 
   }   windowsio
 
   struct {
      SDL_bool   autoclose
 
      FILE *   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

◆ append

SDL_bool SDL_RWops::append

Definition at line 112 of file SDL_rwops.h.

◆ autoclose

SDL_bool SDL_RWops::autoclose

Definition at line 126 of file SDL_rwops.h.

◆ base

Uint8* SDL_RWops::base

Definition at line 132 of file SDL_rwops.h.

◆ buffer

struct { ... } SDL_RWops::buffer

◆ 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 91 of file SDL_rwops.h.

Referenced by main(), rwops_error_quit(), SDL_RWFromConstMem(), SDL_RWFromFile(), and SDL_RWFromMem().

◆ data

void* SDL_RWops::data

Definition at line 116 of file SDL_rwops.h.

◆ data1

void* SDL_RWops::data1

Definition at line 138 of file SDL_rwops.h.

◆ data2

void* SDL_RWops::data2

Definition at line 139 of file SDL_rwops.h.

◆ fp

FILE* SDL_RWops::fp

Definition at line 127 of file SDL_rwops.h.

◆ h

void* SDL_RWops::h

Definition at line 113 of file SDL_rwops.h.

◆ here

Uint8* SDL_RWops::here

Definition at line 133 of file SDL_rwops.h.

◆ hidden

union { ... } SDL_RWops::hidden

◆ left

size_t SDL_RWops::left

Definition at line 118 of file SDL_rwops.h.

◆ mem

struct { ... } SDL_RWops::mem

◆ read

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

Read up to maxnum objects each of size size from the data stream to the area pointed at by ptr.

Returns
the number of objects read, or 0 at error or end of file.

Definition at line 74 of file SDL_rwops.h.

Referenced by main(), SDL_RWFromConstMem(), SDL_RWFromFile(), and SDL_RWFromMem().

◆ 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: RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END

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

Definition at line 65 of file SDL_rwops.h.

Referenced by main(), SDL_RWFromConstMem(), SDL_RWFromFile(), and SDL_RWFromMem().

◆ size [1/2]

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.

Referenced by SDL_RWFromConstMem(), SDL_RWFromFile(), and SDL_RWFromMem().

◆ size [2/2]

size_t SDL_RWops::size

Definition at line 117 of file SDL_rwops.h.

◆ stdio

struct { ... } SDL_RWops::stdio

Referenced by SDL_RWFromFile().

◆ stop

Uint8* SDL_RWops::stop

Definition at line 134 of file SDL_rwops.h.

◆ type

◆ unknown

struct { ... } SDL_RWops::unknown

◆ windowsio

struct { ... } SDL_RWops::windowsio

◆ write

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

Write exactly num objects each of size size from the area pointed at by ptr to data stream.

Returns
the number of objects written, or 0 at error or end of file.

Definition at line 83 of file SDL_rwops.h.

Referenced by main(), SDL_RWFromConstMem(), SDL_RWFromFile(), and SDL_RWFromMem().


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