From 9f60d481c28a949dc41179ecee5320ba1905398f Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Tue, 5 Feb 2002 04:37:23 +0000 Subject: * cli/cli-decode.c (do_cfunc, set_cmd_cfunc): New functions. (do_sfunc, set_cmd_sfunc): New functions. * command.h (struct cmd_list_element): Add field func. * cli/cli-decode.h (struct cmd_list_element): Ditto. * command.h (set_cmd_sfunc, set_cmd_cfunc): Declare. * cli/cli-decode.h: Ditto. * cli/cli-decode.c (help_cmd): Test for func not cfunc/sfunc. (help_all, help_cmd_list): Ditto. (find_cmd, complete_on_cmdlist): Ditto. * top.c (execute_command): Ditto. * cli/cli-setshow.c (do_setshow_command): Call func instead of function.sfunc. * infcmd.c (notice_args_read): Fix function signature. * cli/cli-cmds.c (init_cli_cmds): Use set_cmd_sfunc. * cli/cli-decode.c (add_set_cmd): Ditto. * utils.c (initialize_utils): Ditto. * maint.c (_initialize_maint_cmds): Ditto. * infrun.c (_initialize_infrun): Ditto. * demangle.c (_initialize_demangler): Ditto. * remote.c (add_packet_config_cmd): Ditto. * mips-tdep.c (_initialize_mips_tdep): Ditto. * cris-tdep.c (_initialize_cris_tdep): Ditto. * proc-api.c (_initialize_proc_api): Ditto. * kod.c (_initialize_kod): Ditto. * valprint.c (_initialize_valprint): Ditto. * top.c (init_main): Ditto. * infcmd.c (_initialize_infcmd): Ditto. * corefile.c (_initialize_core): Ditto. * arm-tdep.c (_initialize_arm_tdep): Ditto. * arch-utils.c (initialize_current_architecture): Ditto. (_initialize_gdbarch_utils): Ditto. * alpha-tdep.c (_initialize_alpha_tdep): Ditto. * cli/cli-decode.c (add_cmd): Use set_cmd_cfunc. * wince.c (_initialize_inftarg): Ditto. * symfile.c (_initialize_symfile): Ditto. * mips-tdep.c (_initialize_mips_tdep): Ditto. * language.c (_initialize_language): Ditto. * arc-tdep.c (_initialize_arc_tdep): Ditto. --- gdb/command.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'gdb/command.h') diff --git a/gdb/command.h b/gdb/command.h index 205fb90..c7d7b5e 100644 --- a/gdb/command.h +++ b/gdb/command.h @@ -127,7 +127,13 @@ struct cmd_list_element enum command_class class; /* Function definition of this command. NULL for command class - names and for help topics that are not really commands. */ + names and for help topics that are not really commands. NOTE: + cagney/2002-02-02: This function signature is evolving. For + the moment suggest sticking with either set_cmd_cfunc() or + set_cmd_sfunc(). */ + void (*func) (struct cmd_list_element *c, char *args, int from_tty); + /* The command's real callback. At present func() bounces through + to one of the below. */ union { /* If type is not_set_cmd, call it like this: */ @@ -277,6 +283,16 @@ extern struct cmd_list_element *add_abbrev_prefix_cmd (char *, struct cmd_list_element **); +/* Set the commands corresponding callback. */ + +extern void set_cmd_cfunc (struct cmd_list_element *cmd, + void (*cfunc) (char *args, int from_tty)); + +extern void set_cmd_sfunc (struct cmd_list_element *cmd, + void (*sfunc) (char *args, int from_tty, + struct cmd_list_element * c)); + + extern struct cmd_list_element *lookup_cmd (char **, struct cmd_list_element *, char *, int, int); -- cgit v1.1