summaryrefslogtreecommitdiff
path: root/src/common/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/utils.h')
-rw-r--r--src/common/utils.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/common/utils.h b/src/common/utils.h
index 32087d78f..68dd01ac4 100644
--- a/src/common/utils.h
+++ b/src/common/utils.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _UTILS_H_
-#define _UTILS_H_
+#ifndef _COMMON_UTILS_H_
+#define _COMMON_UTILS_H_
#include "../common/cbasetypes.h"
#include <stdio.h> // FILE*
@@ -20,11 +20,13 @@ void findfile(const char *p, const char *pat, void (func)(const char*));
bool exists(const char* filename);
//Caps values to min/max
-#define cap_value(a, min, max) ((a >= max) ? max : (a <= min) ? min : a)
+#define cap_value(a, min, max) (((a) >= (max)) ? (max) : ((a) <= (min)) ? (min) : (a))
/// calculates the value of A / B, in percent (rounded down)
unsigned int get_percentage(const unsigned int A, const unsigned int B);
+const char* timestamp2string(char* str, size_t size, time_t timestamp, const char* format);
+
//////////////////////////////////////////////////////////////////////////
// byte word dword access [Shinomori]
//////////////////////////////////////////////////////////////////////////
@@ -52,4 +54,4 @@ struct HCache_interface *HCache;
void HCache_defaults(void);
-#endif /* _UTILS_H_ */
+#endif /* _COMMON_UTILS_H_ */