summaryrefslogtreecommitdiff
path: root/src/common/timer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/timer.h')
-rw-r--r--src/common/timer.h41
1 files changed, 24 insertions, 17 deletions
diff --git a/src/common/timer.h b/src/common/timer.h
index 902679f51..50f1c354b 100644
--- a/src/common/timer.h
+++ b/src/common/timer.h
@@ -1,10 +1,8 @@
// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-
#ifndef _TIMER_H_
#define _TIMER_H_
-
#include "../common/cbasetypes.h"
#define DIFF_TICK(a,b) ((int)((a)-(b)))
@@ -34,27 +32,36 @@ struct TimerData {
intptr_t data;
};
-// Function prototype declaration
-int do_timer(unsigned int tick);
-void timer_init(void);
-void timer_final(void);
+/*=====================================
+* Interface : timer.h
+* Generated by HerculesInterfaceMaker
+* created by Susu
+*-------------------------------------*/
+struct timer_interface {
+
+ /* funcs */
+ unsigned int (*gettick) (void);
+ unsigned int (*gettick_nocache) (void);
+
+ int (*add_timer) (unsigned int tick, TimerFunc func, int id, intptr_t data);
+ int (*add_timer_interval) (unsigned int tick, TimerFunc func, int id, intptr_t data, int interval);
+ const struct TimerData *(*get_timer) (int tid);
+ int (*delete_timer) (int tid, TimerFunc func);
-/* Hercules Renewal Phase One */
-unsigned int (*gettick) (void);
-unsigned int (*gettick_nocache) (void);
+ int (*addtick_timer) (int tid, unsigned int tick);
+ int (*settick_timer) (int tid, unsigned int tick);
-int (*add_timer) (unsigned int tick, TimerFunc func, int id, intptr_t data);
-int (*add_timer_interval) (unsigned int tick, TimerFunc func, int id, intptr_t data, int interval);
-const struct TimerData *(*get_timer) (int tid);
-int (*delete_timer) (int tid, TimerFunc func);
+ int (*add_timer_func_list) (TimerFunc func, char* name);
-int (*addtick_timer) (int tid, unsigned int tick);
-int (*settick_timer) (int tid, unsigned int tick);
+ unsigned long (*get_uptime) (void);
-int (*add_timer_func_list) (TimerFunc func, char* name);
+ int (*do_timer) (unsigned int tick);
+ void (*init) (void);
+ void (*final) (void);
+} iTimer_s;
-unsigned long (*get_uptime) (void);
+struct timer_interface *iTimer;
void timer_defaults(void);