home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 September / Simtel20_Sept92.cdr / msdos / printer / printq11.arc / PRINTQ.TXT < prev   
Text File  |  1987-03-21  |  7KB  |  219 lines

  1.  
  2.  
  3.  
  4.           C Interface for PRINT.COM -- Version 1.1, 21 Mar 87             1          C Interface for PRINT.COM -- Version 1.1, 21 Mar 87             1
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.           These routines implement a low level interface to the DOS
  12.           version 3, PRINT.COM multiplex interrupt (0x2F) functions.  As
  13.           such there is a one-to-one correspondence between these routines
  14.           and the functions described in IBM's DOS Technical Reference.
  15.  
  16.           To use these routines, include PRINTQ.H in your program, and
  17.           PRINTQ.OBJ (which was compiled using small model) in the list of
  18.           modules for the linker.  I built these routines using Microsoft C
  19.           v4.0.  Since I have never used any previous versions of the
  20.           compiler, I have no idea whether these routines are compatible
  21.           with previous versions.
  22.  
  23.           These routines do no error checking.  They are simply a low level
  24.           interface to the resident part of PRINT.COM which expects the
  25.           non-resident part of PRINT.COM to perform ALL validation.
  26.  
  27.           These routines were originally distributed in a single arc file
  28.           with the following contents:
  29.  
  30.                PRINTQ.C       Source Code.
  31.                PRINTQ.H       Include file that defines the functions.
  32.                PRINTQ.OBJ     Object file.
  33.                PRINTQ.TXT     Printable, typable documentation.
  34.  
  35.           I am placing these routines in the public domain.  Feel free to
  36.           use them in whatever way you please.  If you improve upon them
  37.           please send me a copy.
  38.  
  39.           Scott G. Ainsworth
  40.           3870 Buchanan Drive
  41.           Virginia Beach, VA  23456
  42.  
  43.           
  44.  
  45.           Version 1.1, 21 March 1987, Scott Ainsworth..          Version 1.1, 21 March 1987, Scott Ainsworth..
  46.  
  47.           I finally figured out how status was returned from function 1.
  48.           It is really strange.  If the submit works, either 0x12E0 or
  49.           0x3E01 is returned depending on whether the queue was empty
  50.           before the submit request.  So, I test to see if the returned
  51.           value is greater than 0x1000; if it is, I assume the submit
  52.           worked and return a zero from PrintSubmit.  If the returned value
  53.           is less than 0x1000, I assume the submit failed and return the
  54.           value unchanged.
  55.  
  56.                                           
  57.  
  58.  
  59.           C Interface for PRINT.COM -- Version 1.1, 21 Mar 87             2          C Interface for PRINT.COM -- Version 1.1, 21 Mar 87             2
  60.  
  61.  
  62.  
  63.  
  64.  
  65.           PrintInstalled (function 0)          PrintInstalled (function 0)
  66.  
  67.           This routine checks to see if PRINT.COM is Installed by calling
  68.           the Multiplex Interrupt (0x2F).  If it is, TRUE is returned;
  69.           otherwise, FALSE is returned.
  70.  
  71.           PRINT.COM is multiplex number 1.  The Get Installed State is
  72.           function number 0.  After the interrupt, AL is 0xFF if PRINT.COM
  73.           is Installed.
  74.  
  75.           Parameters:
  76.  
  77.                None.
  78.  
  79.           Returns:
  80.  
  81.                TRUE or FALSE indicating if PRINT.COM is Installed.
  82.  
  83.           Calling Sequence:
  84.  
  85.                int  Status;
  86.                Status = PrintInstalled ();
  87.  
  88.                                           
  89.  
  90.  
  91.           C Interface for PRINT.COM -- Version 1.1, 21 Mar 87             3          C Interface for PRINT.COM -- Version 1.1, 21 Mar 87             3
  92.  
  93.  
  94.  
  95.  
  96.  
  97.           PrintSubmit (function 1)          PrintSubmit (function 1)
  98.  
  99.           Queue a file to be printed.  Return the an error code.  The file
  100.           must consist of a drive designator, full path, and full name.
  101.           file names  containing wild card characters are not allowed.
  102.  
  103.           Parameters:
  104.  
  105.                File -- Pointer to string containing name to be queued.
  106.  
  107.           Returns:
  108.  
  109.                Status:    0 = No error, file queued.
  110.                           2 = File not found.
  111.                           3 = Path not found.
  112.                           4 = Too many open files.
  113.                           5 = Access Denied.
  114.                           8 = Queue Full.
  115.                           9 = Busy.
  116.                          12 = Name too long.
  117.                          15 = Invalid Drive.
  118.  
  119.           Calling Sequence:
  120.  
  121.                char *File;
  122.                int  Status
  123.                Status = PrintSubmit (File);
  124.  
  125.                                           
  126.  
  127.  
  128.           C Interface for PRINT.COM -- Version 1.1, 21 Mar 87             4          C Interface for PRINT.COM -- Version 1.1, 21 Mar 87             4
  129.  
  130.  
  131.  
  132.  
  133.  
  134.           PrintCancel (function 2)          PrintCancel (function 2)
  135.  
  136.           Cancel one or more files from the queue.  File names containing
  137.           wild card characters are allowed.
  138.  
  139.           Parameters:
  140.  
  141.                File -- Pointer to string containing name to be canceled.
  142.  
  143.           Returns:
  144.  
  145.                Nothing.
  146.  
  147.           Calling Sequence:
  148.  
  149.                char *File;
  150.                PrintCancel (File);
  151.  
  152.                                           
  153.  
  154.           PrintCancelAll (function 3)          PrintCancelAll (function 3)
  155.  
  156.           Cancel printing of all files currently in the print queue.
  157.  
  158.           Parameters:
  159.  
  160.                None.
  161.  
  162.           Returns:
  163.  
  164.                Nothing.
  165.  
  166.           Calling Sequence:
  167.  
  168.                PrintCancelAll ();
  169.  
  170.                                           
  171.  
  172.  
  173.           C Interface for PRINT.COM -- Version 1.1, 21 Mar 87             5          C Interface for PRINT.COM -- Version 1.1, 21 Mar 87             5
  174.  
  175.  
  176.  
  177.  
  178.  
  179.           PrintStatus (function 4)          PrintStatus (function 4)
  180.  
  181.           Freeze the print queue and return a pointer to the queue list and
  182.           the number of errors encountered trying to write the last char to
  183.           the print device.
  184.  
  185.           Parameters:
  186.  
  187.                ErrCnt -- Pointer to an integer in which to store error
  188.                count.
  189.  
  190.                QueuePtr -- Pointer to a far pointer to char in which to
  191.                store the address of the print queue.
  192.  
  193.           Returns:
  194.  
  195.                Nothing.
  196.  
  197.           Calling Sequence:
  198.  
  199.                int  ErrCnt;
  200.                char far*QueuePtr;
  201.                PrintStatus (&QueuePtr, &ErrCnt);
  202.  
  203.                                           
  204.  
  205.           PrintStatusEnd (function 5)          PrintStatusEnd (function 5)
  206.  
  207.           Release the queue from PrintStatus and return the status.
  208.  
  209.           Parameters:
  210.  
  211.                None.
  212.  
  213.           Returns:
  214.  
  215.                Nothing.
  216.  
  217.           Calling Sequence:
  218.  
  219.                PrintStatusEnd ();