|
|
@@ -175,6 +175,14 @@ typedef struct __PHYSFS_DIRFUNCTIONS__
|
|
|
*/
|
|
|
int (*isSymLink)(DirHandle *r, const char *name);
|
|
|
|
|
|
+ /*
|
|
|
+ * Retrieve the last modification time (mtime) of a file.
|
|
|
+ * Returns -1 on failure, or the file's mtime in seconds since
|
|
|
+ * the epoch (Jan 1, 1970) on success.
|
|
|
+ * This filename is in platform-independent notation.
|
|
|
+ */
|
|
|
+ PHYSFS_sint64 (*getLastModTime)(DirHandle *r, const char *filename);
|
|
|
+
|
|
|
/*
|
|
|
* Open file for reading, and return a FileHandle.
|
|
|
* This filename is in platform-independent notation.
|
|
|
@@ -267,6 +275,7 @@ typedef struct __PHYSFS_DIRFUNCTIONS__
|
|
|
#define ERR_NOT_A_DIR "Not a directory"
|
|
|
#define ERR_FILE_NOT_FOUND "File not found"
|
|
|
|
|
|
+
|
|
|
/*
|
|
|
* Call this to set the message returned by PHYSFS_getLastError().
|
|
|
* Please only use the ERR_* constants above, or add new constants to the
|
|
|
@@ -343,6 +352,7 @@ extern const char *__PHYSFS_platformDirSeparator;
|
|
|
*/
|
|
|
int __PHYSFS_platformInit(void);
|
|
|
|
|
|
+
|
|
|
/*
|
|
|
* Deinitialize the platform. This is called when PHYSFS_deinit() is called
|
|
|
* from the application. You can use this to clean up anything you've
|
|
|
@@ -353,6 +363,7 @@ int __PHYSFS_platformInit(void);
|
|
|
*/
|
|
|
int __PHYSFS_platformDeinit(void);
|
|
|
|
|
|
+
|
|
|
/*
|
|
|
* Open a file for reading. (filename) is in platform-dependent notation. The
|
|
|
* file pointer should be positioned on the first byte of the file.
|
|
|
@@ -368,6 +379,7 @@ int __PHYSFS_platformDeinit(void);
|
|
|
*/
|
|
|
void *__PHYSFS_platformOpenRead(const char *filename);
|
|
|
|
|
|
+
|
|
|
/*
|
|
|
* Open a file for writing. (filename) is in platform-dependent notation. If
|
|
|
* the file exists, it should be truncated to zero bytes, and if it doesn't
|
|
|
@@ -384,6 +396,7 @@ void *__PHYSFS_platformOpenRead(const char *filename);
|
|
|
*/
|
|
|
void *__PHYSFS_platformOpenWrite(const char *filename);
|
|
|
|
|
|
+
|
|
|
/*
|
|
|
* Open a file for appending. (filename) is in platform-dependent notation. If
|
|
|
* the file exists, the file pointer should be place just past the end of the
|
|
|
@@ -401,6 +414,7 @@ void *__PHYSFS_platformOpenWrite(const char *filename);
|
|
|
*/
|
|
|
void *__PHYSFS_platformOpenAppend(const char *filename);
|
|
|
|
|
|
+
|
|
|
/*
|
|
|
* Read more data from a platform-specific file handle. (opaque) should be
|
|
|
* cast to whatever data type your platform uses. Read a maximum of (count)
|
|
|
@@ -441,6 +455,7 @@ PHYSFS_sint64 __PHYSFS_platformWrite(void *opaque, const void *buffer,
|
|
|
*/
|
|
|
int __PHYSFS_platformSeek(void *opaque, PHYSFS_uint64 pos);
|
|
|
|
|
|
+
|
|
|
/*
|
|
|
* Get the file pointer's position, in an 8-bit byte offset from the start of
|
|
|
* the file. (opaque) should be cast to whatever data type your platform
|
|
|
@@ -453,6 +468,7 @@ int __PHYSFS_platformSeek(void *opaque, PHYSFS_uint64 pos);
|
|
|
*/
|
|
|
PHYSFS_sint64 __PHYSFS_platformTell(void *opaque);
|
|
|
|
|
|
+
|
|
|
/*
|
|
|
* Determine the current size of a file, in 8-bit bytes, from an open file.
|
|
|
*
|
|
|
@@ -543,11 +559,21 @@ int __PHYSFS_platformStricmp(const char *str1, const char *str2);
|
|
|
*/
|
|
|
int __PHYSFS_platformExists(const char *fname);
|
|
|
|
|
|
+/*
|
|
|
+ * Return the last modified time (in seconds since the epoch) of a file.
|
|
|
+ * Returns -1 on failure. (fname) is in platform-dependent notation.
|
|
|
+ * Symlinks should be followed; if what the symlink points to is missing,
|
|
|
+ * then the retval is -1.
|
|
|
+ */
|
|
|
+PHYSFS_sint64 __PHYSFS_platformGetLastModTime(const char *fname);
|
|
|
+
|
|
|
+
|
|
|
/*
|
|
|
* Return non-zero if filename (in platform-dependent notation) is a symlink.
|
|
|
*/
|
|
|
int __PHYSFS_platformIsSymLink(const char *fname);
|
|
|
|
|
|
+
|
|
|
/*
|
|
|
* Return non-zero if filename (in platform-dependent notation) is a symlink.
|
|
|
* Symlinks should be followed; if what the symlink points to is missing,
|
|
|
@@ -555,6 +581,7 @@ int __PHYSFS_platformIsSymLink(const char *fname);
|
|
|
*/
|
|
|
int __PHYSFS_platformIsDirectory(const char *fname);
|
|
|
|
|
|
+
|
|
|
/*
|
|
|
* Convert (dirName) to platform-dependent notation, then prepend (prepend)
|
|
|
* and append (append) to the converted string.
|
|
|
@@ -577,6 +604,7 @@ char *__PHYSFS_platformCvtToDependent(const char *prepend,
|
|
|
const char *dirName,
|
|
|
const char *append);
|
|
|
|
|
|
+
|
|
|
/*
|
|
|
* Make the current thread give up a timeslice. This is called in a loop
|
|
|
* while waiting for various external forces to get back to us.
|
|
|
@@ -626,6 +654,7 @@ char *__PHYSFS_platformRealPath(const char *path);
|
|
|
*/
|
|
|
int __PHYSFS_platformMkDir(const char *path);
|
|
|
|
|
|
+
|
|
|
/*
|
|
|
* Remove a file or directory entry in the actual filesystem. (path) is
|
|
|
* specified in platform-dependent notation. Note that this deletes files
|