revert between 56095 -> 55830 in arch
[AROS.git] / arch / m68k-amiga / hidd / keyboard / startup.c
blobb8ba0c4bf320486af6a1cb4a83b7f14da3713bfa
1 /*
2 Copyright © 1995-2018, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #define DEBUG 0
7 #include <aros/debug.h>
9 #include <aros/symbolsets.h>
10 #include <proto/oop.h>
12 #include <hidd/hidd.h>
13 #include <hidd/keyboard.h>
15 #include "kbd.h"
17 #undef XSD
18 #define XSD(cl) ksd
20 static int AmigaKbd_Init(struct kbdbase *LIBBASE)
22 struct kbd_staticdata *ksd = &LIBBASE->ksd;
23 struct OOP_ABDescr attrbases[] =
25 {IID_Hidd , &HiddAttrBase },
26 {IID_Hidd_Kbd , &HiddKbdAB },
27 {NULL , NULL }
29 OOP_Object *kbd;
30 OOP_Object *drv = NULL;
32 EnterFunc(bug("AmigaKbd_Init\n"));
34 kbd = OOP_NewObject(NULL, CLID_Hidd_Kbd, NULL);
35 if (kbd) {
36 if (OOP_ObtainAttrBases(attrbases))
38 HiddKbdBase = OOP_GetMethodID(IID_Hidd_Kbd, 0);
39 drv = HIDD_Kbd_AddHardwareDriver(kbd, LIBBASE->ksd.kbdclass, NULL);
41 OOP_DisposeObject(kbd);
44 if (!drv)
45 return FALSE;
47 LIBBASE->library.lib_OpenCnt = 1;
49 ReturnInt("AmigaKbd_Init", int, TRUE);
52 static int AmigaKbd_Expunge(struct kbdbase *LIBBASE)
54 struct kbd_staticdata *ksd = &LIBBASE->ksd;
55 struct OOP_ABDescr attrbases[] =
57 {IID_Hidd_Kbd , &LIBBASE->ksd.hiddKbdAB },
58 {NULL , NULL }
61 EnterFunc(bug("AmigaKbd_Expunge\n"));
63 OOP_ReleaseAttrBases(attrbases);
65 ReturnInt("AmigaKbd_Expunge", int, TRUE);
68 ADD2INITLIB(AmigaKbd_Init, 0)
69 ADD2EXPUNGELIB(AmigaKbd_Expunge, 0)