linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan-Benedict Glaw <jbglaw@lug-owl.de>
To: linux-c-programming <linux-c-programming@vger.kernel.org>
Subject: Re: stdio
Date: Wed, 18 Jun 2003 14:02:17 +0200	[thread overview]
Message-ID: <20030618120217.GM6353@lug-owl.de> (raw)
In-Reply-To: <011801c33580$48425aa0$e764a8c0@fesnel.noip.org>

[-- Attachment #1: Type: text/plain, Size: 1402 bytes --]

On Wed, 2003-06-18 05:58:42 -0400, John T. Williams <jtwilliams@vt.edu>
wrote in message <011801c33580$48425aa0$e764a8c0@fesnel.noip.org>:
> I am trying to figure out how to cause a character to be printed to a
> specific place on the terminal
> 
> what I'm actually trying to accomplish is to make a progress bar
> 
> example:
> 
> Progress [*****                           ]  25%
> 
> and I want it to fill up the box with stars as my program progresses, but I
> can't figure out how to just get c to write a single '*'  to anywhere other
> then the end of the streak
> I tried lseek and got no good results.

Well, what you want to do sounds quite simple, but it's really quite
complicated. The basic problem is that there are thousands of different
terminal types out there which need different control sequences to
position the cursor (if possible at all). You would need to know all of
them to be portable.

Because that would be a real PITA, this functionality has been placed
into some libraries. Look for libncurses (of libtermcap) to do this
task...

MfG, JBG

-- 
   Jan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481
   "Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg
    fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!
      ret = do_actions((curr | FREE_SPEECH) & ~(IRAQ_WAR_2 | DRM | TCPA));

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2003-06-18 12:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-18  9:58 stdio John T. Williams
2003-06-18 12:02 ` Jan-Benedict Glaw [this message]
2003-06-18 12:17 ` stdio Luciano Moreira - igLnx
2003-06-18 13:04 ` stdio Stephen Satchell
2003-06-18 17:45   ` stdio Glynn Clements
2003-06-18 18:30 ` stdio Chris Nanakos
2003-06-19  7:33   ` I'm really starting to dislike stdio John T. Williams
2003-06-19 11:26     ` Jan-Benedict Glaw
2003-06-19 17:39       ` Glynn Clements
2003-06-19 12:56     ` Andrés Roldán

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=20030618120217.GM6353@lug-owl.de \
    --to=jbglaw@lug-owl.de \
    --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).