Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!amdahl!kucharsk From: kucharsk@uts.amdahl.com (William Kucharski) Newsgroups: comp.unix.questions Subject: Re: To curse or not to curse Keywords: curses Message-ID: <1cIi02Ph32aV01@amdahl.uts.amdahl.com> Date: 5 Jun 89 17:46:46 GMT References: <36@iisat.UUCP> Reply-To: kucharsk@amdahl.uts.amdahl.com (William Kucharski) Organization: Amdahl Coup, UTS Products Hen House Lines: 44 Here's a program which demonstrates one way of doing things: #include #include main() { int a,c; char ch[BUF]; struct termio o,t; if (ioctl(0, TCGETA, &o)) perror("ioctl: get"); t = o; t.c_lflag = 0; /* shut off everything */ t.c_cc[VEOF] = 1; /* MIN chars == 1 */ if (ioctl(0, TCSETA, &t)) perror("ioctl: set"); for (a = 0; a < BUF; a++) { c = getc(stdin); ch[a] = (char) c; printf("."); } ch[BUF] = '\0'; /* NULL terminate it */ printf("\n%s\n", ch); if (ioctl(0, TCSETA, &o)) perror("ioctl: set back"); } -- William Kucharski ARPA: kucharsk@uts.amdahl.com UUCP: ...!{ames,decwrl,sun,uunet}!amdahl!kucharsk Disclaimer: The opinions expressed above are my own, and may not agree with those of any other sentient being, not to mention those of my employer. So there.