Merge branch 'master' of git://cadel.mutabah.net/acess2
[tpg/acess2.git] / Tools / nativelib / time.c
1 /*
2  * Acess2 DiskTool
3  * - By John Hodge (thePowersGang)
4  * 
5  * time.c
6  * - Timing functions (emulated)
7  */
8 #include <acess.h>
9 #include <timers.h>
10 #include <events.h>
11
12 // === CODE ===
13 tTimer *Time_AllocateTimer(tTimerCallback *Callback, void *Argument)
14 {
15         return NULL;
16 }
17
18 void Time_ScheduleTimer(tTimer *Timer, int Delta)
19 {
20         if( !Timer )
21         {
22                 // SIGALRM
23                 Log_Warning("Time", "TODO: Alarm event in %i ms", Delta);
24         }
25         else
26         {
27
28         }
29 }
30
31 void Time_RemoveTimer(tTimer *Timer)
32 {
33         
34 }
35
36 void Time_FreeTimer(tTimer *Timer)
37 {
38         
39 }
40
41 void Time_ScheduleEvent(int Delay)
42 {
43         Log_Warning("Time", "TODO: EVENT_TIMER in %ims", Delay);
44 }
45
46 void Time_Delay(int Delay)
47 {
48         Time_ScheduleEvent(Delay);
49         Threads_WaitEvents(THREAD_EVENT_TIMER);
50 }
51
52 Sint64 now(void)
53 {
54         // TODO: Translate UNIX time into Acess time
55         return 0;
56 }
57

UCC git Repository :: git.ucc.asn.au