add the gnu/nls/x flag options to other build_with_configure based templates
[AROS.git] / workbench / classes / zune / calendar / calendar_init.c
blobb854f148c033fe0c6b3639acefa656f5ac3c8223
1 /*
2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <exec/types.h>
7 #include <exec/libraries.h>
8 #include <exec/memory.h>
9 #include <dos/dosextens.h>
10 #include <aros/libcall.h>
11 #include <aros/debug.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 Calendar_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 );
37 if( OpenDevice( "timer.device", UNIT_VBLANK, (struct IORequest *) TimerIO, 0) == 0 )
38 TimerBase = (struct Device *) TimerIO->tr_node.io_Device;
39 else
40 goto error;
42 return TRUE;
44 error:
45 if( TimerBase != NULL ) CloseDevice( (struct IORequest *) TimerIO );
46 if( TimerIO != NULL ) FreeMem( TimerIO, sizeof( struct timerequest ) );
48 return FALSE;
51 static int Calendar_Shutdown( LIBBASETYPEPTR LIBBASE )
53 if( TimerBase != NULL ) CloseDevice( (struct IORequest *) TimerIO );
54 if( TimerIO != NULL ) FreeMem( TimerIO, sizeof( struct timerequest ) );
55 return TRUE;
58 ADD2INITLIB( Calendar_Startup, 1 );
59 ADD2EXPUNGELIB( Calendar_Shutdown, 1 );