Re: some problems with do_*_ca_mode()



Hello, Bart!
You wrote to "Andrey V. Malyshev" <amal krasn ru> on Thu, 24 Nov 2005
22:10:05 +1300 (NZDT):

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.
BO> You could also just fprintf the string to stdout.

Yes. But I prefer to use specialized routines :)
If manual tells: "All  terminfo strings [including the output of tparm]
should be printed with tputs or putp" then maybe it is mandatory in some
cases, maybe somewhere fprintf can work wrong? I dont know.

BO> As far as I can see the main aim of your patch is to get the
BO> information out of terminfo.
BO> also I think that the test
BO>     if ((!xterm_flag)||(!ti_cap))
BO>        return;
BO> can simply be
BO>     if (!ti_cap)
BO>       return;

I think, here we must decide basically: whether we want to print ti/te
_only_ if we have xterm_flag>0 (i.e. xterm-like terminal) or in any case
(when these capabilities exist in terminal description)? According to my
termcap (from FreeBSD 5.4) there are a good many non-xterm terminals
supporting ti/te.

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"?

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

You are right *. It is an overlook on my part :)
As far as I understand, using this we will necessarily need to add
SLsmg_reset_smg() call on exit, in slang_shutdown().

Lets answer the previous question (for ncurses case) and I'll rewrite the
patch once more.

(*) By the way: in the slvideo.c file is defined another  SLtt_init_video()
function. It what cases this file is used instead of sldisply.c? I could not
understand off-hand. Looks like MSDOS-version :)

-- 
With best regards, Andrey V. Malyshev.
E-mail: amal krasn ru 




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