home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / dsstlkt5.zip / dssos2tk / dss / SPOOL.H < prev    next >
C/C++ Source or Header  |  1998-05-08  |  13KB  |  295 lines

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