* cli/cli-decode.h (add_set_boolean_cmd): Declare.
* command.h (add_set_boolean_cmd): Ditto.
* remote.c (_initialize_remote): Use add_set_boolean_cmd for "set
remotebreak"
+2001-09-29 Andrew Cagney <ac131313@redhat.com>
+
+ * cli/cli-decode.c (add_set_boolean_cmd): Define.
+ * cli/cli-decode.h (add_set_boolean_cmd): Declare.
+ * command.h (add_set_boolean_cmd): Ditto.
+ * remote.c (_initialize_remote): Use add_set_boolean_cmd for "set
+ remotebreak"
+
2001-09-29 Andrew Cagney <ac131313@redhat.com>
* gdbarch.sh (gdbarch_dump): Sort output.
return c;
}
+/* Add element named NAME to command list LIST (the list for set
+ or some sublist thereof).
+ CLASS is as in add_cmd.
+ VAR is address of the variable which will contain the value.
+ DOC is the documentation string. */
+struct cmd_list_element *
+add_set_boolean_cmd (char *name,
+ enum command_class class,
+ int *var,
+ char *doc,
+ struct cmd_list_element **list)
+{
+ static const char *boolean_enums[] = { "on", "off", NULL };
+ struct cmd_list_element *c;
+ c = add_set_cmd (name, class, var_boolean, var, doc, list);
+ c->enums = boolean_enums;
+ return c;
+}
+
/* 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). */
char *doc,
struct cmd_list_element **list);
+extern struct cmd_list_element *add_set_boolean_cmd (char *name,
+ enum command_class class,
+ int *var,
+ char *doc,
+ struct cmd_list_element **list);
+
extern struct cmd_list_element *add_show_from_set (struct cmd_list_element *,
struct cmd_list_element
**);
char *doc,
struct cmd_list_element **list);
+extern struct cmd_list_element *add_set_boolean_cmd (char *name,
+ enum command_class class,
+ int *var,
+ char *doc,
+ struct cmd_list_element **list);
+
extern struct cmd_list_element *add_show_from_set (struct cmd_list_element *,
struct cmd_list_element
**);
&maintenancelist);
add_show_from_set
- (add_set_cmd ("remotebreak", no_class,
- var_boolean, (char *) &remote_break,
- "Set whether to send break if interrupted.\n",
- &setlist),
+ (add_set_boolean_cmd ("remotebreak", no_class, &remote_break,
+ "Set whether to send break if interrupted.\n",
+ &setlist),
&showlist);
/* Install commands for configuring memory read/write packets. */