1 #include <exec/types.h>
2 #include <devices/timer.h>
3 #include <proto/exec.h>
5 void EZDeleteTimer(TimeRequest
)
6 struct timerequest
*TimeRequest
;
8 struct MsgPort
*TimePort
;
12 if(TimeRequest
->tr_node
.io_Device
)
13 CloseDevice(TimeRequest
);
15 if((TimePort
=TimeRequest
->tr_node
.io_Message
.mn_ReplyPort
))
18 DeleteExtIO(TimeRequest
);
22 struct timerequest
*EZCreateTimer(LONG Unit
)
24 struct MsgPort
*TimePort
;
25 struct timerequest
*TimeRequest
;
27 if(!(TimePort
= (struct MsgPort
*)CreatePort(NULL
,0)))
30 if(!(TimeRequest
= (struct timerequest
*)CreateExtIO(TimePort
,sizeof(struct timerequest
))))
37 if(OpenDevice(TIMERNAME
,Unit
,TimeRequest
,0))
39 DeleteExtIO(TimeRequest
);