Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Chet Ramey <chet.ramey@case.edu>
To: Doug Evans <dje@google.com>, Pedro Alves <palves@redhat.com>
Cc: chet.ramey@case.edu, Yury Gribov <y.gribov@samsung.com>,
	       bug-readline@gnu.org,
	Vyacheslav Barinov <v.barinov@samsung.com>,
	       Yury Usishchev <y.usishchev@samsung.com>,
	       "gdb@sourceware.org" <gdb@sourceware.org>,
	       Jan Kratochvil <jan.kratochvil@redhat.com>
Subject: Re: [Bug-readline] [PATCH] Enable visibility annotations
Date: Wed, 20 Apr 2016 21:16:00 -0000	[thread overview]
Message-ID: <5717F19B.2030605@case.edu> (raw)
In-Reply-To: <94eb2c1232a01a28910530c65c78@google.com>

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/


  parent reply	other threads:[~2016-04-20 21:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-18 18:16 Doug Evans
2016-04-20  6:02 ` Yury Gribov
2016-04-20  9:22   ` Pedro Alves
2016-04-20  9:45     ` Yury Gribov
2016-04-20 10:19       ` Pedro Alves
2016-04-20 10:55         ` Yury Gribov
2016-04-20 15:30           ` Chet Ramey
2016-04-20 21:16 ` Chet Ramey [this message]
2016-04-22 14:43   ` Pedro Alves
2016-04-22 15:25     ` Chet Ramey
     [not found] <570F38DD.1030703@samsung.com>
     [not found] ` <570F3C7E.30005@samsung.com>
     [not found]   ` <570F7554.7070901@redhat.com>
     [not found]     ` <570FB04D.2060107@case.edu>
2016-04-14 15:19       ` Pedro Alves

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=5717F19B.2030605@case.edu \
    --to=chet.ramey@case.edu \
    --cc=bug-readline@gnu.org \
    --cc=dje@google.com \
    --cc=gdb@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=palves@redhat.com \
    --cc=v.barinov@samsung.com \
    --cc=y.gribov@samsung.com \
    --cc=y.usishchev@samsung.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