Progga wrote:

> > See the manpage for setupterm() and tigetstr() for more information.
> 
>  Should it be like this ? 
> 
> 
> <code>
>     char *area[100], bp[2048] ;
> 
>     tgetent( bp, getenv( "TERM" )) ;
>     puts( tgetstr( "cl", area )) ;
> </code>

First, that's the old termcap interface; new programs should use the
terminfo interface.

Second, the use of the "area" variable is wrong. It should be
something like:

        char buf[100];
        char *area = buf;
        
        puts(tgetstr("cl", &area));

Repeated calls to tgetstr() will advance the "area" pointer, so that
"buf" will contain, in order, all of the strings retrieved by
tgetstr().

-- 
Glynn Clements <[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" 
in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to