summaryrefslogtreecommitdiff
path: root/src/utils/virtfs.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-02-11 17:13:02 +0300
committerAndrei Karas <akaras@inbox.ru>2017-02-11 17:44:15 +0300
commitf978c1bed85961e102951340669ca873328bcef3 (patch)
treee7f67d2806f72cccc028be95f3c3e00679368d20 /src/utils/virtfs.h
parent083160ca5bdc366e4849c1f73e718531250a9e7c (diff)
downloadmanaverse-f978c1bed85961e102951340669ca873328bcef3.tar.gz
manaverse-f978c1bed85961e102951340669ca873328bcef3.tar.bz2
manaverse-f978c1bed85961e102951340669ca873328bcef3.tar.xz
manaverse-f978c1bed85961e102951340669ca873328bcef3.zip
Add VirtFile struct and replace all Phyfs_file usage to this struct.
Diffstat (limited to 'src/utils/virtfs.h')
-rw-r--r--src/utils/virtfs.h29
1 files changed, 13 insertions, 16 deletions
diff --git a/src/utils/virtfs.h b/src/utils/virtfs.h
index 66149c903..e2db24e44 100644
--- a/src/utils/virtfs.h
+++ b/src/utils/virtfs.h
@@ -23,13 +23,10 @@
#include "localconsts.h"
-PRAGMA45(GCC diagnostic push)
-PRAGMA45(GCC diagnostic ignored "-Wlong-long")
-#include <physfs.h>
-PRAGMA45(GCC diagnostic pop)
-
#include <string>
+struct VirtFile;
+
namespace VirtFs
{
void init(const char *const name);
@@ -41,9 +38,9 @@ namespace VirtFs
char **enumerateFiles(const char *const dir);
bool isDirectory(const char *const fname);
void freeList(void *const listVar);
- PHYSFS_file *openRead(const char *const filename);
- PHYSFS_file *openWrite(const char *const filename);
- PHYSFS_file *openAppend(const char *const filename);
+ VirtFile *openRead(const char *const filename);
+ VirtFile *openWrite(const char *const filename);
+ VirtFile *openAppend(const char *const filename);
bool setWriteDir(const char *const newDir);
bool addToSearchPath(const char *const newDir, const int appendToPath);
bool removeFromSearchPath(const char *const oldDir);
@@ -53,21 +50,21 @@ namespace VirtFs
bool deinit();
void permitLinks(const bool val);
const char *getLastError();
- int64_t read(PHYSFS_File *const handle,
+ int64_t read(VirtFile *const handle,
void *const buffer,
const uint32_t objSize,
const uint32_t objCount);
- int64_t write(PHYSFS_File *const file,
+ int64_t write(VirtFile *const file,
const void *const buffer,
const uint32_t objSize,
const uint32_t objCount);
- int close(PHYSFS_file *const file);
- int64_t fileLength(PHYSFS_File *const file);
- int64_t tell(PHYSFS_File *const file);
- int seek(PHYSFS_File *const file,
+ int close(VirtFile *const file);
+ int64_t fileLength(VirtFile *const file);
+ int64_t tell(VirtFile *const file);
+ int seek(VirtFile *const file,
const uint64_t pos);
- int eof(PHYSFS_File *const file);
-} // namespace PhysFs
+ int eof(VirtFile *const file);
+} // namespace VirtFs
extern const char *dirSeparator;