* breakpoint.c (add_catch_command): Use completer_ftype.
authorTom Tromey <tromey@redhat.com>
Wed, 13 Jun 2012 15:41:24 +0000 (15:41 +0000)
committerTom Tromey <tromey@redhat.com>
Wed, 13 Jun 2012 15:41:24 +0000 (15:41 +0000)
* breakpoint.h: Include command.h.
(add_catch_command): Use completer_ftype.
* cli/cli-decode.c (set_cmd_completer): Use completer_ftype.
* cli/cli-decode.h (struct cmd_list_element) <completer>:
Use completer_ftype.
* command.h (completer_ftype): New typedef.
(set_cmd_completer): Use it.
* python/py-cmd.c (struct cmdpy_completer) <completer>: Use
completer_ftype.

gdb/ChangeLog
gdb/breakpoint.c
gdb/breakpoint.h
gdb/cli/cli-decode.c
gdb/cli/cli-decode.h
gdb/command.h
gdb/python/py-cmd.c

index 4befbd40b5d4ca08f40b054ddd787a5e59762387..d36c764151256417302137b62e733de79019922e 100644 (file)
@@ -1,3 +1,16 @@
+2012-06-13  Tom Tromey  <tromey@redhat.com>
+
+       * breakpoint.c (add_catch_command): Use completer_ftype.
+       * breakpoint.h: Include command.h.
+       (add_catch_command): Use completer_ftype.
+       * cli/cli-decode.c (set_cmd_completer): Use completer_ftype.
+       * cli/cli-decode.h (struct cmd_list_element) <completer>:
+       Use completer_ftype.
+       * command.h (completer_ftype): New typedef.
+       (set_cmd_completer): Use it.
+       * python/py-cmd.c (struct cmdpy_completer) <completer>: Use
+       completer_ftype.
+
 2012-06-13  Pedro Alves  <palves@redhat.com>
 
        Partial revert of previous change.
index 9c4348fda4e255d63d7723def50d9be6430a925d..8e9029871e1ae909c174e4f985ce2334fa261fde 100644 (file)
@@ -15200,8 +15200,7 @@ void
 add_catch_command (char *name, char *docstring,
                   void (*sfunc) (char *args, int from_tty,
                                  struct cmd_list_element *command),
-                   char **(*completer) (struct cmd_list_element *cmd,
-                                         char *text, char *word),
+                  completer_ftype *completer,
                   void *user_data_catch,
                   void *user_data_tcatch)
 {
index a957b6f3cd5baaffc940b87027ff327209f9b1e7..2ad80d64af124dd63d8f80f24a631fc96721cfe4 100644 (file)
@@ -23,6 +23,7 @@
 #include "value.h"
 #include "vec.h"
 #include "ax.h"
+#include "command.h"
 
 struct value;
 struct block;
@@ -1187,8 +1188,7 @@ extern void
   add_catch_command (char *name, char *docstring,
                     void (*sfunc) (char *args, int from_tty,
                                    struct cmd_list_element *command),
-                    char **(*completer) (struct cmd_list_element *cmd,
-                                         char *text, char *word),
+                    completer_ftype *completer,
                     void *user_data_catch,
                     void *user_data_tcatch);
 
index 2dc8192e1571dddbb772f9fdab94ce151fff8c5d..2974d113f51bf1b369c5881574ab54e7442bcb48 100644 (file)
@@ -119,9 +119,7 @@ cmd_type (struct cmd_list_element *cmd)
 }
 
 void
-set_cmd_completer (struct cmd_list_element *cmd,
-                  char **(*completer) (struct cmd_list_element *self,
-                                       char *text, char *word))
+set_cmd_completer (struct cmd_list_element *cmd, completer_ftype *completer)
 {
   cmd->completer = completer; /* Ok.  */
 }
index 6027123f5ae373c9034fc812bda16c14d688190f..b5e0790649233a70cb235f3c6b8b8cfb53e19b52 100644 (file)
@@ -168,8 +168,7 @@ struct cmd_list_element
        For example, suppose TEXT is "foo" and we want to complete to
        "foobar".  If WORD is "oo", return "oobar"; if WORD is
        "baz/foo", return "baz/foobar".  */
-    char **(*completer) (struct cmd_list_element *cmd, 
-                        char *text, char *word);
+    completer_ftype *completer;
 
     /* Destruction routine for this command.  If non-NULL, this is
        called when this command instance is destroyed.  This may be
index c18e2dd842a5f16b171b43bacba13c37c20327d6..eba3a5b9571540c38b69a796a01f4a5613ccb993 100644 (file)
@@ -149,9 +149,9 @@ typedef void cmd_sfunc_ftype (char *args, int from_tty,
 extern void set_cmd_sfunc (struct cmd_list_element *cmd,
                           cmd_sfunc_ftype *sfunc);
 
-extern void set_cmd_completer (struct cmd_list_element *,
-                              char **(*completer) (struct cmd_list_element *,
-                                                   char *, char *));
+typedef char **completer_ftype (struct cmd_list_element *, char *, char *);
+
+extern void set_cmd_completer (struct cmd_list_element *, completer_ftype *);
 
 /* HACK: cagney/2002-02-23: Code, mostly in tracepoints.c, grubs
    around in cmd objects to test the value of the commands sfunc().  */
index 04476db5387811b92898844f3f6f63ee9860b436..605c8c002eb797d939648b0045e0d01e649b5bd6 100644 (file)
@@ -35,7 +35,7 @@ struct cmdpy_completer
   /* Python symbol name.  */
   char *name;
   /* Completion function.  */
-  char **(*completer) (struct cmd_list_element *, char *, char *);
+  completer_ftype *completer;
 };
 
 static struct cmdpy_completer completers[] =