/* lpr.c - fancy paginator for laserprinters * * Author: Mark Taylor * * Modifications: * * 12/85 Mark Zbikowski rewrite to work cleaner * 4/3/86 MZ Single print jobs will advance page * 4/3/86 MZ use tools.ini for default printer setup * 4/20/86 Mike Hanson add banner, etc (add features to make like * lpr from PS, extensively reorganized, etc) * 6/6/86 Jay Sipelstein added S and L options to printer desc. * Trim trailing blanks and blank lines. * Set mode before raw printing. * 7/8/86 Byron Bishop Add -q to cause print queue to be printed. * Fixed bug so -# and -e flags take priority * over default settings. Runs of blanks * replaced by escape sequences to reduce * file size. * 8/31/86 Craig Wittenberg Added support for PostScript. Used the VMI * on the LaserJet instead of line/inch to get 62 * lines on one page (two for header). Cleaned * up iLine (now rowLine) and indentation. * 10/10/86 John Rae-Grant Added -g flag to allow gutter in portrait mode. * $USER can now be a list of directories to * search for tools.ini in. Default printer can * be specified in tools.ini file. Modified * landscape mode page numbering to avoid three * hole punch obliteration. * 1/27/87 Craig Wittenberg Cleaned up whole program; no change in * functionality. * 1/28/87 Thom Landsberger Added CB and CZ (=default) flags to the LJ * printer description to support the 'Z' font * cartridge in landscape mode * 3/23/87 Thom Landsberger Port to Xenix 286 and 68k; environment * setting of parameters accepted as default * and with higher priority than tools.ini/.pprrc; * implemented -m, -M, -c command switches; * restructured command interpretation. * 4/10/87 Craig Wittenberg interrupt signal ignored if that is the * status when ppr is started * 4/14/87 Thom Landsberger only pure digit strings accepted as * numeric command line arguments * 6/05/87 Thom Landsberger double sided printing on HP LJ 2000; * '/' no switch character on Xenix; * 'ppr -q -' now does print from stdin. * 7/5/87 Craig Wittenberg changed fDuplex? names to f?Duplex so they * compile in 68k Xenix. Invoked ftp with command * line arguments rather than printing the commands * to stdin. -t now removes label (used to require * -m ""). * * Ppr reads /etc/default/ppr if there is not * $HOME/.pprrc. Duplex printing now does not * print on the back of the banner page (even if * not raw). Added -s flag: disables messages * which indicate ppr's progress. Changed the PS * setup to avoid VMErrors. Allowed the default * printer in the tools.ini/.pprrc file to have * options (e.g. default=lpt1, LJ L). Changed the * default printer on Xenix from net9 to net. * * ~8/1/87 Ralph Ryan Ported to OS/2 LanManager * * 11/24/87 Craig Wittenberg Rearranged sources - mostly to isloate the OS * specific network routines in lplow.c * Ppr now uses clem as the transfer machine for * DOS print jobs when /usr/eu/bin/ppr is not * present (indicating a machine in another * division). * * 12/2/87 Alan Bauer Version 2.5 * Final porting to OS/2 LAN Manager. Mainly * polished up network routines to work properly * Released to OS/2 people, DOSENV, NEWENV, and * new 68K version. * * 3/17/88 Alan Bauer Version 2.6 * Fixed so that the username is still printed in * lower left corner of the file listing when the * "no banner" option is specified (ppr -b0). * Ppr -? now prints to stdout rather than stderr. * Now supports ppr -q for OS/2. * * 4/04/88 Alan Bauer Version 2.7 * Added -c option to print copies of the * specified files. * Seperates large print jobs into roughly 100K * amounts. * Better feed back on PRINTING progress. * Fixed so that an empty password is now passed to * mkalias correctly (Xenix 386 version). * Now map ppr -p "xenix name" to * "mkalias name name printing [password]". * Errors opening input files no longer abort; just * go on to the next file. * * 4/05/88 Alan Bauer Version 2.71 * Fixed problem with last file to be printed * putting the current print job over 100K, * therefore causing new print job to be performed * (with no more files to be printed). * * 4/13/88 Alan Bauer Version 2.8 * Added ability to specify options in TOOLS.INI * file. * * 5/19/88 Alan Bauer Version 2.81 * Fixed General Protection Fault in OS/2 dealing * with login usernames which are more than 12 * characters long. * * 6/20/88 Alan Bauer Version 2.82 * Fixed LANMAN error message handling problems * and a bug where ppr failed if redirection to * the same printer as established in the environ- * ment variable was already set up. * * 3/3/89 Robert Hess Version 2.9 * Completely changed PostScript support. * Added 'PC' (Portrait Condensed) and 'PSF' * (PostScriptFile) printer specific switches. * * 3/22/89 Robert Hess Version 2.10 * Modifications to how 'FormFeed' was handled * for PostScript usage. * * 7/12/89 Robert Hess Version 2.11 * Fixed a bug that prevented lengthy Postscript * files to be printed. * * 9/14/89 Robert Hess Version 2.12 * Fixed -M option in PostScript code. * Fixed the 'opts=