Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rochester!pt.cs.cmu.edu!ius2.cs.cmu.edu!edw From: edw@ius2.cs.cmu.edu (Eddie Wyatt) Newsgroups: comp.unix.questions,comp.unix.wizards,comp.lang.c Subject: Re: Filtering Everything Message-ID: <1097@ius2.cs.cmu.edu> Date: Sun, 12-Apr-87 13:55:38 EST Article-I.D.: ius2.1097 Posted: Sun Apr 12 13:55:38 1987 Date-Received: Sun, 19-Apr-87 09:35:36 EST References: <919@watmum.UUCP> Distribution: comp Organization: Carnegie-Mellon University, CS/RI Lines: 34 Xref: mnetor comp.unix.questions:1942 comp.unix.wizards:1941 comp.lang.c:1749 In article <919@watmum.UUCP>, smvorkoetter@watmum.UUCP writes: > > > I wish to write a program in C that I can somehow set up so all output > to my terminal goes through it first, and all input from my terminal goes > through it too. I thought of a simple filter using read() and write(), > but it only seems to pass things through when a CR is received or sent. > I want immediate filtering. My eventual aim is to write an inline data > compression routine to speed up 1200 baud terminal use (esp. in vi) to > something approximating 2400 baud. Can anyone point me in the right > direction for such a project. Thanks. You will want to make a call to either 'ioctl' or 'stty' to set 'cbreaks' on (cbreaks - does not buffer input or output of characters. ei make character available as soon as they are typed) and raw mode on (raw mode - does no processing of character input. ei. parity bits are passed back, erase and interrupt characters are not executed.) You may want to take a look at Huffman codes and other variations of frequency depended codes. -- Eddie Wyatt They say there are strangers, who threaten us In our immigrants and infidels They say there is strangeness, too dangerous In our theatres and bookstore shelves Those who know what's best for us- Must rise and save us from ourselves Quick to judge ... Quick to anger ... Slow to understand... Ignorance and prejudice and fear [all] Walk hand in hand. - RUSH