* vpr -- Versatec printer filter
#define SETSTATE (('v'<<8)|1)
int sppmode
[] = {0400, 0, 0};
int pltmode
[] = {0200, 0, 0};
int clrcom
[] = {0404, 0, 0};
int termcom
[] = {0240, 0, 0};
int prtmode
[] = {0100, 0, 0};
/* vtex comes open on 3 from parent so don't feed paper after each file */
ioctl(1, SETSTATE
, prtmode
);
if ((out = fopen("/dev/vp0", "w")) == NULL) {
fprintf(stderr, "Can't open printer\n");
if (argc
> 2 && argv
[1][0]=='-' && argv
[1][1]=='b') {
if ((in
= fopen(argv
[1], "r")) == NULL
) {
fprintf(stderr
, "Can't find %s\n", argv
[1]);
fprintf(out, "Printer IO error\n");
if (ban
&& access("/usr/adm/vpacct", 02)>=0
&& freopen("/usr/adm/vpacct", "a", out
) !=NULL
) {
fprintf(out
, "%7.2f\t%s\n", npages
* (11.0 / 12.0), ban
);
if (lineno==0 && linebuf[0]==0 && nskipped<3) {
npages
= (lineno
+ EJLINE
- 1) / EJLINE
;
for (col
=0; col
<LINELN
; col
++) {
for (;;) switch (c
= getc(in
)) {
ioctl(fileno(out
), SETSTATE
, &pltmode
);
for (lp
=ovbuf
; lp
< &ovbuf
[LINELN
]; ) {
ioctl(fileno(out
), SETSTATE
, &prtmode
);
fprintf(stderr
, "Printer IO error\n");
fprintf(out
, "\n\n%s: %s", s
, ctime(&timeb
));
for (i
= 0; i
< LINELN
; i
++)
fprintf(out, "\n\n\n\n\n\n\n\n");
t = chrtab[*sp - ' '][i];
fprintf(out, "\n\n\n\n\n\n\n\n");
fprintf(out, ctime(&timeb));