readline support in samba

Simo Sorce simo.sorce at polimi.it
Fri Feb 23 22:55:33 GMT 2001


On Wed, 21 Feb 2001, Andrew Tridgell wrote:

> Simo,
>
> > Well, I don't know for the first 2 point (a configure and Makefile
> > triggering is needed obviously), but I solved the last point in another
> > software using the provided rl_callback_handler_install() and a
> > select/rl_callback_read_char() on stdin, it think it may apply there
> > eliminating the need of timers and signals.
>
> I wasn't aware of those hooks. I've just had a look at the info pages
> and they do look like they will do nicely.
>
> > Readline is pretty nice, if the solution above is good enough I hope you
> > will consider to save readline.>
> Could you code up a patch to the head branch and submit it?
>
> My preferred solution would be to write wrappers around
> rl_callback_handler_install() which work on systems without readline
> (obviously without readline functionality). That would keep the code
> neat.
>
> Cheers, Tridge
>

Here it is a simple patch.
Stil does not use wrappers around rl_ functions,
it will fall back to the fgets if readline is not present.

I had to disable the use of history too, because with the callback method
readline does not deal really well with prompt and history.
Setting prompt will show it before the command output.
Unsetting it but setting history will have a bad behaviour.
(it is simpler to see then explain that, try uncommenting the few /* */
lines between #ifdef HAVE_LIBREADLINE statements in client/client.c and
testing history in smbclient)

Just look at it and tell if it is near to what you feel is the solution,
I will be on holiday next week, but I may work on it as soon as I return!

Simo.

-- 
Simo Sorce - Linux Systems Consultant
E-mail: simo.sorce at polimi.it
Tel: +39 0348 7149179 - Fax: +39 02 700442399
-----------------------------------------------------------------
Be happy, use Linux!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: readline-patch-20010223.gz
Type: application/x-gzip
Size: 2480 bytes
Desc: 
Url : http://lists.samba.org/archive/samba-technical/attachments/20010223/0300037c/readline-patch-20010223.bin


More information about the samba-technical mailing list