tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: tn3270, mset and map3270



In article <4B8B883B.4040302%NetBSD.org@localhost>
roy%NetBSD.org@localhost writes:

> On 28/02/2010 23:17, ITOH Yasufumi wrote:
> > 3. implement termcap as an emulation on terminfo
> >
> >     terminfo programs:
> >     terminfo database ------------------+
> >     termcap database  ->  (cap to info) -+->  program
> >     termcap programs:
> >     terminfo database ------------------+
> >     termcap database  ->  (cap to info) -+->  (info to cap) ->  program
> >
> > Why you are going to most complex implementation (3)?
> 
> It's not as complex as you make out.
> Both termcap(3) and terminfo(3) calls return data from the terminfo 
> database. As every program pass this to tgoto(3) for termcap, or 
> tputs(3) for terminfo the diagram goes like this

termcap program can use a capability string as a normal string,
for comparison etc., in addition to feeding to tgoto/tputs.

> terminfo programs:
> terminfo database ----> program
> 
> termcap programs:
> terminfo database ----> program
> 
> Why don't you go and readup on what I've implemented, as you're making 
> assumptions about how it must work and how complex it must be which is 
> definitely not the case.

This is not enough to implement termcap interface.
Your termcap implementation needs modified to support capabilities
which are not handled by terminfo.
Since the formats of tputs/tgoto differ between terminfo and termcap,
passing terminfo string directly to termcap program causes compatibility
problems (and vice versa).

So the implementation needs to be changed eventually something like
(note "termcap database" includes $TERMCAP)

>3. implement termcap as an emulation on terminfo
>   terminfo programs:
>       terminfo database ------------------+
>       termcap database  -> (cap to info) -+->  program
>   termcap programs:
>       terminfo database ------------------+
>       termcap database  -> (cap to info) -+->  (info to cap) ->  program

or

   terminfo programs:
        terminfo database ------------------+
        termcap database  -> (cap to info) -+->  program
   termcap programs:
        terminfo database -> (info to cap) -+
        termcap database  ------------------+->  program

and either one is more complex than 2, which I propose.

Regards,
-- 
ITOH Yasufumi


Home | Main Index | Thread Index | Old Index