| | |
| | | /* |
| | | Simple DirectMedia Layer |
| | | Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org> |
| | | Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org> |
| | | |
| | | This software is provided 'as-is', without any express or implied |
| | | warranty. In no event will the authors be held liable for any damages |
| | |
| | | * |
| | | * Functions to create SDL_RWops structures from various data streams. |
| | | */ |
| | | /*@{*/ |
| | | /* @{ */ |
| | | |
| | | extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFile(const char *file, |
| | | const char *mode); |
| | |
| | | extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromConstMem(const void *mem, |
| | | int size); |
| | | |
| | | /*@}*//*RWFrom functions*/ |
| | | /* @} *//* RWFrom functions */ |
| | | |
| | | |
| | | extern DECLSPEC SDL_RWops *SDLCALL SDL_AllocRW(void); |
| | |
| | | * |
| | | * Macros to easily read and write from an SDL_RWops structure. |
| | | */ |
| | | /*@{*/ |
| | | /* @{ */ |
| | | #define SDL_RWsize(ctx) (ctx)->size(ctx) |
| | | #define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence) |
| | | #define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR) |
| | | #define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n) |
| | | #define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n) |
| | | #define SDL_RWclose(ctx) (ctx)->close(ctx) |
| | | /*@}*//*Read/write macros*/ |
| | | /* @} *//* Read/write macros */ |
| | | |
| | | |
| | | /** |
| | |
| | | * |
| | | * Read an item of the specified endianness and return in native format. |
| | | */ |
| | | /*@{*/ |
| | | /* @{ */ |
| | | extern DECLSPEC Uint8 SDLCALL SDL_ReadU8(SDL_RWops * src); |
| | | extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops * src); |
| | | extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops * src); |
| | |
| | | extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops * src); |
| | | extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops * src); |
| | | extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops * src); |
| | | /*@}*//*Read endian functions*/ |
| | | /* @} *//* Read endian functions */ |
| | | |
| | | /** |
| | | * \name Write endian functions |
| | | * |
| | | * Write an item of native format to the specified endianness. |
| | | */ |
| | | /*@{*/ |
| | | /* @{ */ |
| | | extern DECLSPEC size_t SDLCALL SDL_WriteU8(SDL_RWops * dst, Uint8 value); |
| | | extern DECLSPEC size_t SDLCALL SDL_WriteLE16(SDL_RWops * dst, Uint16 value); |
| | | extern DECLSPEC size_t SDLCALL SDL_WriteBE16(SDL_RWops * dst, Uint16 value); |
| | |
| | | extern DECLSPEC size_t SDLCALL SDL_WriteBE32(SDL_RWops * dst, Uint32 value); |
| | | extern DECLSPEC size_t SDLCALL SDL_WriteLE64(SDL_RWops * dst, Uint64 value); |
| | | extern DECLSPEC size_t SDLCALL SDL_WriteBE64(SDL_RWops * dst, Uint64 value); |
| | | /*@}*//*Write endian functions*/ |
| | | /* @} *//* Write endian functions */ |
| | | |
| | | |
| | | /* Ends C function definitions when using C++ */ |