00001 00004 #ifndef RAZORBACK_TIMER_H 00005 #define RAZORBACK_TIMER_H 00006 00007 #include <razorback/visibility.h> 00008 #include <razorback/types.h> 00009 00010 #ifdef _MSC_VER 00011 #else //_MSC_VER 00012 #include <signal.h> 00013 #include <time.h> 00014 #endif //_MSC_VER 00015 00016 #ifdef __cplusplus 00017 extern "C" { 00018 #endif 00019 00022 struct Timer 00023 { 00024 #ifdef _MSC_VER 00025 HANDLE timerQueue; 00026 HANDLE timer; 00027 #else 00028 timer_t timer; 00029 struct itimerspec spec; 00030 struct sigevent *props; 00031 #endif 00032 uint32_t interval; 00033 void *userData; 00034 void (*function)(void *); 00035 }; 00036 00043 SO_PUBLIC extern struct Timer * Timer_Create(uint32_t interval, void (*handler)(void *), void *userData); 00044 00048 SO_PUBLIC extern void Timer_Destroy(struct Timer *timer); 00049 00050 #ifdef __cplusplus 00051 } 00052 #endif 00053 #endif //RAZORBACK_TIMER_H