home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c070 / 1.ddi / TOOLS.1 / INCLUDE / BPRINT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1989-03-31  |  3.0 KB  |  94 lines

  1. /**
  2. *
  3. *  BPRINT.H    Header file for TURBO C TOOLS Printer Functions
  4. *
  5. *  Version    6.00 (C) Copyright Blaise Computing Inc. 1987,1989
  6. *
  7. **/
  8.  
  9. #ifndef DEF_BPRINT        /* prevent redefinition            */
  10. #define DEF_BPRINT 1
  11.  
  12. #include <bios.h>
  13.  
  14.  
  15. /* Interrupt numbers for communicating with print spooler and BIOS. */
  16.  
  17. #define PR_BIOS_INT    0x17    /* BIOS printer control int for     */
  18.                 /* PRSTATUS and PRINIT.         */
  19.  
  20. #define PR_DOS_INT     0x2F    /* DOS printer control int.        */
  21.  
  22. #define PR_DOSFUNC_INT 0x21    /* DOS general service gate.        */
  23.  
  24.  
  25. /* Error return codes.                            */
  26.  
  27. #define PR_OK 0         /* No PR error.                */
  28.  
  29. #define PR_INSTAL 1        /* Printer not installed or DOS older   */
  30.                 /* than 3.00                */
  31.  
  32. #define PR_EXIST 2        /* File does not exist (in queue or file*/
  33.                 /* system, depending on context.        */
  34.  
  35. #define PR_PATH 3        /* Path does not exist.            */
  36. #define PR_HANDLES 4        /* Out of handles.                */
  37. #define PR_ACCESS 5        /* Access denied.                */
  38. #define PR_EMPTY 6        /* Print spooler queue empty.        */
  39. #define PR_RANGE 7        /* Item requested out of range of queue.*/
  40. #define PR_FULL 8        /* Queue full.                */
  41. #define PR_BUSY 9        /* Spooler busy; can't get attention.   */
  42. #define PR_NAMELEN 12        /* Path name too long.            */
  43. #define PR_DRIVE 15        /* Invalid disk drive.            */
  44.  
  45.  
  46. /* Status return codes.                         */
  47.  
  48. #define PR_S_ACK     0x40   /* printer acknowledged.            */
  49. #define PR_S_IOERR   0x08   /* i/o errors with printer.         */
  50. #define PR_S_NOPAPER 0x20   /* out of paper.                */
  51. #define PR_S_NOTBUSY 0x80   /* printer not busy.            */
  52. #define PR_S_ONLINE  0x10   /* on line.                 */
  53. #define PR_S_TIMEOUT 0x01   /* timeout.                 */
  54.  
  55.  
  56. /* Defines which make PRSTATUS (i.e. BIOS) return codes into zero   */
  57. /* for no error.                            */
  58.  
  59. #define PR_BIOS_OK           (PR_S_ONLINE | PR_S_NOTBUSY)
  60. #define PR_MAKEOK(retcode)     (retcode ^ PR_BIOS_OK)
  61.  
  62.  
  63.         /* Print a single character using BIOS.         */
  64. #define prchar(port,bval) (biosprint (0, (bval), (port)))
  65.  
  66.         /* Initialize printer port using BIOS.            */
  67. #define prinit(port)      (biosprint (1, 0,     (port)))
  68.  
  69.         /* Get status for a printer port.  BIOS.        */
  70. #define prstatus(port)      (biosprint (2, 0,     (port)))
  71.  
  72.  
  73. /* Definitions of functions for use with strong type checking        */
  74.  
  75. int   cdecl prcancel (char *);        /* Cancel file(s) from the  */
  76.                     /* PRINT.COM spooler queue. */
  77.                     /*                */
  78. const char *cdecl prerror (int);    /* Return error string        */
  79.                     /* corresponding to PR error*/
  80.                     /* code.            */
  81.                     /*                */
  82. int   cdecl prgetq (int, int *, char *);/* Get name of file in        */
  83.                     /* spooler queue, capacity  */
  84.                     /* and fullness of queue.   */
  85.                     /*                */
  86. int   cdecl prinstld (void);        /* Check to see whether     */
  87.                     /* PRINT.COM is installed.  */
  88.                     /* Always fails on dos 2.x. */
  89.                     /*                */
  90. int   cdecl prspool (const char *);    /* Put a file in the DOS    */
  91.                     /* PRINT.COM spooler queue. */
  92.  
  93. #endif    /* prevent redefinition */
  94.