const char *text,
int *quote_char);
+static void set_rl_completer_word_break_characters (const char *break_chars);
+
/* See completer.h. */
class completion_tracker::completion_hash_entry
complete_expression (tracker, text, word);
}
-/* See definition in completer.h. */
+/* Set the word break characters array to BREAK_CHARS. This function is
+ useful as const-correct alternative to direct assignment to
+ rl_completer_word_break_characters, which is "char *", not "const
+ char *". */
-void
+static void
set_rl_completer_word_break_characters (const char *break_chars)
{
rl_completer_word_break_characters = (char *) break_chars;
return (char *) rl_completer_word_break_characters;
}
-char *
-gdb_completion_word_break_characters ()
+/* Get the list of chars that are considered as word breaks for the current
+ command. This function does not throw any exceptions and is called from
+ readline. See gdb_completion_word_break_characters_throw for details. */
+
+static char *
+gdb_completion_word_break_characters () noexcept
{
/* New completion starting. */
current_completion.aborted = false;
hook. Wrapper around gdb_rl_attempted_completion_function_throw
that catches C++ exceptions, which can't cross readline. */
-char **
+static char **
gdb_rl_attempted_completion_function (const char *text, int start, int end)
{
/* Restore globals that might have been tweaked in
void
_initialize_completer ()
{
+ /* Setup some readline completion globals. */
+ rl_completion_word_break_hook = gdb_completion_word_break_characters;
+ rl_attempted_completion_function = gdb_rl_attempted_completion_function;
+ set_rl_completer_word_break_characters (default_word_break_characters ());
+
add_setshow_zuinteger_unlimited_cmd ("max-completions", no_class,
&max_completions, _("\
Set maximum number of completion candidates."), _("\
extern const char *advance_to_filename_complete_word_point
(completion_tracker &tracker, const char *text);
-extern char **gdb_rl_attempted_completion_function (const char *text,
- int start, int end);
-
extern void noop_completer (struct cmd_list_element *,
completion_tracker &tracker,
const char *, const char *);
completion_tracker &tracker,
const char *, const char *);
-extern char *gdb_completion_word_break_characters (void);
-
-/* Set the word break characters array to BREAK_CHARS. This function
- is useful as const-correct alternative to direct assignment to
- rl_completer_word_break_characters, which is "char *",
- not "const char *". */
-extern void set_rl_completer_word_break_characters (const char *break_chars);
-
/* Get the matching completer_handle_brkchars_ftype function for FN.
FN is one of the core completer functions above (filename,
location, symbol, etc.). This function is useful for cases when
write_history_p = 0;
/* Setup important stuff for command line editing. */
- rl_completion_word_break_hook = gdb_completion_word_break_characters;
- rl_attempted_completion_function = gdb_rl_attempted_completion_function;
- set_rl_completer_word_break_characters (default_word_break_characters ());
rl_completion_display_matches_hook = cli_display_match_list;
rl_readline_name = "gdb";
rl_terminal_name = getenv ("TERM");