*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / completer.c
index 4274241b00e0f6757a93982693968ee0c6663e31..7eab42706e562cd8a4ce152ad6a6c1f4ddcbf783 100644 (file)
@@ -1,5 +1,5 @@
 /* Line completion stuff for GDB, the GNU debugger.
-   Copyright 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2001 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
 
 #include "defs.h"
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "expression.h"
 #include "filenames.h"         /* for DOSish file names */
+#include "language.h"
 
 #include "cli/cli-decode.h"
 
-/* FIXME: This is needed because of lookup_cmd_1().
-   We should be calling a hook instead so we eliminate the CLI dependency. */
+/* FIXME: This is needed because of lookup_cmd_1 ().  We should be
+   calling a hook instead so we eliminate the CLI dependency.  */
 #include "gdbcmd.h"
 
 /* Needed for rl_completer_word_break_characters() and for
    rl_filename_completion_function.  */
-#include <readline/readline.h>
+#include "readline/readline.h"
 
 /* readline defines this.  */
 #undef savestring
@@ -41,7 +42,8 @@
 
 /* Prototypes for local functions */
 static
-char *line_completion_function (const char *text, int matches, char *line_buffer,
+char *line_completion_function (const char *text, int matches, 
+                               char *line_buffer,
                                int point);
 
 /* readline uses the word breaks for two things:
@@ -51,13 +53,11 @@ char *line_completion_function (const char *text, int matches, char *line_buffer
    it does affect how much stuff M-? lists.
    (2) If one of the matches contains a word break character, readline
    will quote it.  That's why we switch between
-   gdb_completer_word_break_characters and
+   current_language->la_word_break_characters() and
    gdb_completer_command_word_break_characters.  I'm not sure when
    we need this behavior (perhaps for funky characters in C++ symbols?).  */
 
 /* Variables which are necessary for fancy command line editing.  */
-static char *gdb_completer_word_break_characters =
-" \t\n!@#$%^&*()+=|~`}{[]\"';:?/>.<,-";
 
 /* When completing on command names, we remove '-' from the list of
    word break characters, since we use it in command names.  If the
@@ -90,12 +90,6 @@ static char *gdb_completer_quote_characters = "'";
 \f
 /* Accessor for some completer data that may interest other files. */
 
-char *
-get_gdb_completer_word_break_characters (void)
-{
-  return gdb_completer_word_break_characters;
-}
-
 char *
 get_gdb_completer_quote_characters (void)
 {
@@ -251,7 +245,7 @@ location_completer (char *text, char *word)
          colon = p;
          symbol_start = p + 1;
        }
-      else if (strchr (gdb_completer_word_break_characters, *p))
+      else if (strchr (current_language->la_word_break_characters(), *p))
        symbol_start = p + 1;
     }
 
@@ -399,7 +393,7 @@ complete_line (const char *text, char *line_buffer, int point)
      '-' character used in some commands.  */
 
   rl_completer_word_break_characters =
-    gdb_completer_word_break_characters;
+    current_language->la_word_break_characters();
 
       /* Decide whether to complete on a list of gdb commands or on symbols. */
   tmp_command = (char *) alloca (point + 1);
@@ -674,7 +668,7 @@ line_completion_function (const char *text, int matches, char *line_buffer, int
     /* Make sure the word break characters are set back to normal for the
        next time that readline tries to complete something.  */
     rl_completer_word_break_characters =
-      gdb_completer_word_break_characters;
+      current_language->la_word_break_characters();
 #endif
 
   return (output);
@@ -696,7 +690,7 @@ skip_quoted_chars (char *str, char *quotechars, char *breakchars)
     quotechars = gdb_completer_quote_characters;
 
   if (breakchars == NULL)
-    breakchars = gdb_completer_word_break_characters;
+    breakchars = current_language->la_word_break_characters();
 
   for (scan = str; *scan != '\0'; scan++)
     {
This page took 0.026779 seconds and 4 git commands to generate.