home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0210 - 0219 / ibm0210-0219 / ibm0213.tar / ibm0213 / LS4APWAD.ZIP / LS40A.A12 / IBMLSA / IBM400R2 / OSLANAPI.ZIP / IBMLAN / NETSRC / H / SPOOL.H < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-10  |  13.0 KB  |  307 lines

  1. /**************************************************************************/
  2. /*                                                                        */
  3. /*              IBM OS/2(tm) Local Area Network (LAN) Server              */
  4. /*                            Version 3.0                                 */
  5. /* (c) Copyright International Business Machines Corporation, 1988, 1992  */
  6. /*                                                                        */
  7. /**************************************************************************/
  8.  
  9. /********************************************************************
  10.  *                                                                  *
  11.  *  About this file ...  SPOOL.H                                    *
  12.  *                                                                  *
  13.  *  This file contains information about the DosPrint APIs.         *
  14.  *                                                                  *
  15.  *      Function prototypes.                                        *
  16.  *                                                                  *
  17.  *      Data structure templates.                                   *
  18.  *                                                                  *
  19.  *      Definition of special values.                               *
  20.  *                                                                  *
  21.  *                                                                  *
  22.  *  NOTE:  You must include NETCONS.H before this file, since this  *
  23.  *         file depends on values defined in NETCONS.H.             *
  24.  *                                                                  *
  25.  ********************************************************************/
  26.  
  27.  
  28. #ifdef  INCL_32
  29. #pragma pack(1)
  30. #endif
  31.  
  32.  
  33.  
  34. /****************************************************************
  35.  *                                                              *
  36.  *              Function prototypes                             *
  37.  *                                                              *
  38.  ****************************************************************/
  39.  
  40.  
  41. #ifndef NO_INCL_PROTOTYPES      /* default is to define everything */
  42.  
  43. extern API_FUNCTION
  44.  DosPrintDestEnum ( const char LSFAR *, short, char LSFAR *, unsigned short,
  45.         unsigned short LSFAR *, unsigned short LSFAR * );
  46.  
  47. extern API_FUNCTION
  48.   DosPrintDestControl ( const char LSFAR *, char LSFAR *, LSINT );
  49.  
  50. extern API_FUNCTION
  51.   DosPrintDestGetInfo ( const char LSFAR *, char LSFAR *, short,char LSFAR *,
  52.         unsigned short, unsigned short LSFAR * );
  53.  
  54. extern API_FUNCTION
  55.   DosPrintDestStatus (  char LSFAR *, unsigned short, unsigned short, char LSFAR * );
  56.  
  57. extern API_FUNCTION
  58.  DosPrintQEnum ( const char LSFAR *, short, char LSFAR *, unsigned short,
  59.         unsigned short LSFAR *, unsigned short LSFAR * );
  60.  
  61.  
  62. extern API_FUNCTION
  63.   DosPrintQGetInfo ( const char LSFAR *, char LSFAR *, short, char LSFAR *, unsigned short, unsigned short LSFAR * );
  64.  
  65. extern API_FUNCTION
  66.   DosPrintQSetInfo ( const char LSFAR *, char LSFAR *, short, char LSFAR *, unsigned short, short);
  67.  
  68. extern API_FUNCTION
  69.   DosPrintQPause ( const char LSFAR *, char LSFAR * );
  70.  
  71. extern API_FUNCTION
  72.   DosPrintQContinue ( const char LSFAR *, char LSFAR * );
  73.  
  74. extern API_FUNCTION
  75.   DosPrintQPurge ( const char LSFAR *, char LSFAR * );
  76.  
  77. extern API_FUNCTION
  78.   DosPrintQAdd ( const char LSFAR *, short, char LSFAR *, unsigned short );
  79.  
  80. extern API_FUNCTION
  81.   DosPrintQDel ( const char LSFAR *, char LSFAR * );
  82.  
  83. extern API_FUNCTION
  84.   DosPrintJobGetInfo ( const char LSFAR *, unsigned short, short,char LSFAR *,
  85.         unsigned short, unsigned short LSFAR * );
  86.  
  87. extern API_FUNCTION
  88.   DosPrintJobSetInfo ( const char LSFAR *, unsigned short,short, char LSFAR *,
  89.         unsigned short, short );
  90.  
  91. extern API_FUNCTION
  92.   DosPrintJobPause ( const char LSFAR *, unsigned short );
  93.  
  94. extern API_FUNCTION
  95.   DosPrintJobContinue ( const char LSFAR *, unsigned short );
  96.  
  97. extern API_FUNCTION
  98.   DosPrintJobDel ( const char LSFAR *, unsigned short );
  99.  
  100. extern API_FUNCTION
  101.   DosPrintJobEnum( const char LSFAR *, const char LSFAR *, short, char LSFAR *,
  102.         unsigned short, unsigned short LSFAR *,unsigned short LSFAR *);
  103.  
  104. extern API_FUNCTION
  105.  DosPrintJobGetId(unsigned short, char LSFAR *, unsigned short);
  106.  
  107. #endif
  108.  
  109. /****************************************************************
  110.  *                                                              *
  111.  *              Data structure templates                        *
  112.  *                                                              *
  113.  ****************************************************************/
  114.  
  115.  
  116. struct prjob_info {
  117.    unsigned short     prjob_id;                  /* job ID                                */
  118.    char               prjob_username[UNLEN+1];   /* submitting user name                  */
  119.    char               prjob_pad_1;               /* byte to pad to word boundary           */
  120.    char               prjob_notifyname[CNLEN+1]; /* message name to notify                */
  121.    char               prjob_datatype[DTLEN+1];   /* spool file data type name             */
  122.    char LSFAR * LSPTR prjob_parms;               /* implementation defined parameter string */
  123.    unsigned short     prjob_position;            /* position of the job in the queue        */
  124.                                                  /* For SetInfo                                   */
  125.                                                  /* 0 means do not change position        */
  126.                                                  /* position > # of jobs means the end            */
  127.    unsigned short     prjob_status;              /* job status                              */
  128.    char LSFAR * LSPTR prjob_status_string;       /* status string posted by print processor */
  129.    unsigned long      prjob_submitted;           /* time when the job is submitted          */
  130.                                                  /* (from 1970-1-1 in seconds)              */
  131.    unsigned long      prjob_size;                /* job size                                */
  132.    char LSFAR * LSPTR prjob_comment;        /* comment associated with this job      */
  133. }; /* prjob_info */
  134.  
  135. struct prdest_info {
  136.    char               prdest_name[PDLEN+1];      /* name of the print destination         */
  137.    char               prdest_username[UNLEN+1];  /* the username of current job.          */
  138.    unsigned short     prdest_jobid;              /* current printing job ID or 0 if none  */
  139.    unsigned short     prdest_status;             /* status of the destination, a bit mask */
  140.    char LSFAR * LSPTR prdest_status_string;      /* status string posted by the processor */
  141.    unsigned short     prdest_time;               /* printing time in minutes.             */
  142. }; /* prdest_info */
  143.  
  144. struct prq_info {
  145.   char               prq_name[QNLEN+1];  /* queue name                               */
  146.   char               prq_pad_1;          /* byte to pad to word boundary             */
  147.   unsigned short     prq_priority;       /* Priority (0-9) with 1 lowest             */
  148.   unsigned short     prq_starttime;      /* time to start the queue.                 */
  149.                                          /* (from 00:00 of the day in minutes)       */
  150.   unsigned short     prq_untiltime;      /* time to stop the queue.                  */
  151.                                          /* (from 00:00 of the day in minutes)       */
  152.   char LSFAR * LSPTR prq_separator;      /* separator file name                      */
  153.   char LSFAR * LSPTR prq_processor;      /* command string to invoke print processor */
  154.                                          /*   ("PATHNAME PARM1=VAL1 PARM2=VAL2 ...") */
  155.   char LSFAR * LSPTR prq_destinations;   /* destination names the queue is routed to */
  156.                                          /*   ("DEST1 DEST2 ...")                    */
  157.   char LSFAR * LSPTR prq_parms;          /* implementation defined parameter string  */
  158.   char LSFAR * LSPTR prq_comment;        /* comment string                           */
  159.   unsigned short     prq_status;         /* queue status mask:                       */
  160.                                          /*   0  Queue active                        */
  161.                                          /*   1  Queue paused                        */
  162.                                          /*   2  Queue unscheduled                   */
  163.                                          /*   3  Queue pending delete                */
  164.   unsigned short     prq_jobcount;       /* number of jobs in the queue              */
  165. }; /* prq_info */
  166.  
  167. /*
  168.  * structure for DosPrintJobGetId
  169.  */
  170. struct prid_info {
  171.         unsigned short prjid_id;
  172.         char prjid_server[CNLEN + 1];   /* server name */
  173.         char prjid_qname[QNLEN+1];      /* queue to which the job is queued */
  174.         char prjid_pad_1;               /* byte to pad to word boundary      */
  175. }; /* prid_info */
  176.  
  177.  
  178. /****************************************************************
  179.  *                                                              *
  180.  *              Special values and constants                    *
  181.  *                                                              *
  182.  ****************************************************************/
  183.  
  184.  
  185.  
  186.  
  187. /*
  188.  *      Values for parmnum in DosPrintQSetInfo.
  189.  */
  190.  
  191. #define PRQ_PRIORITY_PARMNUM            2
  192. #define PRQ_STARTTIME_PARMNUM           3
  193. #define PRQ_UNTILTIME_PARMNUM           4
  194. #define PRQ_SEPARATOR_PARMNUM           5
  195. #define PRQ_PROCESSOR_PARMNUM           6
  196. #define PRQ_DESTINATIONS_PARMNUM        7
  197. #define PRQ_PARMS_PARMNUM               8
  198. #define PRQ_COMMENT_PARMNUM             9
  199. #define PRQ_MAXPARMNUM                  11
  200.  
  201. /*
  202.  *      Print Queue Priority
  203.  */
  204.  
  205. #define PRQ_MAX_PRIORITY                1
  206. #define PRQ_DEF_PRIORITY                5
  207. #define PRQ_MIN_PRIORITY                9
  208.  
  209. /*
  210.  *      Print queue status bitmask and values.
  211.  */
  212.  
  213. #define PRQ_STATUS_MASK                 3
  214. #define PRQ_ACTIVE                      0
  215. #define PRQ_PAUSE                       1
  216. #define PRQ_ERROR                       2
  217. #define PRQ_PENDING                     3
  218.  
  219. /*
  220.  *      Values for parmnum in DosPrintJobSetInfo.
  221.  */
  222.  
  223. #define PRJOB_NOTIFYNAME_PARMNUM        3
  224. #define PRJOB_DATATYPE_PARMNUM          4
  225. #define PRJOB_PARMS_PARMNUM             5
  226. #define PRJOB_POSITION_PARMNUM          6
  227. #define PRJOB_COMMENT_PARMNUM          11
  228. #define PRJOB_MAXPARMNUM               11
  229.  
  230. /*
  231.  *      Bitmap masks for prjob_status field of PRINTJOB.
  232.  */
  233.  
  234. /* 2-7 bits also used in device status */
  235.  
  236. #define PRJOB_QSTATUS       0x3         /* Bits 0,1 */
  237. #define PRJOB_DEVSTATUS    0x1fc        /* 2-8 bits */
  238. #define PRJOB_COMPLETE      0x4         /*  Bit 2   */
  239. #define PRJOB_INTERV        0x8         /*  Bit 3   */
  240. #define PRJOB_ERROR        0x10         /*  Bit 4   */
  241. #define PRJOB_DESTOFFLINE  0x20         /*  Bit 5   */
  242. #define PRJOB_DESTPAUSED   0x40         /*  Bit 6   */
  243. #define PRJOB_NOTIFY       0x80         /* BIT 7 */
  244. #define PRJOB_DESTNOPAPER  0x100        /* BIT 8 */
  245. #define PRJOB_DELETED      0x8000       /* BIT 15 */
  246.  
  247. /*
  248.  *      Values of PRJOB_QSTATUS bits in prjob_status field of PRINTJOB.
  249.  */
  250.  
  251. #define PRJOB_QS_QUEUED                 0
  252. #define PRJOB_QS_PAUSED                 1
  253. #define PRJOB_QS_SPOOLING               2
  254. #define PRJOB_QS_PRINTING               3
  255.  
  256. /*
  257.  *      Control codes used in DosPrintDestControl.
  258.  */
  259.  
  260. #define PRDEST_DELETE                   0
  261. #define PRDEST_PAUSE                    1
  262. #define PRDEST_CONT                     2
  263. #define PRDEST_RESTART                  3
  264.  
  265. /*
  266.  *      These manifests define a two-bit field in prdest_status, and
  267.  *      two of the values that field may take.
  268.  */
  269.  
  270. #define PRDEST_STATUS_MASK              0x3
  271. #define PRDEST_PAUSED                   0x1
  272. #define PRDEST_ACTIVE                   0x0
  273.  
  274.  
  275. /*
  276.  *      Standard command argument when invoking print processor
  277.  */
  278. #define PPINPUT         "INPUT="
  279. #define PPOUTPUT        "OUTPUT="
  280. #define PPQUEUE         "QUEUE="
  281. #define PPPARMS         "PARMS="
  282. #define PPJOBID         "JOBID="
  283.  
  284.  
  285. #ifdef  INCL_32
  286. #pragma linkage (DosPrintDestEnum, far16 pascal)
  287. #pragma linkage (DosPrintDestControl, far16 pascal)
  288. #pragma linkage (DosPrintDestGetInfo, far16 pascal)
  289. #pragma linkage (DosPrintDestStatus, far16 pascal)
  290. #pragma linkage (DosPrintQEnum, far16 pascal)
  291. #pragma linkage (DosPrintQGetInfo, far16 pascal)
  292. #pragma linkage (DosPrintQSetInfo, far16 pascal)
  293. #pragma linkage (DosPrintQPause, far16 pascal)
  294. #pragma linkage (DosPrintQContinue, far16 pascal)
  295. #pragma linkage (DosPrintQPurge, far16 pascal)
  296. #pragma linkage (DosPrintQAdd, far16 pascal)
  297. #pragma linkage (DosPrintQDel, far16 pascal)
  298. #pragma linkage (DosPrintJobGetInfo, far16 pascal)
  299. #pragma linkage (DosPrintJobSetInfo, far16 pascal)
  300. #pragma linkage (DosPrintJobPause, far16 pascal)
  301. #pragma linkage (DosPrintJobContinue, far16 pascal)
  302. #pragma linkage (DosPrintJobDel, far16 pascal)
  303. #pragma linkage (DosPrintJobEnum, far16 pascal)
  304. #pragma linkage (DosPrintJobGetId, far16 pascal)
  305. #pragma pack()
  306. #endif
  307.