This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]