xref: /original-bsd/lib/libedit/map.h (revision 5da099d4)
1 /*-
2  * Copyright (c) 1992, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * Christos Zoulas of Cornell University.
7  *
8  * %sccs.include.redist.c%
9  *
10  *	@(#)map.h	8.1 (Berkeley) 06/04/93
11  */
12 
13 /*
14  * el.map.h:	Editor maps
15  */
16 #ifndef _h_el_map
17 #define _h_el_map
18 
19 typedef struct el_bindings_t {	/* for the "bind" shell command */
20     const char   *name;		/* function name for bind command */
21     int     func;		/* function numeric value */
22     const char   *description;	/* description of function */
23 } el_bindings_t;
24 
25 
26 typedef struct el_map_t {
27     el_action_t   *alt;		/* The current alternate key map	*/
28     el_action_t   *key;		/* The current normal key map		*/
29     el_action_t   *current;	/* The keymap we are using		*/
30     el_action_t   *emacs;	/* The default emacs key map		*/
31     el_action_t   *vic;		/* The vi command mode key map		*/
32     el_action_t   *vii;		/* The vi insert mode key map		*/
33     int		   type;	/* Emacs or vi				*/
34     el_bindings_t *help;	/* The help for the editor functions	*/
35     el_func_t     *func;	/* List of available functions		*/
36     int  	   nfunc;	/* The number of functions/help items	*/
37 } el_map_t;
38 
39 #define MAP_EMACS	0
40 #define MAP_VI		1
41 
42 protected int	map_bind		__P((EditLine *, int, char **));
43 protected int	map_init		__P((EditLine *));
44 protected void	map_end			__P((EditLine *));
45 protected void	map_init_vi		__P((EditLine *));
46 protected void	map_init_emacs		__P((EditLine *));
47 protected int	map_set_editor		__P((EditLine *, char *));
48 protected int	map_addfunc		__P((EditLine *, const char *,
49 					     const char *, el_func_t));
50 
51 #endif /* _h_el_map */
52