OpenCoverage

funmap.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/bash/src/lib/readline/funmap.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12-
13-
14typedef int QSFUNC (const void *, const void *);-
15-
16-
17-
18-
19extern int _rl_qsort_string_compare (char **, char **);-
20-
21FUNMAP **funmap;-
22static int funmap_size;-
23static int funmap_entry;-
24-
25-
26-
27int funmap_program_specific_entry_start;-
28-
29static const FUNMAP default_funmap[] = {-
30 { "abort", rl_abort },-
31 { "accept-line", rl_newline },-
32 { "arrow-key-prefix", rl_arrow_keys },-
33 { "backward-byte", rl_backward_byte },-
34 { "backward-char", rl_backward_char },-
35 { "backward-delete-char", rl_rubout },-
36 { "backward-kill-line", rl_backward_kill_line },-
37 { "backward-kill-word", rl_backward_kill_word },-
38 { "backward-word", rl_backward_word },-
39 { "beginning-of-history", rl_beginning_of_history },-
40 { "beginning-of-line", rl_beg_of_line },-
41 { "bracketed-paste-begin", rl_bracketed_paste_begin },-
42 { "call-last-kbd-macro", rl_call_last_kbd_macro },-
43 { "capitalize-word", rl_capitalize_word },-
44 { "character-search", rl_char_search },-
45 { "character-search-backward", rl_backward_char_search },-
46 { "clear-screen", rl_clear_screen },-
47 { "complete", rl_complete },-
48 { "copy-backward-word", rl_copy_backward_word },-
49 { "copy-forward-word", rl_copy_forward_word },-
50 { "copy-region-as-kill", rl_copy_region_to_kill },-
51 { "delete-char", rl_delete },-
52 { "delete-char-or-list", rl_delete_or_show_completions },-
53 { "delete-horizontal-space", rl_delete_horizontal_space },-
54 { "digit-argument", rl_digit_argument },-
55 { "do-lowercase-version", rl_do_lowercase_version },-
56 { "downcase-word", rl_downcase_word },-
57 { "dump-functions", rl_dump_functions },-
58 { "dump-macros", rl_dump_macros },-
59 { "dump-variables", rl_dump_variables },-
60 { "emacs-editing-mode", rl_emacs_editing_mode },-
61 { "end-kbd-macro", rl_end_kbd_macro },-
62 { "end-of-history", rl_end_of_history },-
63 { "end-of-line", rl_end_of_line },-
64 { "exchange-point-and-mark", rl_exchange_point_and_mark },-
65 { "forward-backward-delete-char", rl_rubout_or_delete },-
66 { "forward-byte", rl_forward_byte },-
67 { "forward-char", rl_forward_char },-
68 { "forward-search-history", rl_forward_search_history },-
69 { "forward-word", rl_forward_word },-
70 { "history-search-backward", rl_history_search_backward },-
71 { "history-search-forward", rl_history_search_forward },-
72 { "history-substring-search-backward", rl_history_substr_search_backward },-
73 { "history-substring-search-forward", rl_history_substr_search_forward },-
74 { "insert-comment", rl_insert_comment },-
75 { "insert-completions", rl_insert_completions },-
76 { "kill-whole-line", rl_kill_full_line },-
77 { "kill-line", rl_kill_line },-
78 { "kill-region", rl_kill_region },-
79 { "kill-word", rl_kill_word },-
80 { "menu-complete", rl_menu_complete },-
81 { "menu-complete-backward", rl_backward_menu_complete },-
82 { "next-history", rl_get_next_history },-
83 { "next-screen-line", rl_next_screen_line },-
84 { "non-incremental-forward-search-history", rl_noninc_forward_search },-
85 { "non-incremental-reverse-search-history", rl_noninc_reverse_search },-
86 { "non-incremental-forward-search-history-again", rl_noninc_forward_search_again },-
87 { "non-incremental-reverse-search-history-again", rl_noninc_reverse_search_again },-
88 { "old-menu-complete", rl_old_menu_complete },-
89 { "overwrite-mode", rl_overwrite_mode },-
90-
91-
92-
93 { "possible-completions", rl_possible_completions },-
94 { "previous-history", rl_get_previous_history },-
95 { "previous-screen-line", rl_previous_screen_line },-
96 { "print-last-kbd-macro", rl_print_last_kbd_macro },-
97 { "quoted-insert", rl_quoted_insert },-
98 { "re-read-init-file", rl_re_read_init_file },-
99 { "redraw-current-line", rl_refresh_line},-
100 { "reverse-search-history", rl_reverse_search_history },-
101 { "revert-line", rl_revert_line },-
102 { "self-insert", rl_insert },-
103 { "set-mark", rl_set_mark },-
104 { "skip-csi-sequence", rl_skip_csi_sequence },-
105 { "start-kbd-macro", rl_start_kbd_macro },-
106 { "tab-insert", rl_tab_insert },-
107 { "tilde-expand", rl_tilde_expand },-
108 { "transpose-chars", rl_transpose_chars },-
109 { "transpose-words", rl_transpose_words },-
110 { "tty-status", rl_tty_status },-
111 { "undo", rl_undo_command },-
112 { "universal-argument", rl_universal_argument },-
113 { "unix-filename-rubout", rl_unix_filename_rubout },-
114 { "unix-line-discard", rl_unix_line_discard },-
115 { "unix-word-rubout", rl_unix_word_rubout },-
116 { "upcase-word", rl_upcase_word },-
117 { "yank", rl_yank },-
118 { "yank-last-arg", rl_yank_last_arg },-
119 { "yank-nth-arg", rl_yank_nth_arg },-
120 { "yank-pop", rl_yank_pop },-
121-
122-
123 { "vi-append-eol", rl_vi_append_eol },-
124 { "vi-append-mode", rl_vi_append_mode },-
125 { "vi-arg-digit", rl_vi_arg_digit },-
126 { "vi-back-to-indent", rl_vi_back_to_indent },-
127 { "vi-backward-bigword", rl_vi_bWord },-
128 { "vi-backward-word", rl_vi_bword },-
129 { "vi-bWord", rl_vi_bWord },-
130 { "vi-bword", rl_vi_bword },-
131 { "vi-change-case", rl_vi_change_case },-
132 { "vi-change-char", rl_vi_change_char },-
133 { "vi-change-to", rl_vi_change_to },-
134 { "vi-char-search", rl_vi_char_search },-
135 { "vi-column", rl_vi_column },-
136 { "vi-complete", rl_vi_complete },-
137 { "vi-delete", rl_vi_delete },-
138 { "vi-delete-to", rl_vi_delete_to },-
139 { "vi-eWord", rl_vi_eWord },-
140 { "vi-editing-mode", rl_vi_editing_mode },-
141 { "vi-end-bigword", rl_vi_eWord },-
142 { "vi-end-word", rl_vi_end_word },-
143 { "vi-eof-maybe", rl_vi_eof_maybe },-
144 { "vi-eword", rl_vi_eword },-
145 { "vi-fWord", rl_vi_fWord },-
146 { "vi-fetch-history", rl_vi_fetch_history },-
147 { "vi-first-print", rl_vi_first_print },-
148 { "vi-forward-bigword", rl_vi_fWord },-
149 { "vi-forward-word", rl_vi_fword },-
150 { "vi-fword", rl_vi_fword },-
151 { "vi-goto-mark", rl_vi_goto_mark },-
152 { "vi-insert-beg", rl_vi_insert_beg },-
153 { "vi-insertion-mode", rl_vi_insert_mode },-
154 { "vi-match", rl_vi_match },-
155 { "vi-movement-mode", rl_vi_movement_mode },-
156 { "vi-next-word", rl_vi_next_word },-
157 { "vi-overstrike", rl_vi_overstrike },-
158 { "vi-overstrike-delete", rl_vi_overstrike_delete },-
159 { "vi-prev-word", rl_vi_prev_word },-
160 { "vi-put", rl_vi_put },-
161 { "vi-redo", rl_vi_redo },-
162 { "vi-replace", rl_vi_replace },-
163 { "vi-rubout", rl_vi_rubout },-
164 { "vi-search", rl_vi_search },-
165 { "vi-search-again", rl_vi_search_again },-
166 { "vi-set-mark", rl_vi_set_mark },-
167 { "vi-subst", rl_vi_subst },-
168 { "vi-tilde-expand", rl_vi_tilde_expand },-
169 { "vi-unix-word-rubout", rl_vi_unix_word_rubout },-
170 { "vi-yank-arg", rl_vi_yank_arg },-
171 { "vi-yank-pop", rl_vi_yank_pop },-
172 { "vi-yank-to", rl_vi_yank_to },-
173-
174-
175 {(char *)-
176 ((void *)0)-
177 , (rl_command_func_t *)-
178 ((void *)0) -
179 }-
180};-
181-
182int-
183rl_add_funmap_entry (const char *name, rl_command_func_t *function)-
184{-
185 if (funmap_entry + 2 >= funmap_size
funmap_entry +...>= funmap_sizeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
186 {-
187 funmap_size += 64;-
188 funmap = (FUNMAP **)xrealloc (funmap, funmap_size * sizeof (FUNMAP *));-
189 }
never executed: end of block
0
190-
191 funmap[funmap_entry] = (FUNMAP *)xmalloc (sizeof (FUNMAP));-
192 funmap[funmap_entry]->name = name;-
193 funmap[funmap_entry]->function = function;-
194-
195 funmap[++funmap_entry] = (FUNMAP *)-
196 ((void *)0)-
197 ;-
198 return
never executed: return funmap_entry;
funmap_entry;
never executed: return funmap_entry;
0
199}-
200-
201static int funmap_initialized;-
202-
203-
204void-
205rl_initialize_funmap (void)-
206{-
207 register int i;-
208-
209 if (funmap_initialized
funmap_initializedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
210 return;
never executed: return;
0
211-
212 for (i = 0; default_funmap[i].name
default_funmap[i].nameDescription
TRUEnever evaluated
FALSEnever evaluated
; i++)
0
213 rl_add_funmap_entry (default_funmap[i].name, default_funmap[i].function);
never executed: rl_add_funmap_entry (default_funmap[i].name, default_funmap[i].function);
0
214-
215 funmap_initialized = 1;-
216 funmap_program_specific_entry_start = i;-
217}
never executed: end of block
0
218-
219-
220-
221-
222const char **-
223rl_funmap_names (void)-
224{-
225 const char **result;-
226 int result_size, result_index;-
227-
228-
229 rl_initialize_funmap ();-
230-
231 for (result_index = result_size = 0, result = (const char **)-
232 ((void *)0)-
233 ; funmap[result_index]
funmap[result_index]Description
TRUEnever evaluated
FALSEnever evaluated
; result_index++)
0
234 {-
235 if (result_index + 2 > result_size
result_index + 2 > result_sizeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
236 {-
237 result_size += 20;-
238 result = (const char **)xrealloc (result, result_size * sizeof (char *));-
239 }
never executed: end of block
0
240-
241 result[result_index] = funmap[result_index]->name;-
242 result[result_index + 1] = (char *)-
243 ((void *)0)-
244 ;-
245 }
never executed: end of block
0
246-
247 qsort (result, result_index, sizeof (char *), (QSFUNC *)_rl_qsort_string_compare);-
248 return
never executed: return (result);
(result);
never executed: return (result);
0
249}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2