This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch] Add cmd_sfunc_ftype and cmd_cfunc_ftype
- From: Andrew Cagney <ac131313 at cygnus dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Sat, 15 Jun 2002 15:55:21 -0400
- Subject: [patch] Add cmd_sfunc_ftype and cmd_cfunc_ftype
Just FYI,
Another minor tweek (getting ready for add_setshow_boolean_cmd()).
committed,
Andrew
2002-06-15 Andrew Cagney <ac131313@redhat.com>
* cli/cli-decode.c (set_cmd_cfunc): Update.
(set_cmd_sfunc): Update.
* command.h (cmd_cfunc_ftype, cmd_sfunc_ftype): Declare.
(set_cmd_sfunc, set_cmd_cfunc): Update.
* cli/cli-decode.h: Update.
Index: command.h
===================================================================
RCS file: /cvs/src/src/gdb/command.h,v
retrieving revision 1.30
diff -u -r1.30 command.h
--- command.h 15 Jun 2002 18:45:31 -0000 1.30
+++ command.h 15 Jun 2002 19:51:53 -0000
@@ -124,12 +124,14 @@
/* Set the commands corresponding callback. */
+typedef void cmd_cfunc_ftype (char *args, int from_tty);
extern void set_cmd_cfunc (struct cmd_list_element *cmd,
- void (*cfunc) (char *args, int from_tty));
+ cmd_cfunc_ftype *cfunc);
+typedef void cmd_sfunc_ftype (char *args, int from_tty,
+ struct cmd_list_element *c);
extern void set_cmd_sfunc (struct cmd_list_element *cmd,
- void (*sfunc) (char *args, int from_tty,
- struct cmd_list_element * c));
+ cmd_sfunc_ftype *sfunc);
extern void set_cmd_completer (struct cmd_list_element *cmd,
char **(*completer) (char *text, char *word));
Index: cli/cli-decode.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-decode.c,v
retrieving revision 1.21
diff -u -r1.21 cli-decode.c
--- cli/cli-decode.c 15 Jun 2002 18:45:32 -0000 1.21
+++ cli/cli-decode.c 15 Jun 2002 19:52:02 -0000
@@ -53,8 +53,7 @@
}
void
-set_cmd_cfunc (struct cmd_list_element *cmd,
- void (*cfunc) (char *args, int from_tty))
+set_cmd_cfunc (struct cmd_list_element *cmd, cmd_cfunc_ftype *cfunc)
{
if (cfunc == NULL)
cmd->func = NULL;
@@ -70,9 +69,7 @@
}
void
-set_cmd_sfunc (struct cmd_list_element *cmd,
- void (*sfunc) (char *args, int from_tty,
- struct cmd_list_element * c))
+set_cmd_sfunc (struct cmd_list_element *cmd, cmd_sfunc_ftype *sfunc)
{
if (sfunc == NULL)
cmd->func = NULL;
Index: cli/cli-decode.h
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-decode.h,v
retrieving revision 1.12
diff -u -r1.12 cli-decode.h
--- cli/cli-decode.h 15 Jun 2002 18:45:32 -0000 1.12
+++ cli/cli-decode.h 15 Jun 2002 19:52:03 -0000
@@ -69,12 +69,11 @@
to one of the below. */
union
{
- /* If type is not_set_cmd, call it like this: */
- void (*cfunc) (char *args, int from_tty);
-
- /* If type is set_cmd or show_cmd, first set the variables, and
- then call this. */
- void (*sfunc) (char *args, int from_tty, struct cmd_list_element * c);
+ /* If type is not_set_cmd, call it like this: */
+ cmd_cfunc_ftype *cfunc;
+ /* If type is set_cmd or show_cmd, first set the variables,
+ and then call this: */
+ cmd_sfunc_ftype *sfunc;
}
function;