summaryrefslogtreecommitdiff
path: root/src/common/utils.c
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-12-26 22:36:41 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-12-26 22:36:41 +0000
commit6096ce0b42a3eee07dc70ae5ef489aa4c30bf515 (patch)
treee91f8afd3b7b8b80f0c55aae07f7a478f469c37a /src/common/utils.c
parent23e1b7db5ba2277a406fc84c30e87c324a83097c (diff)
downloadhercules-6096ce0b42a3eee07dc70ae5ef489aa4c30bf515.tar.gz
hercules-6096ce0b42a3eee07dc70ae5ef489aa4c30bf515.tar.bz2
hercules-6096ce0b42a3eee07dc70ae5ef489aa4c30bf515.tar.xz
hercules-6096ce0b42a3eee07dc70ae5ef489aa4c30bf515.zip
* Merged changes from trunk [14496:14630/trunk].
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/renewal@14632 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/utils.c')
-rw-r--r--src/common/utils.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/common/utils.c b/src/common/utils.c
index c1128edb4..12123784f 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -14,7 +14,11 @@
#include <math.h> // floor()
#ifdef WIN32
+ #include <io.h>
#include <windows.h>
+ #ifndef F_OK
+ #define F_OK 0x0
+ #endif /* F_OK */
#else
#include <unistd.h>
#include <dirent.h>
@@ -182,6 +186,11 @@ void findfile(const char *p, const char *pat, void (func)(const char*))
}
#endif
+bool exists(const char* filename)
+{
+ return !access(filename, F_OK);
+}
+
uint8 GetByte(uint32 val, int idx)
{
switch( idx )