AAA_README.TXT for:                                           15-Nov-2004

     Drain-Printer, TOOLS, Capture a print stream into a file

See SETUP_DETAILS.TXT as well as the very lengthy comments at the beginning
of the source code for all the details ... an overview follows here.

Drain-Printer has been tested on DEC-C v6.2 on both VAX/VMS 6.2 and
AXP/VMS 7.2-1 with Multinet 4.3; other TCP/IP stacks may require some
modifications; there is a good chance it will work just fine on other
versions of Multinet and OpenVMS.

Drain-Printer (or simply DRAIN) is defined as a TCP/IP service, listening on a
high numbered port. Then a local TCP/IP print queue (call it TARGET, using raw
mode (TELNET)) is defined to point to "LOCALHOST:high-numbered-port". When a
local or external application prints to the TARGET queue (using either raw
Telnet or LPR to get there, or just the OpenVMS PRINT command), the print
stream will be re-transmitted to the high numbered port and this program will 
process it.

Drain-Printer attempts to pretty up the final output by removing excess
carriage return (CR) characters and breaking lines with imbedded form feed
(FF) characters into distinct lines;  this code is based strictly on the
formatting done by the Multinet stream printer symbiont.

In summary, Drain-Printer accepts all the raw input and creates a temporary
file in the Multinet_Spool: secure directory. After receiving the entire
printout, Drain-Printer optionally will spawn a subprocess to execute an
arbitrary DCL command file to do special processing of your choosing on that
temporary file. Then Drain-Printer will read the temporary file and pretty it
up as it creates an arbitrary output file. When it is finished processing the
file, Drain-Printer optionally will spawn another subprocess to execute
another arbitrary DCL command file to do additional special processing.

The two DCL command files as well as the final output file are all defined by
logical names that include the port number Drain-Printer listens on. By using
the port (or socket id) in this manner, any number of simultaneous instances
of Drain-Printer can be active, each with different settings.

An example of a simple configuration would have Drain-Printer just creating
TEST.LIS in DUA2:[VERNE] whenever a printout was LPR'ed to the queue TEST3 
on node britton.wvnet.edu.

This is my first large attempt at working in C and also working with socket
services, so I'm sure my code could use some cleaning up; being a beginner
is also why there are so many comments in the source  :-)   I'm sure there
could be more error checking and automatic recovery logic.

This was written with just plain text in mind; I would be shocked if it
worked at all with any binary or graphic information.


Feedback and suggestions are welcome !!


NOTE:

Drain-Printer is an expansion on an older program by Aaron Leonard; the first
copy I found was called DRAIN_TO_FILE and was posted to comp.os.vms on
November 11, 1997 under "SUBJ: Re: Multinet LPD Queue to File?" (and also to
vmsnet.sysmgt on October 10, 1997).



Verne
-----------------------------------------------------------------------
Verne Britton, Lead Systems Programmer     voice: (304) 293-5192 x230
Systems Support Group                      (in WV, call 1-800-253-1558)
West Virginia Network for                  FAX:   (304) 293-5540
     Educational Telecomputing             verne@wvnet.edu
837 Chestnut Ridge Road                    http://vaxa.wvnet.edu/~verne
Morgantown, WV  26505
