summaryrefslogtreecommitdiff
path: root/src/common/utils.h
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-12-19 18:15:04 +0100
committerHaru <haru@dotalux.com>2016-01-29 10:58:05 +0100
commitb7c5b53cccac17765fd7445b390853f5a0eb1a4d (patch)
treef137eb807480a94a67fc334178fffdfd3c029e65 /src/common/utils.h
parent50de6b49043968d01b2cc7565376d5e06c29b490 (diff)
downloadhercules-b7c5b53cccac17765fd7445b390853f5a0eb1a4d.tar.gz
hercules-b7c5b53cccac17765fd7445b390853f5a0eb1a4d.tar.bz2
hercules-b7c5b53cccac17765fd7445b390853f5a0eb1a4d.tar.xz
hercules-b7c5b53cccac17765fd7445b390853f5a0eb1a4d.zip
Added apply_percentrate and apply_percentrate64 functions
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/common/utils.h')
-rw-r--r--src/common/utils.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/common/utils.h b/src/common/utils.h
index da2a29317..3f181ef12 100644
--- a/src/common/utils.h
+++ b/src/common/utils.h
@@ -42,6 +42,9 @@ bool exists(const char* filename);
/// calculates the value of A / B, in percent (rounded down)
unsigned int get_percentage(const unsigned int A, const unsigned int B);
+int64 apply_percentrate64(int64 value, int rate, int maxrate);
+int apply_percentrate(int value, int rate, int maxrate);
+
const char* timestamp2string(char* str, size_t size, time_t timestamp, const char* format);
//////////////////////////////////////////////////////////////////////////