* command.c (add_set_cmd, no_just_help_class_command): Change

to make this the sfunc, not cfunc, since that is how we call it.
	* command.h: Comment difference between sfunc and cfunc.
	* demangle.c (set_demangling_command): Add third arg since that
	is how it is called.
	(_initialize_demangler): Use sfunc, not cfunc, for
	set_demangling_command, since that is how it is called.
	Remove show_demangling_command; it has no effect.
This commit is contained in:
Jim Kingdon 1994-02-02 20:20:59 +00:00
parent 5b3591ab5c
commit 719d9abbd2
3 changed files with 20 additions and 23 deletions

View File

@ -1,5 +1,14 @@
Wed Feb 2 11:16:45 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
* command.c (add_set_cmd, no_just_help_class_command): Change
to make this the sfunc, not cfunc, since that is how we call it.
* command.h: Comment difference between sfunc and cfunc.
* demangle.c (set_demangling_command): Add third arg since that
is how it is called.
(_initialize_demangler): Use sfunc, not cfunc, for
set_demangling_command, since that is how it is called.
Remove show_demangling_command; it has no effect.
* command.c (shell_escape): Report errors correctly (with error
message from strerror).

View File

@ -192,9 +192,10 @@ add_abbrev_prefix_cmd (name, class, fun, doc, prefixlist, prefixname,
/* ARGSUSED */
void
not_just_help_class_command (args, from_tty)
not_just_help_class_command (args, from_tty, c)
char *args;
int from_tty;
struct cmd_list_element *c;
{
}
@ -214,17 +215,15 @@ add_set_cmd (name, class, var_type, var, doc, list)
char *doc;
struct cmd_list_element **list;
{
/* For set/show, we have to call do_setshow_command
differently than an ordinary function (take commandlist as
well as arg), so the function field isn't helpful. However,
function == NULL means that it's a help class, so set the function
to not_just_help_class_command. */
struct cmd_list_element *c
= add_cmd (name, class, not_just_help_class_command, doc, list);
= add_cmd (name, class, NO_FUNCTION, doc, list);
c->type = set_cmd;
c->var_type = var_type;
c->var = var;
/* This needs to be something besides NO_FUNCTION so that this isn't
treated as a help class. */
c->function.sfunc = not_just_help_class_command;
return c;
}

View File

@ -70,17 +70,6 @@ static const struct demangler
{NULL, unknown_demangling, NULL}
};
/* show current demangling style. */
static void
show_demangling_command (ignore, from_tty)
char *ignore;
int from_tty;
{
/* done automatically by show command. */
}
/* set current demangling style. called by the "set demangling" command
after it has updated the current_demangling_style_string to match
what the user has entered.
@ -98,9 +87,10 @@ show_demangling_command (ignore, from_tty)
a malloc'd string, even if it is a null-string. */
static void
set_demangling_command (ignore, from_tty)
char *ignore;
int from_tty;
set_demangling_command (ignore, from_tty, c)
char *ignore;
int from_tty;
struct cmd_list_element *c;
{
const struct demangler *dem;
@ -181,8 +171,7 @@ _initialize_demangler ()
Use `set demangle-style' without arguments for a list of demangling styles.",
&setlist);
show = add_show_from_set (set, &showlist);
set -> function.cfunc = set_demangling_command;
show -> function.cfunc = show_demangling_command;
set -> function.sfunc = set_demangling_command;
/* Set the default demangling style chosen at compilation time. */
set_demangling_style (DEFAULT_DEMANGLING_STYLE);