summaryrefslogtreecommitdiff
path: root/src/common/timer.h
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-19 09:15:00 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-19 09:15:00 +0000
commit70dc3acce080b3c4f5061c2394911149d0d82aa4 (patch)
tree7e9bcc793338ab564ad0fe6142dfdc6d651b78e7 /src/common/timer.h
parente73a29efa9a57ee1387af8626a8c20c5a780f42a (diff)
downloadhercules-70dc3acce080b3c4f5061c2394911149d0d82aa4.tar.gz
hercules-70dc3acce080b3c4f5061c2394911149d0d82aa4.tar.bz2
hercules-70dc3acce080b3c4f5061c2394911149d0d82aa4.tar.xz
hercules-70dc3acce080b3c4f5061c2394911149d0d82aa4.zip
- Cleanups or minor changes.
- Now addtick_timer invokes settick_timer, so keep an eye for whatever timer issues it's supposed to have. - Removed the flush_fifo from clif_parse_TickSend until the socket problems are fixed. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9521 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/timer.h')
-rw-r--r--src/common/timer.h24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/common/timer.h b/src/common/timer.h
index 9acc7c640..7184beec5 100644
--- a/src/common/timer.h
+++ b/src/common/timer.h
@@ -12,17 +12,19 @@
#define BASE_TICK 5
-#define TIMER_ONCE_AUTODEL 1
-#define TIMER_INTERVAL 2
-#define TIMER_REMOVE_HEAP 16
+#define TIMER_ONCE_AUTODEL 0x1
+#define TIMER_INTERVAL 0x2
+#define TIMER_REMOVE_HEAP 0x10
#define DIFF_TICK(a,b) ((int)((a)-(b)))
// Struct declaration
+typedef int (*TimerFunc)(int,unsigned int,int,int);
+
struct TimerData {
unsigned int tick;
- int (*func)(int,unsigned int,int,int);
+ TimerFunc func;
int id;
int data;
int type;
@@ -32,16 +34,12 @@ struct TimerData {
// Function prototype declaration
-#ifdef __WIN32
-void gettimeofday(struct timeval *t, void *dummy);
-#endif
-
unsigned int gettick_nocache(void);
unsigned int gettick(void);
-int add_timer(unsigned int,int (*)(int,unsigned int,int,int),int,int);
-int add_timer_interval(unsigned int,int (*)(int,unsigned int,int,int),int,int,int);
-int delete_timer(int,int (*)(int,unsigned int,int,int));
+int add_timer(unsigned int,TimerFunc f,int,int);
+int add_timer_interval(unsigned int,TimerFunc f,int,int,int);
+int delete_timer(int,TimerFunc f);
int addtick_timer(int tid,unsigned int tick);
int settick_timer(int tid,unsigned int tick);
@@ -49,8 +47,8 @@ struct TimerData *get_timer(int tid);
int do_timer(unsigned int tick);
-int add_timer_func_list(int (*)(int,unsigned int,int,int),char*);
-char* search_timer_func_list(int (*)(int,unsigned int,int,int));
+int add_timer_func_list(TimerFunc func, char* name);
+char* search_timer_func_list(TimerFunc f);
unsigned long get_uptime(void);