Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!quintus!ok From: ok@quintus.uucp (Richard A. O'Keefe) Newsgroups: comp.lang.c Subject: Re: Getchar w/wout echo Message-ID: <302@quintus.UUCP> Date: 22 Aug 88 21:50:19 GMT References: <371@marob.MASA.COM> <225800052@uxe.cso.uiuc.edu> <65197@sun.uucp> Sender: news@quintus.UUCP Reply-To: ok@quintus.UUCP (Richard A. O'Keefe) Organization: Quintus Computer Systems, Inc. Lines: 24 In article <65197@sun.uucp> alanf%smile@Sun.COM (Alan Fargusson) writes: >I have always thought that this was an omission in the stdio I/O library. >If turning echo on and off was defined as part of fread, fwrite, printf, ... >then there would be no problem. As it is now you kind of take your chances >with various version of UNIX, and non UNIX systems are hopeless (as far as >portability that is). (1) Don't forget, the C standard has to make sense on IBM mainframes, which do not use a character-at-a-time interface to their terminals. (2) The dpANS makes it clear that fgets() and getchar() are supposed to do the same things (in general), so if one of them echoes and the other doesn't, that's broken. (3) The story with respect to UNIX and MS-DOS is nowhere near as bad as has been made out: yes the terminal ioctl() calls differ between BSD and Sys V, but if you want to control features like echoing you should probably be using Curses, and while there are differences, they aren't _that_ great. There are implementations of Curses for MS-DOS, and even VMS tries to support that interface. I loathe Curses myself, but it _is_ a de facto standard, and is being used successfully by a lot of applications programmers. It seems to me that the appropriate thing to do is to propose that Curses be part of the next version of the C standard (perhaps as an optional module so that IBM won't have to bring their operating systems into the '70s).