From: "Wiles, Roger Keith" <keith.wiles@windriver.com>
To: "<dev@dpdk.org>" <dev@dpdk.org>
Subject: [dpdk-dev] RFC on changing cmdline_set_prompt()
Date: Wed, 1 Oct 2014 17:27:54 +0000 [thread overview]
Message-ID: <5AE577D4-4DB2-4A26-AB34-FC9ECB536AE2@windriver.com> (raw)
I was needing cmdline_set_prompt(struct cmdline * cl, const char * prompt) to be more dynamic with the prompt.
What I would like to be able to do is change the prompt on the fly in my Pktgen-DPDK application. The reason is I have added some limited ANSI color support and would like to remove the color sequence codes when color support is turned off.
I could just call cmdline_set_prompt() again with the new prompt, which would the simplest method.
But what is the fun in that design and being a programmer I was thinking about making it even more complex :-)
I was thinking about adding a function pointer to cmdline_set_prompt(cl, “Foobar>”, myGet_prompt) or replacing cmdline_set_prompt(cl, myGet_prompt); or adding a new set prompt function to add a function callback routine cmdline_set_prompt_callback(cl, myGet_prompt); Where ‘char * myGet_prompt(struct cmdline *cl);’
Comments?
Thanks
++Keith
Keith Wiles, Principal Technologist with CTO office, Wind River mobile 972-213-5533
reply other threads:[~2014-10-01 17:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=5AE577D4-4DB2-4A26-AB34-FC9ECB536AE2@windriver.com \
--to=keith.wiles@windriver.com \
--cc=dev@dpdk.org \
/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;
as well as URLs for NNTP newsgroup(s).