module lib.sdl2.rwops
Code Map
module lib.sdl2.rwops;
enum SDL_RWOPS_UNKNOWN;
enum SDL_RWOPS_WINFILE;
enum SDL_RWOPS_STDFILE;
enum SDL_RWOPS_JNIFILE;
enum SDL_RWOPS_MEMORY;
enum SDL_RWOPS_MEMORY_RO;
//! Seek from the beginning of data *
enum RW_SEEK_SET;
//! Seek relative to current read point *
enum RW_SEEK_CUR;
//! Seek relative to the end of data *
enum RW_SEEK_END;
//! This is the read/write operation structure -- very basic.
struct SDL_RWops
{
public:
size: fn (SDL_RWops*) (Sint64);
seek: fn (SDL_RWops*, Sint64, i32) (Sint64);
read: fn (SDL_RWops*, void*, size_t, size_t) (size_t);
write: fn (SDL_RWops*, const(void)*, size_t, size_t) (size_t);
close: fn (SDL_RWops*) (i32);
type: Uint32;
a: void*;
b: void*;
c: void*;
}
//! \name RWFrom functions
fn SDL_RWFromFile(file: const(const(char)*), mode: const(const(char)*)) SDL_RWops*;
fn SDL_RWFromFP(fp: FILE*, autoclose: SDL_bool) SDL_RWops*;
fn SDL_RWFromMem(mem: void*, size: i32) SDL_RWops*;
fn SDL_RWFromConstMem(mem: const(const(void)*), size: i32) SDL_RWops*;
fn SDL_AllocRW() SDL_RWops*;
fn SDL_FreeRW(area: SDL_RWops*);
//! \name Read/write macros
fn SDL_ReadU8(src: SDL_RWops*) Uint8;
fn SDL_ReadLE16(src: SDL_RWops*) Uint16;
fn SDL_ReadBE16(src: SDL_RWops*) Uint16;
fn SDL_ReadLE32(src: SDL_RWops*) Uint32;
fn SDL_ReadBE32(src: SDL_RWops*) Uint32;
fn SDL_ReadLE64(src: SDL_RWops*) Uint64;
fn SDL_ReadBE64(src: SDL_RWops*) Uint64;
//! \name Write endian functions
fn SDL_WriteU8(dst: SDL_RWops*, value: Uint8) size_t;
fn SDL_WriteLE16(dst: SDL_RWops*, value: Uint16) size_t;
fn SDL_WriteBE16(dst: SDL_RWops*, value: Uint16) size_t;
fn SDL_WriteLE32(dst: SDL_RWops*, value: Uint32) size_t;
fn SDL_WriteBE32(dst: SDL_RWops*, value: Uint32) size_t;
fn SDL_WriteLE64(dst: SDL_RWops*, value: Uint64) size_t;
fn SDL_WriteBE64(dst: SDL_RWops*, value: Uint64) size_t;
struct SDL_RWops
This is the read/write operation structure -- very basic.
fn SDL_RWFromFile(file: const(const(char)*), mode: const(const(char)*)) SDL_RWops*
\name RWFrom functions
Functions to create SDL_RWops structures from various data streams.
enum RW_SEEK_SET
Seek from the beginning of data *
enum RW_SEEK_CUR
Seek relative to current read point *
enum RW_SEEK_END
Seek relative to the end of data *
fn SDL_ReadU8(src: SDL_RWops*) Uint8
\name Read/write macros
Macros to easily read and write from an SDL_RWops structure.
\name Read endian functions
Read an item of the specified endianness and return in native format.
fn SDL_WriteU8(dst: SDL_RWops*, value: Uint8) size_t
\name Write endian functions
Write an item of native format to the specified endianness.