bug-readline
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-readline] [PATCH] Enable visibility annotations


From: Chet Ramey
Subject: Re: [Bug-readline] [PATCH] Enable visibility annotations
Date: Wed, 20 Apr 2016 14:16:11 -0700
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.7.2

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    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]