Re: some problems with do_*_ca_mode()



On Thu, 24 Nov 2005, Andrey V. Malyshev wrote:

JN> #ifdef HAVE_SLANG
JN>   SLtt_write_string (ti_cap);
JN> #else
JN>   putp (ti_cap);
JN> #endif
JN> and similarly for the te_cap.

I argee, of course. Modified patch is attached.

You could also just fprintf the string to stdout. As far as I can see the main aim of your patch is to get the information out of terminfo.

also I think that the test

   if ((!xterm_flag)||(!ti_cap))
      return;

can simply be

   if (!ti_cap)
     return;

JN> The question is whether not to call SLtt_initialize () and friends in
JN> case of slang instead as slang takes care of setting proper ti/te
JN> sequences itself.

Hmm. For now we combine this approaches: we call SLtt_initialize (), we  let
slang to take care of init itselt and prepare the SLtt_tgetstr() to work.
And then we use it to obtain ti/te sequences using proper slang mechanisms.

And the same in ncurses case, BTW.

The main points are:

from main():

#ifdef HAVE_SLANG
(1)    slang_init () -> [ SLtt_get_terminfo() -> SLtt_initialize() ->
Term_Init_Str = SLtt_tgetstr ("ti") ]
#else
(2)    init_curses () -> [ initscr() -> setupterm() ]
#endif
       init_xterm_support ();

Using [] brackets I've marked slang internal code at (1) and ncurses
internal code at (2).
The "Term_Init_Str" is internal slang variable, and it is unavailable for us
in common case. This is correct for current mcslang and libslang-1.4.9 both.

So, what prevents us from calling the same SLtt_tgetstr ("ti") routine from
init_xterm_support() under "#ifdef HAVE_SLANG"?

it's just double work... look here:
main() -> init_curses() -> [ SLsmg_init_smg() -> tt_init_video() (set to SLtt_init_video()) -> tt_write_string (Term_Init_Str); ]

Bart




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