Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uupsi!sunic!news.funet.fi!hydra!poros!kankkune From: kankkune@cs.Helsinki.FI (Risto Kankkunen) Newsgroups: comp.unix.programmer Subject: Re: termcap str + params -> control seq. How? Message-ID: <12738@hydra.Helsinki.FI> Date: 4 Apr 91 12:41:10 GMT References: <1991Apr02.223345.15465@buster.stafford.tx.us> Sender: news@cs.Helsinki.FI Organization: University of Helsinki, Department of Computer Science Lines: 34 Thanks for your answers. I asked: > What is the standard way to apply parameters to the termcap strings you > have read with tgetent? Peter da Silva suggested using tgoto. I was a bit hesitated to use that as the (SunOS) manual page implies it might contain much special case handling for cursor addressing: char * tgoto(cm, destcol, destline) char *cm; tgoto() returns a cursor addressing string decoded from cm to go to column destcol in line destline. It uses the external variables UP (from the up capability) and BC (if bc is given rather than bs) if necessary to avoid placing \n, ^D or ^@ in the returned string. tgoto also takes only two parameters, but in my case that would be sufficient. Buster Irby pointed out that in the curses(3x) manual page there is the function tparm(str, p1, p2, p3, ...), which seems to be just what I wanted. I had glanced also the curses documentation, but I had missed this. However, like Peter da Silva notes, this is a system V routine, and for portability my best bet is to use tgoto (and hope the cursor addressing special code doesn't mess things up). I just wonder, why there wasn't a tparm-like function in every termcap library from the beginning (the code must essentially be there in tgoto...). Risto Kankkunen kankkune@cs.Helsinki.FI (Internet) Department of Computer Science kankkunen@finuh (Bitnet) University of Helsinki, Finland ..!mcsun!uhecs!kankkune (UUCP)