Deleted Added
full compact
printjob.c (80230) printjob.c (83684)
1/*
2 * Copyright (c) 1983, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 29 unchanged lines hidden (view full) ---

38 The Regents of the University of California. All rights reserved.\n";
39#endif /* not lint */
40
41#ifndef lint
42/*
43static char sccsid[] = "@(#)printjob.c 8.7 (Berkeley) 5/10/95";
44*/
45static const char rcsid[] =
1/*
2 * Copyright (c) 1983, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 29 unchanged lines hidden (view full) ---

38 The Regents of the University of California. All rights reserved.\n";
39#endif /* not lint */
40
41#ifndef lint
42/*
43static char sccsid[] = "@(#)printjob.c 8.7 (Berkeley) 5/10/95";
44*/
45static const char rcsid[] =
46 "$FreeBSD: head/usr.sbin/lpr/lpd/printjob.c 80230 2001-07-23 23:13:39Z gad $";
46 "$FreeBSD: head/usr.sbin/lpr/lpd/printjob.c 83684 2001-09-20 01:04:50Z gad $";
47#endif /* not lint */
48
49
50/*
51 * printjob -- print jobs in the queue.
52 *
53 * NOTE: the lock file is used to pass information to lpq and lprm.
54 * it does not need to be removed because file locks are dynamic.

--- 348 unchanged lines hidden (view full) ---

403 * L -- "literal" user's name to print on banner
404 * T -- "title" for pr
405 * H -- "host name" of machine where lpr was done
406 * P -- "person" user's login name
407 * I -- "indent" amount to indent output
408 * R -- laser dpi "resolution"
409 * f -- "file name" name of text file to print
410 * l -- "file name" text file with control chars
47#endif /* not lint */
48
49
50/*
51 * printjob -- print jobs in the queue.
52 *
53 * NOTE: the lock file is used to pass information to lpq and lprm.
54 * it does not need to be removed because file locks are dynamic.

--- 348 unchanged lines hidden (view full) ---

403 * L -- "literal" user's name to print on banner
404 * T -- "title" for pr
405 * H -- "host name" of machine where lpr was done
406 * P -- "person" user's login name
407 * I -- "indent" amount to indent output
408 * R -- laser dpi "resolution"
409 * f -- "file name" name of text file to print
410 * l -- "file name" text file with control chars
411 * o -- "file name" postscript file, according to
412 * the RFC. Here it is treated like an 'f'.
411 * p -- "file name" text file to print with pr(1)
412 * t -- "file name" troff(1) file to print
413 * n -- "file name" ditroff(1) file to print
414 * d -- "file name" dvi file to print
415 * g -- "file name" plot(1G) file to print
416 * v -- "file name" plain raster file to print
417 * c -- "file name" cifplot file to print
418 * 1 -- "R font file" for troff

--- 202 unchanged lines hidden (view full) ---

621 stopped = 0; /* output filter is not stopped */
622
623 /* everything seems OK, start it up */
624 if (!pp->no_formfeed && !pp->tof) { /* start on a fresh page */
625 (void) write(ofd, pp->form_feed, strlen(pp->form_feed));
626 pp->tof = 1;
627 }
628 if (pp->filters[LPF_INPUT] == NULL
413 * p -- "file name" text file to print with pr(1)
414 * t -- "file name" troff(1) file to print
415 * n -- "file name" ditroff(1) file to print
416 * d -- "file name" dvi file to print
417 * g -- "file name" plot(1G) file to print
418 * v -- "file name" plain raster file to print
419 * c -- "file name" cifplot file to print
420 * 1 -- "R font file" for troff

--- 202 unchanged lines hidden (view full) ---

623 stopped = 0; /* output filter is not stopped */
624
625 /* everything seems OK, start it up */
626 if (!pp->no_formfeed && !pp->tof) { /* start on a fresh page */
627 (void) write(ofd, pp->form_feed, strlen(pp->form_feed));
628 pp->tof = 1;
629 }
630 if (pp->filters[LPF_INPUT] == NULL
629 && (format == 'f' || format == 'l')) {
631 && (format == 'f' || format == 'l' || format == 'o')) {
630 pp->tof = 0;
631 while ((n = read(fi, buf, BUFSIZ)) > 0)
632 if (write(ofd, buf, n) != n) {
633 (void) close(fi);
634 return(REPRINT);
635 }
636 (void) close(fi);
637 return(OK);

--- 31 unchanged lines hidden (view full) ---

669 (void) close(p[1]); /* close output side */
670 (void) close(fi);
671 if (prchild < 0) {
672 prchild = 0;
673 (void) close(p[0]);
674 return(ERROR);
675 }
676 fi = p[0]; /* use pipe for input */
632 pp->tof = 0;
633 while ((n = read(fi, buf, BUFSIZ)) > 0)
634 if (write(ofd, buf, n) != n) {
635 (void) close(fi);
636 return(REPRINT);
637 }
638 (void) close(fi);
639 return(OK);

--- 31 unchanged lines hidden (view full) ---

671 (void) close(p[1]); /* close output side */
672 (void) close(fi);
673 if (prchild < 0) {
674 prchild = 0;
675 (void) close(p[0]);
676 return(ERROR);
677 }
678 fi = p[0]; /* use pipe for input */
679 case 'o': /* print postscript file */
680 /*
681 * For now, treat this as a plain-text file, and assume
682 * the standard LPF_INPUT filter will recognize that it
683 * is postscript and know what to do with it. These
684 * 'o'-file requests could come from MacOS 10.1 systems.
685 */
686 /* FALLTHROUGH */
677 case 'f': /* print plain text file */
678 prog = pp->filters[LPF_INPUT];
679 av[1] = width;
680 av[2] = length;
681 av[3] = indent;
682 n = 4;
683 break;
684 case 'l': /* like 'f' but pass control characters */

--- 1108 unchanged lines hidden ---
687 case 'f': /* print plain text file */
688 prog = pp->filters[LPF_INPUT];
689 av[1] = width;
690 av[2] = length;
691 av[3] = indent;
692 n = 4;
693 break;
694 case 'l': /* like 'f' but pass control characters */

--- 1108 unchanged lines hidden ---