New bitmap method SetRGBConversionFunction which can be used to
[tangerine.git] / workbench / classes / zune / clock / clock_init.c
blob4218559b552f2801c2ee437332b9113cf172ca88
1 /*
2 Copyright © 1995-2006, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <exec/types.h>
7 #include <exec/libraries.h>
8 #include <dos/dosextens.h>
9 #include <aros/libcall.h>
10 #include <aros/debug.h>
11 #include <libcore/base.h>
13 #include <proto/exec.h>
14 #include <proto/timer.h>
16 #include <aros/symbolsets.h>
17 #include LC_LIBDEFS_FILE
19 #include <utility/date.h>
22 /*** Variables **************************************************************/
23 struct Device *TimerBase;
24 struct timerequest *TimerIO;
26 /*** Library startup and shutdown *******************************************/
27 static int Clock_Startup(LIBBASETYPEPTR LIBBASE)
29 TimerIO = NULL;
30 TimerBase = NULL;
32 TimerIO = AllocMem(sizeof(struct timerequest), MEMF_CLEAR);
33 if(TimerIO == NULL) goto error;
35 TimerIO->tr_node.io_Message.mn_Length = sizeof(struct timerequest);
39 0 == OpenDevice
41 "timer.device", UNIT_VBLANK, (struct IORequest *) TimerIO, 0
45 TimerBase = (struct Device *) TimerIO->tr_node.io_Device;
47 else
49 goto error;
52 return TRUE;
54 error:
55 if (TimerBase != NULL) CloseDevice((struct IORequest *) TimerIO);
56 if (TimerIO != NULL) FreeMem(TimerIO, sizeof(struct timerequest));
58 return FALSE;
61 static int Clock_Shutdown(LIBBASETYPEPTR LIBBASE)
63 if (TimerBase != NULL) CloseDevice((struct IORequest *) TimerIO);
64 if (TimerIO != NULL) FreeMem(TimerIO, sizeof( struct timerequest ));
65 return TRUE;
68 ADD2INITLIB(Clock_Startup, 1);
69 ADD2EXPUNGELIB(Clock_Shutdown, 1);