sig
type t
external from_mem : bytes -> Sdlrwops.t = "caml_SDL_RWFromMem"
external from_const_mem : string -> Sdlrwops.t = "caml_SDL_RWFromConstMem"
external from_file : filename:string -> mode:string -> Sdlrwops.t
= "caml_SDL_RWFromFile"
type input = [ `Buffer of bytes | `Filename of string | `String of string ]
val from_input :
[< `Buffer of bytes | `Filename of string | `String of string ] ->
Sdlrwops.t
val from_input_opt :
[> `Buffer of bytes | `Filename of string | `String of string ] ->
Sdlrwops.t option
external alloc : unit -> Sdlrwops.t = "caml_SDL_AllocRW"
external free : Sdlrwops.t -> unit = "caml_SDL_FreeRW"
external close : Sdlrwops.t -> unit = "caml_SDL_CloseRW"
external size : Sdlrwops.t -> int64 = "caml_SDL_RWsize"
type seek = SEEK_SET | SEEK_CUR | SEEK_END
external seek : Sdlrwops.t -> offset:int64 -> Sdlrwops.seek -> int64
= "caml_SDL_RWseek"
external tell : Sdlrwops.t -> int64 = "caml_SDL_RWtell"
type uint8 = int
type uint16 = int
type uint32 = int32
type uint64 = int64
external readU8 : Sdlrwops.t -> Sdlrwops.uint8 = "caml_SDL_ReadU8"
external writeU8 : Sdlrwops.t -> Sdlrwops.uint8 -> unit
= "caml_SDL_WriteU8"
module BigEndian :
sig
external read16 : Sdlrwops.t -> Sdlrwops.uint16 = "caml_SDL_ReadBE16"
external read32 : Sdlrwops.t -> Sdlrwops.uint32 = "caml_SDL_ReadBE32"
external read64 : Sdlrwops.t -> Sdlrwops.uint64 = "caml_SDL_ReadBE64"
external write16 : Sdlrwops.t -> Sdlrwops.uint16 -> unit
= "caml_SDL_WriteBE16"
external write32 : Sdlrwops.t -> Sdlrwops.uint32 -> unit
= "caml_SDL_WriteBE32"
external write64 : Sdlrwops.t -> Sdlrwops.uint64 -> unit
= "caml_SDL_WriteBE64"
end
module LittleEndian :
sig
external read16 : Sdlrwops.t -> Sdlrwops.uint16 = "caml_SDL_ReadLE16"
external read32 : Sdlrwops.t -> Sdlrwops.uint32 = "caml_SDL_ReadLE32"
external read64 : Sdlrwops.t -> Sdlrwops.uint64 = "caml_SDL_ReadLE64"
external write16 : Sdlrwops.t -> Sdlrwops.uint16 -> unit
= "caml_SDL_WriteLE16"
external write32 : Sdlrwops.t -> Sdlrwops.uint32 -> unit
= "caml_SDL_WriteLE32"
external write64 : Sdlrwops.t -> Sdlrwops.uint64 -> unit
= "caml_SDL_WriteLE64"
end
end