Documented GVF_SAVE_VAR alongside other flags, and removed a query/doubt
[AROS.git] / arch / all-mingw32 / battclock / battclock_init.c
blob39a7fdffa79fb37550b148a545a58174ae237fcd
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #define DEBUG 0
8 #include <aros/debug.h>
9 #include <aros/libcall.h>
10 #include <aros/symbolsets.h>
11 #include <proto/exec.h>
12 #include <proto/hostlib.h>
13 #include "battclock_intern.h"
15 static const char *Symbols[] = {
16 "GetLocalTime",
17 "SetLocalTime",
18 NULL
21 /* auto init */
22 static int BattClock_Init(struct BattClockBase *BattClockBase)
24 APTR HostLibBase;
25 ULONG r;
27 HostLibBase = OpenResource("hostlib.resource");
28 D(bug("[battclock] HostLibBase = 0x%08lX\n", HostLibBase));
29 if (HostLibBase) {
30 BattClockBase->Lib = HostLib_Open("kernel32.dll", NULL);
31 if (BattClockBase->Lib) {
32 BattClockBase->KernelIFace = (struct KernelInterface *)HostLib_GetInterface(BattClockBase->Lib, Symbols, &r);
33 D(bug("[battclock] KernelIFace = 0x%08lX\n", BattClockBase->KernelIFace));
34 if (BattClockBase->KernelIFace) {
35 if (!r)
36 return 1;
37 HostLib_DropInterface((APTR)BattClockBase->KernelIFace);
39 HostLib_Close(BattClockBase->Lib, NULL);
42 return 0;
45 ADD2INITLIB(BattClock_Init, 0)