* 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 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.
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)
{
#include "value.h"
#include "vec.h"
#include "ax.h"
+#include "command.h"
struct value;
struct block;
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);
}
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. */
}
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
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(). */
/* Python symbol name. */
char *name;
/* Completion function. */
- char **(*completer) (struct cmd_list_element *, char *, char *);
+ completer_ftype *completer;
};
static struct cmdpy_completer completers[] =