IAAA_README.TXT for: 15-Nov-2004= Drain-Printer, TOOLS, Capture a print stream into a fileKSee SETUP_DETAILS.TXT as well as the very lengthy comments at the beginningDof the source code for all the details ... an overview follows here.CDrain-Printer has been tested on DEC-C v6.2 on both VAX/VMS 6.2 andEAXP/VMS 7.2-1 with Multinet 4.3; other TCP/IP stacks may require someEmodifications; there is a good chance it will work just fine on other!versions of Multinet and OpenVMS.NDrain-Printer (or simply DRAIN) is defined as a TCP/IP service, listening on aNhigh numbered port. Then a local TCP/IP print queue (call it TARGET, using rawLmode (TELNET)) is defined to point to "LOCALHOST:high-numbered-port". When aJlocal or external application prints to the TARGET queue (using either rawITelnet or LPR to get there, or just the OpenVMS PRINT command), the printNstream will be re-transmitted to the high numbered port and this program will process it.GDrain-Printer attempts to pretty up the final output by removing excessJcarriage return (CR) characters and breaking lines with imbedded form feedH(FF) characters into distinct lines; this code is based strictly on the8formatting done by the Multinet stream printer symbiont.KIn summary, Drain-Printer accepts all the raw input and creates a temporaryHfile in the Multinet_Spool: secure directory. After receiving the entireHprintout, Drain-Printer optionally will spawn a subprocess to execute anLarbitrary DCL command file to do special processing of your choosing on thatMtemporary file. Then Drain-Printer will read the temporary file and pretty itMup as it creates an arbitrary output file. When it is finished processing theGfile, Drain-Printer optionally will spawn another subprocess to executeGanother arbitrary DCL command file to do additional special processing.MThe two DCL command files as well as the final output file are all defined byMlogical names that include the port number Drain-Printer listens on. By usingLthe port (or socket id) in this manner, any number of simultaneous instances=of Drain-Printer can be active, each with different settings.KAn example of a simple configuration would have Drain-Printer just creatingKTEST.LIS in DUA2:[VERNE] whenever a printout was LPR'ed to the queue TEST3 on node britton.wvnet.edu.KThis is my first large attempt at working in C and also working with socketJservices, so I'm sure my code could use some cleaning up; being a beginnerJis also why there are so many comments in the source :-) I'm sure there:could be more error checking and automatic recovery logic.GThis was written with just plain text in mind; I would be shocked if it5worked at all with any binary or graphic information.'Feedback and suggestions are welcome !!NOTE:MDrain-Printer is an expansion on an older program by Aaron Leonard; the firstFcopy I found was called DRAIN_TO_FILE and was posted to comp.os.vms onLNovember 11, 1997 under "SUBJ: Re: Multinet LPD Queue to File?" (and also to#vmsnet.sysmgt on October 10, 1997).VerneG-----------------------------------------------------------------------EVerne Britton, Lead Systems Programmer voice: (304) 293-5192 x230GSystems Support Group (in WV, call 1-800-253-1558)@West Virginia Network for FAX: (304) 293-5540: Educational Telecomputing verne@wvnet.eduG837 Chestnut Ridge Road http://vaxa.wvnet.edu/~verneMorgantown, WV 26505