16f13bce7Sbostic /*- 2*5da099d4Sbostic * Copyright (c) 1992, 1993 3*5da099d4Sbostic * The Regents of the University of California. All rights reserved. 46f13bce7Sbostic * 56f13bce7Sbostic * This code is derived from software contributed to Berkeley by 66f13bce7Sbostic * Christos Zoulas of Cornell University. 76f13bce7Sbostic * 86f13bce7Sbostic * %sccs.include.redist.c% 96f13bce7Sbostic * 10*5da099d4Sbostic * @(#)map.h 8.1 (Berkeley) 06/04/93 116f13bce7Sbostic */ 126f13bce7Sbostic 136f13bce7Sbostic /* 146f13bce7Sbostic * el.map.h: Editor maps 156f13bce7Sbostic */ 166f13bce7Sbostic #ifndef _h_el_map 176f13bce7Sbostic #define _h_el_map 186f13bce7Sbostic 196f13bce7Sbostic typedef struct el_bindings_t { /* for the "bind" shell command */ 206f13bce7Sbostic const char *name; /* function name for bind command */ 216f13bce7Sbostic int func; /* function numeric value */ 226f13bce7Sbostic const char *description; /* description of function */ 236f13bce7Sbostic } el_bindings_t; 246f13bce7Sbostic 256f13bce7Sbostic 266f13bce7Sbostic typedef struct el_map_t { 276f13bce7Sbostic el_action_t *alt; /* The current alternate key map */ 286f13bce7Sbostic el_action_t *key; /* The current normal key map */ 296f13bce7Sbostic el_action_t *current; /* The keymap we are using */ 306f13bce7Sbostic el_action_t *emacs; /* The default emacs key map */ 316f13bce7Sbostic el_action_t *vic; /* The vi command mode key map */ 326f13bce7Sbostic el_action_t *vii; /* The vi insert mode key map */ 336f13bce7Sbostic int type; /* Emacs or vi */ 346f13bce7Sbostic el_bindings_t *help; /* The help for the editor functions */ 356f13bce7Sbostic el_func_t *func; /* List of available functions */ 366f13bce7Sbostic int nfunc; /* The number of functions/help items */ 376f13bce7Sbostic } el_map_t; 386f13bce7Sbostic 396f13bce7Sbostic #define MAP_EMACS 0 406f13bce7Sbostic #define MAP_VI 1 416f13bce7Sbostic 426f13bce7Sbostic protected int map_bind __P((EditLine *, int, char **)); 436f13bce7Sbostic protected int map_init __P((EditLine *)); 446f13bce7Sbostic protected void map_end __P((EditLine *)); 456f13bce7Sbostic protected void map_init_vi __P((EditLine *)); 466f13bce7Sbostic protected void map_init_emacs __P((EditLine *)); 476f13bce7Sbostic protected int map_set_editor __P((EditLine *, char *)); 486f13bce7Sbostic protected int map_addfunc __P((EditLine *, const char *, 496f13bce7Sbostic const char *, el_func_t)); 506f13bce7Sbostic 516f13bce7Sbostic #endif /* _h_el_map */ 52