From: Fernando Nasser <fnasser@redhat.com>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [rfa:cli] Add {set,get}_cmd_context() or set_cmd_ccfunc()
Date: Mon, 18 Mar 2002 09:06:00 -0000 [thread overview]
Message-ID: <3C961E27.34088BD7@redhat.com> (raw)
In-Reply-To: <3C797A8F.7040108@cygnus.com>
Andrew Cagney wrote:
>
> Hello,
>
> The current command mechanism doesn't provide a way for a call-back
> function (cfunc or sfunc) to bind a local state/context to a command.
> Consequently, it isn't possible to use a single callback function as a
> generic handler for a number of similar commands.
>
> For instance the ``set/show remote ...'' (remote.c) each require an
> individual wrapper function. By adding a context/state, it becomes
> possible for a common function to handle all cases.
>
> I can think of two ways of implementing this. Using:
>
> set_cmd_context() / get_cmd_context()
>
> as with this patch; or add a new callback function that takes an
> additional context parameter vis:
>
> set_cmd_ccfunc(cmd, void (*ccfunc) (c, cmd, tty, context), context);
>
> The choice, I think is pretty arbitrary and I'm happy to change it to
> either.
>
> Preference? Ok?
>
I prefer the first one (your patch), which I think is OK for check-in.
As nobody has objected or stated another preference so far I would
say you go ahead and commit your patch.
Thanks.
Fernando
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9
next prev parent reply other threads:[~2002-03-18 17:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-24 15:43 Andrew Cagney
2002-03-18 9:06 ` Fernando Nasser [this message]
2002-03-18 18:11 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3C961E27.34088BD7@redhat.com \
--to=fnasser@redhat.com \
--cc=ac131313@cygnus.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox