2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #ifndef __GATOR_KEYMAP_H_
11 #define __GATOR_KEYMAP_H_
13 /* number of entries max per keymap */
14 #define KEYMAP_NENTRIES 256
16 /* types of keymaps */
17 #define KEYMAP_EMPTY 0 /* nothing in this slot */
18 #define KEYMAP_PROC 1 /* procedure in this slot */
19 #define KEYMAP_SUBMAP 2 /* submap in this slot */
23 char type
; /* type, e.g. submap, etc */
24 char pad
[3]; /* padding */
25 char *name
; /* descriptive name of function, if function */
26 union { /* value (proc, submap, etc) */
27 int (*proc
) (void *, void *);
28 struct keymap_map
*submap
;
31 void *rock
; /* rock to use */
35 short refcount
; /* reference count */
36 char pad
[2]; /* padding to afs_int32 boundary */
37 struct keymap_entry entries
[KEYMAP_NENTRIES
];
41 struct keymap_map
*initMap
;
42 struct keymap_map
*currentMap
;
45 extern struct keymap_map
*keymap_Create(void);
46 extern int keymap_BindToString(struct keymap_map
*, char *,
47 int (*aproc
)(void *, void *), char *, void *);
48 extern int keymap_Delete(struct keymap_map
*);
49 extern int keymap_InitState(struct keymap_state
*, struct keymap_map
*);
50 extern int keymap_ProcessKey(struct keymap_state
*, int, void *);
51 extern int keymap_ResetState(struct keymap_state
*);
53 extern char *gtx_CopyString(char *);
56 #endif /* define for file */