4 * Simple filter to wrap ANSI media copy escape sequences around
5 * text on stdin. Writes /dev/tty to get around things that might be
6 * trapping stdout. This is actually a feature because it was written
7 * to be used with pine's personal print option set up to take "enscript"
8 * output and send it displayward to be captured/printed to a postscript
9 * device. Pine, of course, uses popen() to invoke the personal print
10 * command, and interprets stdout as diagnostic messages from the command.
12 * Michael Seibel, mikes@cac.washington.edu
33 if(argv
[n
][0] == '-'){
39 fprintf(stderr
,"unknown option: %c\n", argv
[n
][1]);
46 if((d
=open("/dev/tty",O_WRONLY
)) < 0){
51 write(d
,"\033[5i", 4);
52 while((n
=read(0, c
, BUFSIZ
)) > 0)
58 write(d
,"\033[4i", 4);