C Interface for PRINT.COM -- Version 1.1, 21 Mar 87 1 C Interface for PRINT.COM -- Version 1.1, 21 Mar 87 1 These routines implement a low level interface to the DOS version 3, PRINT.COM multiplex interrupt (0x2F) functions. As such there is a one-to-one correspondence between these routines and the functions described in IBM's DOS Technical Reference. To use these routines, include PRINTQ.H in your program, and PRINTQ.OBJ (which was compiled using small model) in the list of modules for the linker. I built these routines using Microsoft C v4.0. Since I have never used any previous versions of the compiler, I have no idea whether these routines are compatible with previous versions. These routines do no error checking. They are simply a low level interface to the resident part of PRINT.COM which expects the non-resident part of PRINT.COM to perform ALL validation. These routines were originally distributed in a single arc file with the following contents: PRINTQ.C Source Code. PRINTQ.H Include file that defines the functions. PRINTQ.OBJ Object file. PRINTQ.TXT Printable, typable documentation. I am placing these routines in the public domain. Feel free to use them in whatever way you please. If you improve upon them please send me a copy. Scott G. Ainsworth 3870 Buchanan Drive Virginia Beach, VA 23456 Version 1.1, 21 March 1987, Scott Ainsworth.. Version 1.1, 21 March 1987, Scott Ainsworth.. I finally figured out how status was returned from function 1. It is really strange. If the submit works, either 0x12E0 or 0x3E01 is returned depending on whether the queue was empty before the submit request. So, I test to see if the returned value is greater than 0x1000; if it is, I assume the submit worked and return a zero from PrintSubmit. If the returned value is less than 0x1000, I assume the submit failed and return the value unchanged. C Interface for PRINT.COM -- Version 1.1, 21 Mar 87 2 C Interface for PRINT.COM -- Version 1.1, 21 Mar 87 2 PrintInstalled (function 0) PrintInstalled (function 0) This routine checks to see if PRINT.COM is Installed by calling the Multiplex Interrupt (0x2F). If it is, TRUE is returned; otherwise, FALSE is returned. PRINT.COM is multiplex number 1. The Get Installed State is function number 0. After the interrupt, AL is 0xFF if PRINT.COM is Installed. Parameters: None. Returns: TRUE or FALSE indicating if PRINT.COM is Installed. Calling Sequence: int Status; Status = PrintInstalled (); C Interface for PRINT.COM -- Version 1.1, 21 Mar 87 3 C Interface for PRINT.COM -- Version 1.1, 21 Mar 87 3 PrintSubmit (function 1) PrintSubmit (function 1) Queue a file to be printed. Return the an error code. The file must consist of a drive designator, full path, and full name. file names containing wild card characters are not allowed. Parameters: File -- Pointer to string containing name to be queued. Returns: Status: 0 = No error, file queued. 2 = File not found. 3 = Path not found. 4 = Too many open files. 5 = Access Denied. 8 = Queue Full. 9 = Busy. 12 = Name too long. 15 = Invalid Drive. Calling Sequence: char *File; int Status Status = PrintSubmit (File); C Interface for PRINT.COM -- Version 1.1, 21 Mar 87 4 C Interface for PRINT.COM -- Version 1.1, 21 Mar 87 4 PrintCancel (function 2) PrintCancel (function 2) Cancel one or more files from the queue. File names containing wild card characters are allowed. Parameters: File -- Pointer to string containing name to be canceled. Returns: Nothing. Calling Sequence: char *File; PrintCancel (File); PrintCancelAll (function 3) PrintCancelAll (function 3) Cancel printing of all files currently in the print queue. Parameters: None. Returns: Nothing. Calling Sequence: PrintCancelAll (); C Interface for PRINT.COM -- Version 1.1, 21 Mar 87 5 C Interface for PRINT.COM -- Version 1.1, 21 Mar 87 5 PrintStatus (function 4) PrintStatus (function 4) Freeze the print queue and return a pointer to the queue list and the number of errors encountered trying to write the last char to the print device. Parameters: ErrCnt -- Pointer to an integer in which to store error count. QueuePtr -- Pointer to a far pointer to char in which to store the address of the print queue. Returns: Nothing. Calling Sequence: int ErrCnt; char far*QueuePtr; PrintStatus (&QueuePtr, &ErrCnt); PrintStatusEnd (function 5) PrintStatusEnd (function 5) Release the queue from PrintStatus and return the status. Parameters: None. Returns: Nothing. Calling Sequence: PrintStatusEnd ();