From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) by dpdk.org (Postfix) with ESMTP id C3CBF212 for ; Wed, 1 Oct 2014 19:21:09 +0200 (CEST) Received: from ALA-HCB.corp.ad.wrs.com (ala-hcb.corp.ad.wrs.com [147.11.189.41]) by mail.windriver.com (8.14.9/8.14.5) with ESMTP id s91HRtWG029660 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for ; Wed, 1 Oct 2014 10:27:55 -0700 (PDT) Received: from ALA-MBB.corp.ad.wrs.com ([169.254.1.18]) by ALA-HCB.corp.ad.wrs.com ([147.11.189.41]) with mapi id 14.03.0174.001; Wed, 1 Oct 2014 10:27:54 -0700 From: "Wiles, Roger Keith" To: "" Thread-Topic: RFC on changing cmdline_set_prompt() Thread-Index: AQHP3Z0IY05KSGnIi0KjYT6a1n5Ulg== Date: Wed, 1 Oct 2014 17:27:54 +0000 Message-ID: <5AE577D4-4DB2-4A26-AB34-FC9ECB536AE2@windriver.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.25.40.166] Content-Type: text/plain; charset="Windows-1252" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: [dpdk-dev] RFC on changing cmdline_set_prompt() X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Oct 2014 17:21:10 -0000 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 Pk= tgen-DPDK application. The reason is I have added some limited ANSI color s= upport 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 wou= ld the simplest method. But what is the fun in that design and being a programmer I was thinking ab= out making it even more complex :-) I was thinking about adding a function pointer to cmdline_set_prompt(cl, = =93Foobar>=94, myGet_prompt) or replacing cmdline_set_prompt(cl, myGet_prom= pt); or adding a new set prompt function to add a function callback routine= cmdline_set_prompt_callback(cl, myGet_prompt); Where =91char * myGet_promp= t(struct cmdline *cl);=92 Comments? Thanks ++Keith Keith Wiles, Principal Technologist with CTO office, Wind River mobile 972-= 213-5533