avr-libc-dev
[Top][All Lists]
Advanced

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

Re: [avr-libc-dev] fgets


From: Joerg Wunsch
Subject: Re: [avr-libc-dev] fgets
Date: Mon, 2 Feb 2004 20:25:56 +0100
User-agent: Mutt/1.2.5i

As Kang Tin LAI wrote:

> For stdin, says: fgets(buf, 128, stdin);
> 
> Key in characters should be echo back to stdout?

Nope, this is not the responsibility of fgets().  Say, you've got a
different stream than stdin, how should fgets() decide where to echo
it to?

It has always been the responsibility of the underlying device driver
to perform an echo if desired.

You can find a simple `line-mode' input driver implementation in

http://www.ifbus.de/~joerg/inptest.c

This implementation provides the usual echo, and basic editing
functionality (erase last char, word, entire line) in the way done by
the common Unix tty drivers.
-- 
J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]