Fix latent bug with custom word point completers
[binutils-gdb.git] / gdb / completer.h
index e81243a7211e9e7ca234000de109e26cd02cf94e..27371b63a5763ff28c19350e1b92a4ae2038964b 100644 (file)
@@ -17,7 +17,7 @@
 #if !defined (COMPLETER_H)
 #define COMPLETER_H 1
 
-#include "gdb_vecs.h"
+#include "common/gdb_vecs.h"
 #include "command.h"
 
 /* Types of functions in struct match_list_displayer.  */
@@ -357,7 +357,7 @@ public:
   { 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.  */
@@ -510,6 +510,13 @@ extern void complete_line (completion_tracker &tracker,
                           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