linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Glynn Clements <glynn@gclements.plus.com>
To: Progga <abulfazl@juniv.edu>
Cc: linux-c-programming@vger.kernel.org
Subject: Re: clear the screen
Date: Mon, 28 Feb 2005 06:36:39 +0000	[thread overview]
Message-ID: <16930.48119.987267.500405@gargle.gargle.HOWL> (raw)
In-Reply-To: <20050223185457.A550@Imrashi.net.bd>


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 <glynn@gclements.plus.com>

      reply	other threads:[~2005-02-28  6:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-21  7:08 clear the screen kaushal
2005-02-21  7:59 ` J.
2005-02-21  9:56   ` Vinodkumar Nair
2005-02-21 10:12     ` YYW
2005-02-21 13:50       ` Darren Sessions
2005-02-21 14:15         ` Ron Michael Khu
2005-02-23  0:16 ` Glynn Clements
2005-02-23 12:54   ` Progga
2005-02-28  6:36     ` Glynn Clements [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16930.48119.987267.500405@gargle.gargle.HOWL \
    --to=glynn@gclements.plus.com \
    --cc=abulfazl@juniv.edu \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).