This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Add add_setshow_zinteger_cmd
- From: Andrew Cagney <cagney at gnu dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Fri, 07 May 2004 09:36:30 -0400
- Subject: [commit] Add add_setshow_zinteger_cmd
Missing, so added
Andrew
2004-05-07 Andrew Cagney <cagney@redhat.com>
* cli/cli-decode.c (add_setshow_zinteger_cmd): New function.
* command.h (add_setshow_zinteger_cmd): Declare.
Index: command.h
===================================================================
RCS file: /cvs/src/src/gdb/command.h,v
retrieving revision 1.37
diff -p -u -r1.37 command.h
--- command.h 24 Oct 2003 17:37:03 -0000 1.37
+++ command.h 7 May 2004 13:34:45 -0000
@@ -272,6 +272,16 @@ extern void add_setshow_uinteger_cmd (ch
struct cmd_list_element **set_list,
struct cmd_list_element **show_list);
+extern void add_setshow_zinteger_cmd (char *name,
+ enum command_class class,
+ int *var,
+ char *set_doc,
+ char *show_doc,
+ cmd_sfunc_ftype *set_func,
+ cmd_sfunc_ftype *show_func,
+ struct cmd_list_element **set_list,
+ struct cmd_list_element **show_list);
+
extern struct cmd_list_element *add_show_from_set (struct cmd_list_element *,
struct cmd_list_element
**);
Index: cli/cli-decode.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-decode.c,v
retrieving revision 1.35
diff -p -u -r1.35 cli-decode.c
--- cli/cli-decode.c 10 Feb 2004 19:08:15 -0000 1.35
+++ cli/cli-decode.c 7 May 2004 13:34:45 -0000
@@ -472,6 +472,26 @@ add_setshow_uinteger_cmd (char *name,
NULL, NULL);
}
+/* Add element named NAME to both the set and show command LISTs (the
+ list for set/show or some sublist thereof). CLASS is as in
+ add_cmd. VAR is address of the variable which will contain the
+ value. SET_DOC and SHOW_DOR are the documentation strings. */
+void
+add_setshow_zinteger_cmd (char *name,
+ enum command_class class,
+ int *var, char *set_doc, char *show_doc,
+ cmd_sfunc_ftype *set_func,
+ cmd_sfunc_ftype *show_func,
+ struct cmd_list_element **set_list,
+ struct cmd_list_element **show_list)
+{
+ add_setshow_cmd_full (name, class, var_zinteger, var,
+ set_doc, show_doc,
+ set_func, show_func,
+ set_list, show_list,
+ NULL, NULL);
+}
+
/* Where SETCMD has already been added, add the corresponding show
command to LIST and return a pointer to the added command (not
necessarily the head of LIST). */