From 8f95378c3be89c06c722da03ddbd3641c4fc2323 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 29 Mar 2017 22:41:26 +0300 Subject: Move rwops code into virtfs namespace. --- src/fs/virtfs/virtfsrwops.h | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) (limited to 'src/fs/virtfs/virtfsrwops.h') 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 #include +#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 -- cgit v1.2.3-70-g09d2