version 1.1.1.1, 2014/07/30 08:16:45
|
version 1.1.1.2, 2021/03/17 01:01:01
|
Line 1
|
Line 1
|
/* funmap.c -- attach names to functions. */ |
/* funmap.c -- attach names to functions. */ |
|
|
/* Copyright (C) 1987-2010 Free Software Foundation, Inc. | /* Copyright (C) 1987-2020 Free Software Foundation, Inc. |
|
|
This file is part of the GNU Readline Library (Readline), a library |
This file is part of the GNU Readline Library (Readline), a library |
for reading lines of text with interactive input and history editing. |
for reading lines of text with interactive input and history editing. |
Line 68 static const FUNMAP default_funmap[] = {
|
Line 68 static const FUNMAP default_funmap[] = {
|
{ "backward-word", rl_backward_word }, |
{ "backward-word", rl_backward_word }, |
{ "beginning-of-history", rl_beginning_of_history }, |
{ "beginning-of-history", rl_beginning_of_history }, |
{ "beginning-of-line", rl_beg_of_line }, |
{ "beginning-of-line", rl_beg_of_line }, |
|
{ "bracketed-paste-begin", rl_bracketed_paste_begin }, |
{ "call-last-kbd-macro", rl_call_last_kbd_macro }, |
{ "call-last-kbd-macro", rl_call_last_kbd_macro }, |
{ "capitalize-word", rl_capitalize_word }, |
{ "capitalize-word", rl_capitalize_word }, |
{ "character-search", rl_char_search }, |
{ "character-search", rl_char_search }, |
{ "character-search-backward", rl_backward_char_search }, |
{ "character-search-backward", rl_backward_char_search }, |
|
{ "clear-display", rl_clear_display }, |
{ "clear-screen", rl_clear_screen }, |
{ "clear-screen", rl_clear_screen }, |
{ "complete", rl_complete }, |
{ "complete", rl_complete }, |
{ "copy-backward-word", rl_copy_backward_word }, |
{ "copy-backward-word", rl_copy_backward_word }, |
Line 109 static const FUNMAP default_funmap[] = {
|
Line 111 static const FUNMAP default_funmap[] = {
|
{ "menu-complete", rl_menu_complete }, |
{ "menu-complete", rl_menu_complete }, |
{ "menu-complete-backward", rl_backward_menu_complete }, |
{ "menu-complete-backward", rl_backward_menu_complete }, |
{ "next-history", rl_get_next_history }, |
{ "next-history", rl_get_next_history }, |
|
{ "next-screen-line", rl_next_screen_line }, |
{ "non-incremental-forward-search-history", rl_noninc_forward_search }, |
{ "non-incremental-forward-search-history", rl_noninc_forward_search }, |
{ "non-incremental-reverse-search-history", rl_noninc_reverse_search }, |
{ "non-incremental-reverse-search-history", rl_noninc_reverse_search }, |
{ "non-incremental-forward-search-history-again", rl_noninc_forward_search_again }, |
{ "non-incremental-forward-search-history-again", rl_noninc_forward_search_again }, |
{ "non-incremental-reverse-search-history-again", rl_noninc_reverse_search_again }, |
{ "non-incremental-reverse-search-history-again", rl_noninc_reverse_search_again }, |
{ "old-menu-complete", rl_old_menu_complete }, |
{ "old-menu-complete", rl_old_menu_complete }, |
|
{ "operate-and-get-next", rl_operate_and_get_next }, |
{ "overwrite-mode", rl_overwrite_mode }, |
{ "overwrite-mode", rl_overwrite_mode }, |
#ifdef __CYGWIN__ | #if defined (_WIN32) |
{ "paste-from-clipboard", rl_paste_from_clipboard }, |
{ "paste-from-clipboard", rl_paste_from_clipboard }, |
#endif |
#endif |
{ "possible-completions", rl_possible_completions }, |
{ "possible-completions", rl_possible_completions }, |
{ "previous-history", rl_get_previous_history }, |
{ "previous-history", rl_get_previous_history }, |
|
{ "previous-screen-line", rl_previous_screen_line }, |
{ "print-last-kbd-macro", rl_print_last_kbd_macro }, |
{ "print-last-kbd-macro", rl_print_last_kbd_macro }, |
{ "quoted-insert", rl_quoted_insert }, |
{ "quoted-insert", rl_quoted_insert }, |
{ "re-read-init-file", rl_re_read_init_file }, |
{ "re-read-init-file", rl_re_read_init_file }, |
Line 154 static const FUNMAP default_funmap[] = {
|
Line 159 static const FUNMAP default_funmap[] = {
|
{ "vi-backward-bigword", rl_vi_bWord }, |
{ "vi-backward-bigword", rl_vi_bWord }, |
{ "vi-backward-word", rl_vi_bword }, |
{ "vi-backward-word", rl_vi_bword }, |
{ "vi-bWord", rl_vi_bWord }, |
{ "vi-bWord", rl_vi_bWord }, |
{ "vi-bword", rl_vi_bword }, | { "vi-bword", rl_vi_bword }, /* BEWARE: name matching is case insensitive */ |
{ "vi-change-case", rl_vi_change_case }, |
{ "vi-change-case", rl_vi_change_case }, |
{ "vi-change-char", rl_vi_change_char }, |
{ "vi-change-char", rl_vi_change_char }, |
{ "vi-change-to", rl_vi_change_to }, |
{ "vi-change-to", rl_vi_change_to }, |
Line 168 static const FUNMAP default_funmap[] = {
|
Line 173 static const FUNMAP default_funmap[] = {
|
{ "vi-end-bigword", rl_vi_eWord }, |
{ "vi-end-bigword", rl_vi_eWord }, |
{ "vi-end-word", rl_vi_end_word }, |
{ "vi-end-word", rl_vi_end_word }, |
{ "vi-eof-maybe", rl_vi_eof_maybe }, |
{ "vi-eof-maybe", rl_vi_eof_maybe }, |
{ "vi-eword", rl_vi_eword }, | { "vi-eword", rl_vi_eword }, /* BEWARE: name matching is case insensitive */ |
{ "vi-fWord", rl_vi_fWord }, |
{ "vi-fWord", rl_vi_fWord }, |
{ "vi-fetch-history", rl_vi_fetch_history }, |
{ "vi-fetch-history", rl_vi_fetch_history }, |
{ "vi-first-print", rl_vi_first_print }, |
{ "vi-first-print", rl_vi_first_print }, |
{ "vi-forward-bigword", rl_vi_fWord }, |
{ "vi-forward-bigword", rl_vi_fWord }, |
{ "vi-forward-word", rl_vi_fword }, |
{ "vi-forward-word", rl_vi_fword }, |
{ "vi-fword", rl_vi_fword }, | { "vi-fword", rl_vi_fword }, /* BEWARE: name matching is case insensitive */ |
{ "vi-goto-mark", rl_vi_goto_mark }, |
{ "vi-goto-mark", rl_vi_goto_mark }, |
{ "vi-insert-beg", rl_vi_insert_beg }, |
{ "vi-insert-beg", rl_vi_insert_beg }, |
{ "vi-insertion-mode", rl_vi_insertion_mode }, | { "vi-insertion-mode", rl_vi_insert_mode }, |
{ "vi-match", rl_vi_match }, |
{ "vi-match", rl_vi_match }, |
{ "vi-movement-mode", rl_vi_movement_mode }, |
{ "vi-movement-mode", rl_vi_movement_mode }, |
{ "vi-next-word", rl_vi_next_word }, |
{ "vi-next-word", rl_vi_next_word }, |
Line 193 static const FUNMAP default_funmap[] = {
|
Line 198 static const FUNMAP default_funmap[] = {
|
{ "vi-set-mark", rl_vi_set_mark }, |
{ "vi-set-mark", rl_vi_set_mark }, |
{ "vi-subst", rl_vi_subst }, |
{ "vi-subst", rl_vi_subst }, |
{ "vi-tilde-expand", rl_vi_tilde_expand }, |
{ "vi-tilde-expand", rl_vi_tilde_expand }, |
|
{ "vi-unix-word-rubout", rl_vi_unix_word_rubout }, |
{ "vi-yank-arg", rl_vi_yank_arg }, |
{ "vi-yank-arg", rl_vi_yank_arg }, |
|
{ "vi-yank-pop", rl_vi_yank_pop }, |
{ "vi-yank-to", rl_vi_yank_to }, |
{ "vi-yank-to", rl_vi_yank_to }, |
#endif /* VI_MODE */ |
#endif /* VI_MODE */ |
|
|
Line 201 static const FUNMAP default_funmap[] = {
|
Line 208 static const FUNMAP default_funmap[] = {
|
}; |
}; |
|
|
int |
int |
rl_add_funmap_entry (name, function) | rl_add_funmap_entry (const char *name, rl_command_func_t *function) |
const char *name; | |
rl_command_func_t *function; | |
{ |
{ |
if (funmap_entry + 2 >= funmap_size) |
if (funmap_entry + 2 >= funmap_size) |
{ |
{ |
Line 223 static int funmap_initialized;
|
Line 228 static int funmap_initialized;
|
|
|
/* Make the funmap contain all of the default entries. */ |
/* Make the funmap contain all of the default entries. */ |
void |
void |
rl_initialize_funmap () | rl_initialize_funmap (void) |
{ |
{ |
register int i; |
register int i; |
|
|
Line 241 rl_initialize_funmap ()
|
Line 246 rl_initialize_funmap ()
|
is sorted. The array itself is allocated, but not the strings inside. |
is sorted. The array itself is allocated, but not the strings inside. |
You should free () the array when you done, but not the pointers. */ |
You should free () the array when you done, but not the pointers. */ |
const char ** |
const char ** |
rl_funmap_names () | rl_funmap_names (void) |
{ |
{ |
const char **result; |
const char **result; |
int result_size, result_index; |
int result_size, result_index; |