added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / rom / keymap / keymap_init.c
blob3e1832eb56654b134b78997a67c3cda5891d4a6f
1 /*
2 Copyright © 1995-2006, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Library header for keymap
6 Lang: english
7 */
9 /****************************************************************************************/
11 #include <proto/exec.h>
12 #include <exec/resident.h>
13 #include <exec/execbase.h>
14 #include <exec/memory.h>
15 #include <aros/symbolsets.h>
16 #include LC_LIBDEFS_FILE
17 #include "keymap_intern.h"
19 /****************************************************************************************/
21 extern struct KeyMap def_km;
23 #if DEBUG
24 struct KeymapBase *DebugKeymapBase;
25 #endif
27 /****************************************************************************************/
29 static int KeymapInit(LIBBASETYPEPTR LIBBASE)
31 #if DEBUG
32 DebugKeymapBase = LIBBASE;
33 #endif
35 LIBBASE->DefaultKeymap = &def_km;
37 /* Initialize and add the keymap.resource */
39 LIBBASE->DefKeymapNode = AllocMem(sizeof (struct KeyMapNode), MEMF_PUBLIC);
40 if (!LIBBASE->DefKeymapNode)
41 return (NULL);
43 /* Initialise the keymap.resource */
44 LIBBASE->KeymapResource.kr_Node.ln_Type = NT_RESOURCE;
45 LIBBASE->KeymapResource.kr_Node.ln_Name = "keymap.resource";
46 NEWLIST( &(LIBBASE->KeymapResource.kr_List) );
47 AddResource(&LIBBASE->KeymapResource);
49 /* Copy default keymap into DefKeymapNode */
50 CopyMem(&def_km, &(LIBBASE->DefKeymapNode->kn_KeyMap), sizeof (struct KeyMap));
52 LIBBASE->DefKeymapNode->kn_Node.ln_Name = "default keymap";
55 We are being called under Forbid(), so I don't have to arbitrate
56 That notwithstanding, if keymap resource or exec library loading
57 ever become semaphore based, there may be some problems.
59 AddTail( &(LIBBASE->KeymapResource.kr_List), &(LIBBASE->DefKeymapNode->kn_Node));
61 /* You would return NULL if the init failed */
62 return TRUE;
65 /****************************************************************************************/
67 ADD2INITLIB(KeymapInit, 0);