diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-03-29 22:41:26 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-03-29 22:41:26 +0300 |
commit | 8f95378c3be89c06c722da03ddbd3641c4fc2323 (patch) | |
tree | 4f1c14fb0ba57793f8979df43ffd293533606e1b /src/fs/virtfs/virtfsrwops.h | |
parent | fc31f1003bec7e0117421a8c58668e61849eeba5 (diff) | |
download | mv-8f95378c3be89c06c722da03ddbd3641c4fc2323.tar.gz mv-8f95378c3be89c06c722da03ddbd3641c4fc2323.tar.bz2 mv-8f95378c3be89c06c722da03ddbd3641c4fc2323.tar.xz mv-8f95378c3be89c06c722da03ddbd3641c4fc2323.zip |
Move rwops code into virtfs namespace.
Diffstat (limited to 'src/fs/virtfs/virtfsrwops.h')
-rw-r--r-- | src/fs/virtfs/virtfsrwops.h | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/src/fs/virtfs/virtfsrwops.h b/src/fs/virtfs/virtfsrwops.h index 56fda969d..46d5acca0 100644 --- a/src/fs/virtfs/virtfsrwops.h +++ b/src/fs/virtfs/virtfsrwops.h @@ -50,15 +50,40 @@ #include <string> #include <SDL_rwops.h> +#ifdef USE_SDL2 +#define RWOPSINT int64_t +#define RWOPSSIZE size_t +#else // USE_SDL2 +#define RWOPSINT int32_t +#define RWOPSSIZE int +#endif // USE_SDL2 + struct VirtFile; namespace VirtFs { - SDL_RWops *RWopsOpenRead(const std::string &restrict fname); - SDL_RWops *RWopsOpenWrite(const std::string &restrict fname) A_WARN_UNUSED; - SDL_RWops *RWopsOpenAppend(const std::string &restrict fname) + SDL_RWops *create_rwops(VirtFile *const file); + RWOPSINT rwops_seek(SDL_RWops *const rw, + const RWOPSINT offset, + const int whence); + RWOPSSIZE rwops_read(SDL_RWops *const rw, + void *const ptr, + const RWOPSSIZE size, + const RWOPSSIZE maxnum); + RWOPSSIZE rwops_write(SDL_RWops *const rw, + const void *const ptr, + const RWOPSSIZE size, + const RWOPSSIZE num); + int rwops_close(SDL_RWops *const rw); +#ifdef USE_SDL2 + RWOPSINT rwops_size(SDL_RWops *const rw); +#endif // USE_SDL2 + + SDL_RWops *rwopsOpenRead(const std::string &restrict fname); + SDL_RWops *rwopsOpenWrite(const std::string &restrict fname) A_WARN_UNUSED; + SDL_RWops *rwopsOpenAppend(const std::string &restrict fname) A_WARN_UNUSED; - SDL_RWops *MakeRWops(VirtFile *const handle) A_WARN_UNUSED; + SDL_RWops *makeRwops(VirtFile *const handle) A_WARN_UNUSED; } // namespace VirtFs #endif // SRC_FS_VIRTFSRWOPS_H |