static char SccsId
[] = "@(#)cpr.c 1.8 %G%";
** CPR -- print on concept 108
** This filter arranges to output onto a printer connected
** to a Concept 108 terminal. It probably works on other
** models in the Concept 100 series also.
** -f form feed following to print.
#define LINELEN 132 /* carriage width */
int SysLinePid
; /* pid of sysline process */
bool FormFeedFollowing
; /* print form feed following print */
bool EchoDuringPrint
; /* echo on terminal while printing */
/* arrange to stop the sysline program during printing */
FormFeedFollowing
= TRUE
;
/* be nice on interrupts, etc. */
signal(SIGINT
, cleanterm
);
/* set the terminal to output to printer */
/* print the appropriate files */
if (freopen(p
, "r", stdin
) == NULL
)
/* reset terminal to a nice state */
printf("\033 5%s\033|", buf
);
fprintf(stderr
, "Lost printer\n");
oldflags
= tbuf
.sg_flags
;
tbuf
.sg_flags
|= CBREAK
| XTABS
;
tbuf
.sg_flags
= oldflags
;
/* output trailing formfeed */
if (read(2, buf
, 1) <= 0 || buf
[0] != '\006')
kill(SysLinePid
, SIGCONT
);