summaryrefslogtreecommitdiff
path: root/src/common/utils.h
diff options
context:
space:
mode:
authorKenpachi2k13 <3476227+Kenpachi2k13@users.noreply.github.com>2020-05-05 01:00:27 +0200
committerGitHub <noreply@github.com>2020-05-05 01:00:27 +0200
commit66607bfbfe197a5fec86dd1efe34a2da80929648 (patch)
treeed0e97ddc134c82067a436ea3ffd67f2f46be60b /src/common/utils.h
parent3f6b7497531f9ace331ca74d271898e938245c04 (diff)
parent944d8489f1bcca93e6b2ff06a159084f064dce12 (diff)
downloadhercules-66607bfbfe197a5fec86dd1efe34a2da80929648.tar.gz
hercules-66607bfbfe197a5fec86dd1efe34a2da80929648.tar.bz2
hercules-66607bfbfe197a5fec86dd1efe34a2da80929648.tar.xz
hercules-66607bfbfe197a5fec86dd1efe34a2da80929648.zip
Merge branch 'master' into configure_newopt
Diffstat (limited to 'src/common/utils.h')
-rw-r--r--src/common/utils.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/common/utils.h b/src/common/utils.h
index f564dcf29..3e0d73e40 100644
--- a/src/common/utils.h
+++ b/src/common/utils.h
@@ -2,8 +2,8 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2018 Hercules Dev Team
- * Copyright (C) Athena Dev Teams
+ * Copyright (C) 2012-2020 Hercules Dev Team
+ * Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -31,6 +31,14 @@
/* [HCache] 1-byte key to ensure our method is the latest, we can modify to ensure the method matches */
#define HCACHE_KEY 'k'
+#ifndef MAX_DIR_PATH
+#ifdef WIN32
+#define MAX_DIR_PATH MAX_PATH
+#else
+#define MAX_DIR_PATH 2048
+#endif
+#endif
+
//Caps values to min/max
#define cap_value(a, min, max) (((a) >= (max)) ? (max) : ((a) <= (min)) ? (min) : (a))
@@ -39,7 +47,8 @@
void WriteDump(FILE* fp, const void* buffer, size_t length);
void ShowDump(const void* buffer, size_t length);
-void findfile(const char *p, const char *pat, void (func)(const char*));
+void findfile(const char *p, const char *pat, void (func)(const char *, void *), void *context);
+bool is_file(const char *path);
bool exists(const char* filename);
/// calculates the value of A / B, in percent (rounded down)