|
||||
File indexing completed on 2025-01-18 10:10:07
0001 /* keymaps.h -- Manipulation of readline keymaps. */ 0002 0003 /* Copyright (C) 1987, 1989, 1992-2021 Free Software Foundation, Inc. 0004 0005 This file is part of the GNU Readline Library (Readline), a library 0006 for reading lines of text with interactive input and history editing. 0007 0008 Readline is free software: you can redistribute it and/or modify 0009 it under the terms of the GNU General Public License as published by 0010 the Free Software Foundation, either version 3 of the License, or 0011 (at your option) any later version. 0012 0013 Readline is distributed in the hope that it will be useful, 0014 but WITHOUT ANY WARRANTY; without even the implied warranty of 0015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0016 GNU General Public License for more details. 0017 0018 You should have received a copy of the GNU General Public License 0019 along with Readline. If not, see <http://www.gnu.org/licenses/>. 0020 */ 0021 0022 #ifndef _KEYMAPS_H_ 0023 #define _KEYMAPS_H_ 0024 0025 #ifdef __cplusplus 0026 extern "C" { 0027 #endif 0028 0029 #if defined (READLINE_LIBRARY) 0030 # include "rlstdc.h" 0031 # include "chardefs.h" 0032 # include "rltypedefs.h" 0033 #else 0034 # include <readline/rlstdc.h> 0035 # include <readline/chardefs.h> 0036 # include <readline/rltypedefs.h> 0037 #endif 0038 0039 /* A keymap contains one entry for each key in the ASCII set. 0040 Each entry consists of a type and a pointer. 0041 FUNCTION is the address of a function to run, or the 0042 address of a keymap to indirect through. 0043 TYPE says which kind of thing FUNCTION is. */ 0044 typedef struct _keymap_entry { 0045 char type; 0046 rl_command_func_t *function; 0047 } KEYMAP_ENTRY; 0048 0049 /* This must be large enough to hold bindings for all of the characters 0050 in a desired character set (e.g, 128 for ASCII, 256 for ISO Latin-x, 0051 and so on) plus one for subsequence matching. */ 0052 #define KEYMAP_SIZE 257 0053 #define ANYOTHERKEY KEYMAP_SIZE-1 0054 0055 typedef KEYMAP_ENTRY KEYMAP_ENTRY_ARRAY[KEYMAP_SIZE]; 0056 typedef KEYMAP_ENTRY *Keymap; 0057 0058 /* The values that TYPE can have in a keymap entry. */ 0059 #define ISFUNC 0 0060 #define ISKMAP 1 0061 #define ISMACR 2 0062 0063 extern KEYMAP_ENTRY_ARRAY emacs_standard_keymap, emacs_meta_keymap, emacs_ctlx_keymap; 0064 extern KEYMAP_ENTRY_ARRAY vi_insertion_keymap, vi_movement_keymap; 0065 0066 /* Return a new, empty keymap. 0067 Free it with free() when you are done. */ 0068 extern Keymap rl_make_bare_keymap (void); 0069 0070 /* Return a new keymap which is a copy of MAP. */ 0071 extern Keymap rl_copy_keymap (Keymap); 0072 0073 /* Return a new keymap with the printing characters bound to rl_insert, 0074 the lowercase Meta characters bound to run their equivalents, and 0075 the Meta digits bound to produce numeric arguments. */ 0076 extern Keymap rl_make_keymap (void); 0077 0078 /* Free the storage associated with a keymap. */ 0079 extern void rl_discard_keymap (Keymap); 0080 0081 /* These functions actually appear in bind.c */ 0082 0083 /* Return the keymap corresponding to a given name. Names look like 0084 `emacs' or `emacs-meta' or `vi-insert'. */ 0085 extern Keymap rl_get_keymap_by_name (const char *); 0086 0087 /* Return the current keymap. */ 0088 extern Keymap rl_get_keymap (void); 0089 0090 /* Set the current keymap to MAP. */ 0091 extern void rl_set_keymap (Keymap); 0092 0093 /* Set the name of MAP to NAME */ 0094 extern int rl_set_keymap_name (const char *, Keymap); 0095 0096 #ifdef __cplusplus 0097 } 0098 #endif 0099 0100 #endif /* _KEYMAPS_H_ */
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |