/* Header for GDB line completion.
- Copyright (C) 2000-2018 Free Software Foundation, Inc.
+ Copyright (C) 2000-2020 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#if !defined (COMPLETER_H)
#define COMPLETER_H 1
-#include "gdb_vecs.h"
+#include "gdbsupport/gdb_vecs.h"
#include "command.h"
/* Types of functions in struct match_list_displayer. */
{ m_custom_word_point = point; }
/* Advance the custom word point by LEN. */
- void advance_custom_word_point_by (size_t len);
+ void advance_custom_word_point_by (int len);
/* Whether to tell readline to skip appending a whitespace after the
completion. See m_suppress_append_ws. */
const char *line_buffer,
int point);
+/* Complete LINE and return completion results. For completion purposes,
+ cursor position is assumed to be at the end of LINE. WORD is set to
+ the end of word to complete. QUOTE_CHAR is set to the opening quote
+ character if we found an unclosed quoted substring, '\0' otherwise. */
+extern completion_result
+ complete (const char *line, char const **word, int *quote_char);
+
/* Find the bounds of the word in TEXT for completion purposes, and
return a pointer to the end of the word. Calls the completion
machinery for a handle_brkchars phase (using TRACKER) to figure out
completion word point for TEXT, emulating the algorithm readline
uses to find the word point, using the current language's word
break characters. */
-
const char *advance_to_expression_complete_word_point
(completion_tracker &tracker, const char *text);
+/* Assuming TEXT is an filename, find the completion word point for
+ TEXT, emulating the algorithm readline uses to find the word
+ point. */
+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 complete_expression (completion_tracker &tracker,
const char *text, const char *word);
+/* Called by custom word point completers that want to recurse into
+ the completion machinery to complete a command. Used to complete
+ COMMAND in "thread apply all COMMAND", for example. Note that
+ unlike command_completer, this fully recurses into the proper
+ completer for COMMAND, so that e.g.,
+
+ (gdb) thread apply all print -[TAB]
+
+ does the right thing and show the print options. */
+extern void complete_nested_command_line (completion_tracker &tracker,
+ const char *text);
+
extern const char *skip_quoted_chars (const char *, const char *,
const char *);