home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / CLISP / CLISPSRC.TAR / clisp-1995-01-01 / src / readline / keymaps.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-10  |  1.7 KB  |  57 lines

  1. /* keymaps.h -- changed by Bruno Haible, 10 June 1993 */
  2.  
  3. /* keymaps.h -- Manipulation of readline keymaps. */
  4.  
  5. #ifndef _KEYMAPS_H_
  6. #define _KEYMAPS_H_
  7.  
  8. #include "chardefs.h"
  9.  
  10. #ifndef __FUNCTION_DEF
  11. typedef int Function ();
  12. #define __FUNCTION_DEF
  13. #endif
  14.  
  15. /* A keymap contains one entry for each key in the ASCII set.
  16.    Each entry consists of a type and a pointer.
  17.    POINTER is the address of a function to run, or the
  18.    address of a keymap to indirect through.
  19.    TYPE says which kind of thing POINTER is. */
  20. typedef struct _keymap_entry {
  21.   char type;
  22.   Function *function;
  23. } KEYMAP_ENTRY;
  24.  
  25. /* I wanted to make the above structure contain a union of:
  26.    union { Function *function; struct _keymap_entry *keymap; } value;
  27.    but this made it impossible for me to create a static array.
  28.    Maybe I need C lessons. */
  29.  
  30. typedef KEYMAP_ENTRY KEYMAP_ENTRY_ARRAY[NUMCHARS];
  31. typedef KEYMAP_ENTRY *Keymap;
  32.  
  33. /* The values that TYPE can have in a keymap entry. */
  34. #define ISFUNC 0
  35. #define ISKMAP 1
  36. #define ISMACR 2
  37.  
  38. extern KEYMAP_ENTRY_ARRAY emacs_standard_keymap, emacs_meta_keymap, emacs_ctlx_keymap;
  39. #if defined(__MSDOS__) || defined(__EMX__)
  40. extern KEYMAP_ENTRY_ARRAY emacs_dos_keymap;
  41. #endif
  42. extern KEYMAP_ENTRY_ARRAY vi_insertion_keymap, vi_movement_keymap;
  43.  
  44. /* Return a new, empty keymap.
  45.    Free it with free() when you are done. */
  46. extern Keymap rl_make_bare_keymap RL((void));
  47.  
  48. /* Return a new keymap which is a copy of MAP. */
  49. extern Keymap rl_copy_keymap RL((Keymap map));
  50.  
  51. /* Return a new keymap with the printing characters bound to rl_insert,
  52.    the lowercase Meta characters bound to run their equivalents, and
  53.    the Meta digits bound to produce numeric arguments. */
  54. extern Keymap rl_make_keymap RL((void));
  55.  
  56. #endif /* _KEYMAPS_H_ */
  57.