Commit | Line | Data |
---|---|---|
c5f0f3d0 | 1 | /* Header for GDB line completion. |
32d0add0 | 2 | Copyright (C) 2000-2015 Free Software Foundation, Inc. |
c5f0f3d0 FN |
3 | |
4 | This program is free software; you can redistribute it and/or modify | |
5 | it under the terms of the GNU General Public License as published by | |
a9762ec7 | 6 | the Free Software Foundation; either version 3 of the License, or |
c5f0f3d0 FN |
7 | (at your option) any later version. |
8 | ||
9 | This program is distributed in the hope that it will be useful, | |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | GNU General Public License for more details. | |
13 | ||
14 | You should have received a copy of the GNU General Public License | |
a9762ec7 | 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
c5f0f3d0 FN |
16 | |
17 | #if !defined (COMPLETER_H) | |
18 | #define COMPLETER_H 1 | |
19 | ||
49c4e619 | 20 | #include "gdb_vecs.h" |
7d793aa9 | 21 | #include "command.h" |
49c4e619 | 22 | |
82083d6d DE |
23 | /* Types of functions in struct match_list_displayer. */ |
24 | ||
25 | struct match_list_displayer; | |
26 | ||
27 | typedef void mld_crlf_ftype (const struct match_list_displayer *); | |
28 | typedef void mld_putch_ftype (const struct match_list_displayer *, int); | |
29 | typedef void mld_puts_ftype (const struct match_list_displayer *, | |
30 | const char *); | |
31 | typedef void mld_flush_ftype (const struct match_list_displayer *); | |
32 | typedef void mld_erase_entire_line_ftype (const struct match_list_displayer *); | |
33 | typedef void mld_beep_ftype (const struct match_list_displayer *); | |
34 | typedef int mld_read_key_ftype (const struct match_list_displayer *); | |
35 | ||
36 | /* Interface between CLI/TUI and gdb_match_list_displayer. */ | |
37 | ||
38 | struct match_list_displayer | |
39 | { | |
40 | /* The screen dimensions to work with when displaying matches. */ | |
41 | int height, width; | |
42 | ||
43 | /* Print cr,lf. */ | |
44 | mld_crlf_ftype *crlf; | |
45 | ||
46 | /* Not "putc" to avoid issues where it is a stdio macro. Sigh. */ | |
47 | mld_putch_ftype *putch; | |
48 | ||
49 | /* Print a string. */ | |
50 | mld_puts_ftype *puts; | |
51 | ||
52 | /* Flush all accumulated output. */ | |
53 | mld_flush_ftype *flush; | |
54 | ||
55 | /* Erase the currently line on the terminal (but don't discard any text the | |
56 | user has entered, readline may shortly re-print it). */ | |
57 | mld_erase_entire_line_ftype *erase_entire_line; | |
58 | ||
59 | /* Ring the bell. */ | |
60 | mld_beep_ftype *beep; | |
61 | ||
62 | /* Read one key. */ | |
63 | mld_read_key_ftype *read_key; | |
64 | }; | |
65 | ||
66 | extern void gdb_display_match_list (char **matches, int len, int max, | |
67 | const struct match_list_displayer *); | |
68 | ||
49c4e619 | 69 | extern VEC (char_ptr) *complete_line (const char *text, |
1834676b | 70 | const char *line_buffer, |
49c4e619 | 71 | int point); |
83d31a92 | 72 | |
aff410f1 MS |
73 | extern char *readline_line_completion_function (const char *text, |
74 | int matches); | |
d75b5104 | 75 | |
49c4e619 | 76 | extern VEC (char_ptr) *noop_completer (struct cmd_list_element *, |
6f937416 | 77 | const char *, const char *); |
d75b5104 | 78 | |
49c4e619 | 79 | extern VEC (char_ptr) *filename_completer (struct cmd_list_element *, |
6f937416 | 80 | const char *, const char *); |
c5f0f3d0 | 81 | |
49c4e619 | 82 | extern VEC (char_ptr) *expression_completer (struct cmd_list_element *, |
6f937416 | 83 | const char *, const char *); |
65d12d83 | 84 | |
49c4e619 | 85 | extern VEC (char_ptr) *location_completer (struct cmd_list_element *, |
6f937416 | 86 | const char *, const char *); |
c94fdfd0 | 87 | |
49c4e619 | 88 | extern VEC (char_ptr) *command_completer (struct cmd_list_element *, |
6f937416 | 89 | const char *, const char *); |
db60ec62 | 90 | |
de0bea00 | 91 | extern VEC (char_ptr) *signal_completer (struct cmd_list_element *, |
6f937416 | 92 | const char *, const char *); |
de0bea00 | 93 | |
71c24708 AA |
94 | extern VEC (char_ptr) *reg_or_group_completer (struct cmd_list_element *, |
95 | const char *, const char *); | |
96 | ||
c5f0f3d0 FN |
97 | extern char *get_gdb_completer_quote_characters (void); |
98 | ||
67c296a2 PM |
99 | extern char *gdb_completion_word_break_characters (void); |
100 | ||
7d793aa9 SDJ |
101 | /* Set the word break characters array to the corresponding set of |
102 | chars, based on FN. This function is useful for cases when the | |
103 | completer doesn't know the type of the completion until some | |
104 | calculation is done (e.g., for Python functions). */ | |
105 | ||
106 | extern void set_gdb_completion_word_break_characters (completer_ftype *fn); | |
107 | ||
c5f0f3d0 FN |
108 | /* Exported to linespec.c */ |
109 | ||
d7561cbb KS |
110 | extern const char *skip_quoted_chars (const char *, const char *, |
111 | const char *); | |
4e87b832 | 112 | |
d7561cbb | 113 | extern const char *skip_quoted (const char *); |
c5f0f3d0 FN |
114 | |
115 | #endif /* defined (COMPLETER_H) */ |