From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 69444 invoked by alias); 20 Apr 2016 21:16:38 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 69435 invoked by uid 89); 20 Apr 2016 21:16:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1387, H*MI:sk:94eb2c1, emulated, pay X-HELO: mpv1-2015.case.edu Received: from mpv2-2015.CWRU.Edu (HELO mpv1-2015.case.edu) (129.22.103.227) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 20 Apr 2016 21:16:27 +0000 Received: from mpv8-2015.CWRU.Edu (EHLO mpv8-2015.case.edu) ([129.22.103.210]) by mpv2-2015.case.edu (MOS 4.4.7-GA FastPath queued) with ESMTP id AEY25937; Wed, 20 Apr 2016 17:16:14 -0400 (EDT) Received: from 70.103.56.130 (EHLO jenna.local) ([70.103.56.130]) by mpv8-2015.case.edu (MOS 4.4.7-GA FastPath queued) with ESMTP id CBK75307 (AUTH cpr); Wed, 20 Apr 2016 17:16:13 -0400 (EDT) Reply-To: chet.ramey@case.edu Subject: Re: [Bug-readline] [PATCH] Enable visibility annotations References: <94eb2c1232a01a28910530c65c78@google.com> To: Doug Evans , Pedro Alves Cc: chet.ramey@case.edu, Yury Gribov , bug-readline@gnu.org, Vyacheslav Barinov , Yury Usishchev , "gdb@sourceware.org" , Jan Kratochvil From: Chet Ramey Message-ID: <5717F19B.2030605@case.edu> Date: Wed, 20 Apr 2016 21:16:00 -0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <94eb2c1232a01a28910530c65c78@google.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Junkmail-Whitelist: YES (by domain whitelist at mpv2-2015.case.edu) X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.5717F19F.00C8,ss=1,re=0.000,fgs=0, ip=70.103.56.130, so=2015-08-12 04:07:17, dmn=2011-05-27 18:58:46 X-Mirapoint-Loop-Id: 8999c6d9e03779b87422a45de8e6d88f X-SW-Source: 2016-04/txt/msg00040.txt.bz2 On 4/18/16 11:16 AM, Doug Evans wrote: > There are two aspects to this: > 1) some _rl_ state vars are referenced > 2) some _rl_ functions are used > > If there's a public way to access the _rl_ vars, great. For the ones that correspond to bindable readline variables, it's easy, though you may have to pay a small conversion cost. Use rl_get_variable_value (char *varname) and handle the return value appropriately. For boolean variables, use something like bash's RL_BOOLEAN_VARIABLE_VALUE. For numbers, use strtol. The other one is probably _rl_echoing_p, and I just added rl_tty_set_echoing (int value) to set it and return the previous value. > As for the _rl_ functions, I think there are two: > _rl_erase_entire_line This can be emulated the way bash-4.3 does it: ce = rl_get_termcap ("ce"); if (ce) { fprintf (rl_outstream "\r"); fprintf (rl_outstream, "%s", ce); /* or use tputs like bash */ fprintf (rl_outstream, "\r"); /* optional */ fflush (rl_outstream); } That's pretty much exactly what _rl_erase_entire_line does. > _rl_qsort_string_compare This is the standard compare-two-strings-for-qsort function that exists everywhere. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/