* lpd -- line printer daemon dispatcher
char dpd
[] = "/usr/spool/lpd";
char dfname
[30] = "/usr/spool/lpd/";
char lock
[] = "/usr/spool/lpd/lock";
* The remaining part is the line printer interface.
if((lpf
= fopen(lp
, "w")) == NULL
)
if((ibuf
= fopen(&line
[1], "r")) == NULL
)
* Copy file ibuf to lpf arranging that no
* backspaces will appear in the output. Courtesy ARK
char b1
[BSIZE
], b2
[BSIZE
];
while ((c
= getc(ibuf
)) != EOF
) {
if (cp
>= size1
|| b1
[cp
] == ' ') {
if (cp
< size2
&& b2
[cp
] != ' ')
trouble(s
, a1
, a2
, a3
, a4
)
fprintf(pmail
, "Your lpr printer job is done.\n");
for(lsw
=0; s
[lsw
] && lsw
<5; lsw
++);
fprintf(lpf
, "\n\n\n\n\n\n\n\n");
t
= chrtab
[*sp
- ' '][i
];
fprintf(lpf
, "\n\n\n\n\n\n\n\n");
fprintf(lpf
, ctime(&timeb
));