[sac-dev] readline/libedit patch

Kuang He icrazy at gmail.com
Thu Oct 9 16:36:08 PDT 2008


Dear Brian,

Attached is a patch (on top of my original patches) that does the following:

- define HAVE_LIBEDIT and HAVE_READLINE, and get rid of the original
READLINE in configure.in
- update corresponding source code due to the above change
- Consolidate zgpmsg() implementations in src/co/zgpmsg.c
- reverse part of a previous change in Makefile.in's that intends to
get rid of duplicate -I../inc, which would also cause a compile
failure however

Best regards,

-- 
Kuang He
Department of Physics
University of Connecticut
Storrs, CT 06269-3046

Tel: +1.860.486.4919
Web: http://www.phys.uconn.edu/~he/



On Tue, Oct 7, 2008 at 3:14 PM, Brian Savage <savage at uri.edu> wrote:
> Kuang
>
> I was looking at your readline patch to handle the real readline library
> when used with a script.
> http://www.iris.washington.edu/pipermail/sac-dev/2008-September/000109.html
>
> It looks like when the tty is not being used (use_tty()) you avoid the
> select_loop().
> This seems fine with me.  We also have very similar code in the zgtmsg() and
> the code you added looks a lot like the original zgpmsg() code.  Can we do
> some
> consolidation here, possibly just within the zgpmsg() to begin with. and
> include code
> when with HAVE_LIBEDIT or HAVE_READLINE ( currently just READLINE) is true.
> To make the the code easier to handle in the future I would prefer the
> libedit and
> readline behave the same way if a tty is, or is not, encountered.
>
> - Use the select_loop() while in a tty session.
> - Avoid the select_loop() while no tty is available
> - Avoid the select_loop() while no line handling is available
>
> How about something like:
>
> #ifdef HAVE_READLINE || HAVE_LIBEDIT
> if( use_tty() ) {
>        select_loop()
> } else {
> #endif /* HAVE READLINE || HAVE_LIBEDIT */
>
>         getfline()
>
> #ifdef HAVE_READLINE || HAVE_LIBEDIT
> }
> #endif /* HAVE READLINE || HAVE_LIBEDIT */
>
> For reference:
> zgtmsg() is only called from
> src/exm/xpause.c
> src/exm/xnews.c
> src/cpf/cresp.c  (Standard Error Recovery, not sure this is used)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zgpmsg-consolidation.patch
Type: application/octet-stream
Size: 11843 bytes
Desc: not available
URL: <http://www.iris.washington.edu/pipermail/sac-dev/attachments/20081009/39d87b60/attachment-0001.obj>


More information about the sac-dev mailing list