42 #define SDL_RWOPS_UNKNOWN 0U 43 #define SDL_RWOPS_WINFILE 1U 44 #define SDL_RWOPS_STDFILE 2U 45 #define SDL_RWOPS_JNIFILE 3U 46 #define SDL_RWOPS_MEMORY 4U 47 #define SDL_RWOPS_MEMORY_RO 5U 52 typedef struct SDL_RWops 57 Sint64 (SDLCALL * size) (
struct SDL_RWops * context);
75 size_t size,
size_t maxnum);
84 size_t size,
size_t num);
96 #if defined(__ANDROID__) 100 void *inputStreamRef;
101 void *readableByteChannelRef;
103 void *assetFileDescriptorRef;
109 #elif defined(__WIN32__) 153 extern DECLSPEC
SDL_RWops *SDLCALL SDL_RWFromFile(
const char *file,
157 extern DECLSPEC
SDL_RWops *SDLCALL SDL_RWFromFP(FILE * fp,
160 extern DECLSPEC
SDL_RWops *SDLCALL SDL_RWFromFP(
void * fp,
164 extern DECLSPEC
SDL_RWops *SDLCALL SDL_RWFromMem(
void *mem,
int size);
165 extern DECLSPEC
SDL_RWops *SDLCALL SDL_RWFromConstMem(
const void *mem,
171 extern DECLSPEC
SDL_RWops *SDLCALL SDL_AllocRW(
void);
172 extern DECLSPEC
void SDLCALL SDL_FreeRW(
SDL_RWops * area);
174 #define RW_SEEK_SET 0 175 #define RW_SEEK_CUR 1 176 #define RW_SEEK_END 2 184 #define SDL_RWsize(ctx) (ctx)->size(ctx) 185 #define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence) 186 #define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR) 187 #define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n) 188 #define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n) 189 #define SDL_RWclose(ctx) (ctx)->close(ctx) 214 #define SDL_LoadFile(file, datasize) SDL_LoadFile_RW(SDL_RWFromFile(file, "rb"), datasize, 1) 222 extern DECLSPEC Uint8 SDLCALL SDL_ReadU8(
SDL_RWops * src);
223 extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(
SDL_RWops * src);
224 extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(
SDL_RWops * src);
225 extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(
SDL_RWops * src);
226 extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(
SDL_RWops * src);
227 extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(
SDL_RWops * src);
228 extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(
SDL_RWops * src);
237 extern DECLSPEC
size_t SDLCALL SDL_WriteU8(
SDL_RWops * dst, Uint8 value);
238 extern DECLSPEC
size_t SDLCALL SDL_WriteLE16(
SDL_RWops * dst, Uint16 value);
239 extern DECLSPEC
size_t SDLCALL SDL_WriteBE16(
SDL_RWops * dst, Uint16 value);
240 extern DECLSPEC
size_t SDLCALL SDL_WriteLE32(
SDL_RWops * dst, Uint32 value);
241 extern DECLSPEC
size_t SDLCALL SDL_WriteBE32(
SDL_RWops * dst, Uint32 value);
242 extern DECLSPEC
size_t SDLCALL SDL_WriteLE64(
SDL_RWops * dst, Uint64 value);
243 extern DECLSPEC
size_t SDLCALL SDL_WriteBE64(
SDL_RWops * dst, Uint64 value);
DECLSPEC void *SDLCALL SDL_LoadFile_RW(SDL_RWops *src, size_t *datasize, int freesrc)
size_t(SDLCALL *read)(struct SDL_RWops *context
struct SDL_RWops SDL_RWops
Sint64(SDLCALL *size)(struct SDL_RWops *context)
int(SDLCALL *close)(struct SDL_RWops *context)
Definition: SDL_rwops.h:52