static char SccsId
[] = "@(#)cpr.c 1.3 %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.
/* be nice on interrupts, etc. */
signal(SIGINT
, cleanterm
);
/* set the terminal to output to printer */
/* print the appropriate files */
if (freopen(*++argv
, "r", stdin
) == NULL
)
/* reset terminal to a nice state */
while (fgets(buf
, sizeof buf
, stdin
) != NULL
)
printf("\033 5%s\033|", buf
);
fprintf(stderr
, "Lost printer\n");
oldflags
= tbuf
.sg_flags
;
tbuf
.sg_flags
= oldflags
;
if (read(2, buf
, 1) <= 0 || buf
[0] != '\006')