home *** CD-ROM | disk | FTP | other *** search
/ Network Support Encyclopedia 96-1 / novell-nsepro-1996-1-cd2.iso / download / netware / os2hdr.exe / NWPS_JOB.H < prev    next >
C/C++ Source or Header  |  1993-04-07  |  15KB  |  363 lines

  1. /*--------------------------------------------------------------------------
  2.       (C) Copyright 1993, Novell, Inc.    All Rights Reserved.
  3.  
  4.  No part of this file may be duplicated, revised, translated, localized or
  5.  modified in any manner or compiled, linked, or uploaded or downloaded to or
  6.  from any computer system without the prior written consent of Novell, Inc.
  7. --------------------------------------------------------------------------*/
  8. #ifndef NWPS_DEF_INC
  9. #include <nwps_def.h>
  10. #endif
  11.  
  12. #ifndef NWPS_JOB_INC
  13. #define NWPS_JOB_INC
  14. /*********************************************************************/
  15. /*********** PrintCon - Print Job Configuration Information **********/
  16. /*********************************************************************/
  17.  
  18. /*====================== PrintCon search flags =============================*/
  19. #define NWPS_EXTENDED_SEARCH                0
  20. #define NWPS_SINGLE_SEARCH             1
  21. #define NWPS_LIMITED_SEARCH                2
  22. #define NWPS_DBOWNER_PUBLIC                "(PUBLIC)"
  23. #define NWPS_DEVICE_NONE                    "(NONE)"
  24. #define NWPS_MODE_NONE                        "(NONE)"
  25.  
  26. /*====================================
  27.     Flags used for printControlFlags in
  28.     the NWPS_ClientRecord structure
  29.   ====================================*/
  30. #define NWPS_SUPPRESS_FF                    0x0800
  31. #define NWPS_NOTIFY_USER                    0x1000
  32. #define NWPS_TEXT_MODE                        0x4000
  33. #define NWPS_PRINT_BANNER                    0x8000
  34.  
  35. /*========================================================
  36.   This structure is overlayed on the QMS
  37.   NWQueueJobStruct.clientRecordArea to define a print job.
  38.   It is not used in any of the print services APIs.
  39.   (Formerly called NWPS_PJob.)
  40.   ========================================================*/
  41. typedef struct {
  42.   BYTE                        versionNumber;
  43.   BYTE                        tabSize;
  44.   WORD                        numberOfCopies;
  45.   WORD                        printControlFlags;
  46.   WORD                        maxLinesPerPage;
  47.   WORD                        maxCharsPerLine;
  48.   BYTE                        formName[13];
  49.   BYTE                        reserve[9];
  50.   BYTE                        bannerNameField[13];
  51.   BYTE                        bannerFileField[13];
  52.   BYTE                        headerFileName[14];
  53.   BYTE                        directoryPath[80];
  54. } NWPS_ClientRecord;
  55.  
  56. /*=======================================================
  57.   NWPS_Job_Rec is the type of record in the third and
  58.   last section of the PrnConDB database.    Each one of
  59.   these records contains all the fields that make up a
  60.   print job configuration as described in the NetWare 386
  61.   Print Server documentation.
  62.   =======================================================*/
  63. /*======== Flags for the NWPS_Job_Rec structure printJobFlag field =========*/
  64. #define NWPS_JOB_EXPAND_TABS                0x00000001    /*File type:0=Stream 1=Tab*/
  65. #define NWPS_JOB_NO_FORMFEED                0x00000002    /*Formfeed tail:0=Yes 1=No*/
  66. #define NWPS_JOB_NOTIFY                0x00000004    /*Notify:0=No 1=Yes        */
  67. #define NWPS_JOB_PRINT_BANNER          0x00000008    /*Banner:0=No 1=Yes        */
  68. #define NWPS_JOB_AUTO_END                    0x00000010    /*Auto endcap:0=No 1=Yes*/
  69. #define NWPS_JOB_TIMEOUT                    0x00000020    /*Enable T.O.:0=No 1=Yes*/
  70.  
  71. #define NWPS_JOB_ENV_DS                0x00000040    /*Use D.S. Environment    */
  72. #define NWPS_JOB_ENV_MASK                    0x000001C0    /*Bindery vs. D.S. Mask */
  73.  
  74. #define NWPS_JOB_DS_PRINTER                0x00000200    /*D.S. Printer not Queue*/
  75. #define NWPS_JOB_PRINTER_MASK          0x00000E00    /*D.S. Printer vs. Queue*/
  76.  
  77. /*=========================== Default Flags ================================*/
  78. #define NWPS_JOB_DEFAULT              (NWPS_JOB_PRINT_BANNER | NWPS_JOB_AUTO_END)
  79. #define NWPS_JOB_DEFAULT_COPIES            1                /*Default Number of Copies*/
  80. #define NWPS_JOB_DEFAULT_TAB                8                /*Default Tab Expansion */
  81.  
  82. typedef struct {
  83.   DWORD printJobFlag;                        /* Bits 31 30 29 ... 2 1 0 contain:  */
  84.                                                     /* 0: File type: 0=Byte stream 1=Text*/
  85.                                                     /* 1: Suppress formfeed:  0=No 1=Yes */
  86.                                                     /* 2: Notify when done:   0=No 1=Yes */
  87.                                                     /* 3: Print banner:          0=No 1=Yes */
  88.                                                     /* 4: Auto endcap:          0=No 1=Yes */
  89.                                                     /* 5: Enable timeout:      0=No 1=Yes */
  90.                                                     /* 8-6: Environment:                 */
  91.                                                     /*     000=Bindary                         */
  92.                                                     /*     001=Directory Services        */
  93.                                                     /* 11-9: Destination Type:           */
  94.                                                     /*     000=Queue_Name                     */
  95.                                                     /*     001=Printer_Name              */
  96.                                                     /* 31-12: Unused                             */
  97.   WORD  copies;                                /* 1 - 65,000                                 */
  98.   WORD  timeOutCount;                        /* 1 - 1,000                                 */
  99.   BYTE  tabSize;                                /* 1 - 18                                     */
  100.   BYTE  localPrinter;                        /* 0=Lpt1, 1=Lpt2, 2=Lpt3 etc.         */
  101.   char  formName[ NWPS_FORM_NAME_SIZE + 2 ];     /* 1-12 chars              */
  102.   char  name[ NWPS_BANNER_NAME_SIZE + 2 ];         /* 1-12 chars              */
  103.   char  bannerName[ NWPS_BANNER_FILE_SIZE + 2 ]; /* 1-12 chars              */
  104.   char  device[ NWPS_DEVI_NAME_SIZE + 2 ];         /* 1-32 chars              */
  105.   char  mode[ NWPS_MODE_NAME_SIZE + 2 ];             /* 1-32 chars              */
  106.   union {
  107.      struct {
  108.         /* pad structures on even boundries */
  109.         char    nServer[ NWPS_BIND_NAME_SIZE + 2 ];     /* 2-48 chars           */
  110.         char    printQueue[ NWPS_BIND_NAME_SIZE + 2 ];  /* 1-48 chars           */
  111.         char    printServer[ NWPS_BIND_NAME_SIZE + 2 ]; /* 1-48 chars           */
  112.      } nonDS;
  113.      char    DSObjectName[ NWPS_MAX_NAME_SIZE ];    
  114.   } u;
  115.   BYTE  reserved[392];                        /* Adds up to 1024 total bytes         */
  116. } NWPS_Job_Rec;
  117.  
  118.  
  119. /*===========================================================
  120.     DBOwner values and their meanings-
  121.     ---------------------------------
  122.     NULL         : Use the current user. No return possible.
  123.     Empty     : Use the current user. Return real object name.
  124.     UserName  : Use the specified user.
  125.     DS Object : Use the specified DS object.
  126.   ===========================================================*/
  127.  
  128. #ifdef __cplusplus
  129. extern "C" {
  130. #endif
  131.  
  132. /*================================================================
  133.   NWPSJobInit: Initializes a print job record with default values.
  134.   ================================================================*/
  135. NWCCODE NWAPI NWPSJobInit( 
  136.   NWPS_Job_Rec NWPTR pJobRecord);        /* structure to init                */
  137.  
  138. /*=============================================================
  139.   NWPSJobSet: Sets a print job record with defined values.
  140.   The pJobRecord should have been set to 0 before this call and
  141.   any name that is not defined will be left as '\0'.
  142.   =============================================================*/
  143. NWCCODE NWAPI NWPSJobSet( 
  144.   WORD  connType,                      /* bindery or directory service        */
  145.   NWPS_Job_Rec NWPTR pJobRecord,       /* structure to set                        */
  146.   char  NWPTR formName,
  147.   char  NWPTR deviceName,
  148.   char  NWPTR modeName,
  149.   char  NWPTR bannerLowerName,
  150.   char  NWPTR bannerUpperName,
  151.   char  NWPTR bindNServer,             /* NetWare server name                    */
  152.   char  NWPTR bindQueue,
  153.   char  NWPTR bindPserver,
  154.   WORD  dsUseQueueName,                /* if TRUE, next field is queue        */
  155.   char  NWPTR dsObjectName);                /* queue or printer name                */
  156.  
  157. /*########################### OBSOLETE ##############################
  158.   ##### USE CORRESPONDING GETFIRST/GETNEXT/ENDNEXT TRIO INSTEAD #####
  159.   ###################################################################
  160.     NOTE: This call is inefficient and has been obsoleted
  161.     by the creation of the NWPSJobGetFirstJob, NWPSJobGetNextJob,
  162.     and NWPSJobEndNextJob trio of calls defined below. This
  163.     call remains only for backward compatibility's sake. 
  164.  
  165.     NWPSJobScan is used repetatively to get a list of
  166.   the print jobs in the printcon database(s).
  167.  
  168.   -PJSequence needs to be set to -1 to indicate the
  169.   beginning of the search (i.e. the first time
  170.   NWPSJobScan is called).
  171.   -SearchFlag specifies whether to search all the public
  172.   databases (NWPS_EXTENDED_SEARCH), to use only the
  173.   specified database (NWPS_SINGLE_SEARCH), or to use
  174.     the DbOwner's database and the first public database after that
  175.     if they are different (NWPS_LIMITED_SEARCH).
  176.   -DbOwner specifies the search start point and returns
  177.   the directory object name, or bindery user name of
  178.   the owner.
  179.   -PJobName returns the name of the next print job
  180.   record found.
  181.   -DefaultPJ will be TRUE if the job is the current
  182.   user's default print job, otherwise it is FALSE.
  183.  
  184.   If the function is successful in finding a next record,
  185.   the return value of the function is 0, else an error code
  186.   is returned.
  187.   ###################################################################*/
  188. NWCCODE NWAPI NWPSJobScan( 
  189.   WORD  connType,
  190.   DWORD connID, 
  191.   WORD  NWPTR pJSequence,                /* Sequence number; start at -1 */
  192.   WORD  searchFlag,
  193.   char  NWPTR dbOwner,
  194.   char  NWPTR pJobName,
  195.   WORD  NWPTR defaultPJ);
  196.  
  197. /*==========================================================================
  198.   NWPSJobGetFirstJob, NWPSJobGetNextJob, and NWPSJobEndNextJob are used 
  199.     repetatively to get a list of the print jobs in the printcon database(s).
  200.  
  201.   -SearchFlag specifies whether to search all the public
  202.   databases (NWPS_EXTENDED_SEARCH), to use only the
  203.   specified database (NWPS_SINGLE_SEARCH), or to use
  204.     the DbOwner's database and the first public database after that
  205.     if they are different (NWPS_LIMITED_SEARCH).
  206.   -DbOwner specifies the search start point and returns
  207.   the directory object name, or bindery user name of
  208.   the owner.
  209.   -PJobName returns the name of the next print job
  210.   record found.
  211.   -DefaultPJ will be TRUE if the job is the current
  212.   user's default print job, otherwise it is FALSE.
  213.  
  214.   If the function is successful in finding a next record,
  215.   the return value of the function is 0, else an error code
  216.   is returned.
  217.   ==========================================================================*/
  218. NWCCODE NWAPI NWPSJobGetFirstJob(
  219.   WORD  connType,
  220.   DWORD connID,
  221.   WORD  searchFlag,
  222.   NWPSListHandle NWPTR handle,
  223.   char  NWPTR dbOwner,
  224.   char  NWPTR pJobName,
  225.   WORD  NWPTR defaultPJ);
  226.  
  227. NWCCODE NWAPI NWPSJobGetNextJob(
  228.   NWPSListHandle handle,
  229.   char NWPTR dbOwner,
  230.   char NWPTR pJobName,
  231.   WORD NWPTR defaultPJ);
  232.  
  233. NWCCODE NWAPI NWPSJobEndNextJob(
  234.   NWPSListHandle handle );
  235.  
  236. /*================================================================
  237.   NWPSJobWrite is used both to create and modify
  238.   records in the printcon database.
  239.  
  240.   -DbOwner is used to specify the location of the
  241.   database to modify.  This field must be specified.
  242.   -PJobName contains the name of the NWPS_Job_Rec to
  243.   be written.
  244.   If a record with the same name already exists in
  245.   the database then it is overwritten with the data
  246.   in the buffer pointed to by -pJobRecord, otherwise
  247.   a new record is created in the database.
  248.  
  249.   The function returns a 0 if successful, otherwise an error code.
  250.   ================================================================*/
  251. NWCCODE NWAPI NWPSJobWrite( 
  252.   WORD  connType,
  253.   DWORD connID, 
  254.   char  NWPTR dbOwner,
  255.   char  NWPTR pJobName,
  256.   NWPS_Job_Rec NWPTR pJobRecord);
  257.  
  258. /*======================================================
  259.   NWPSJobRead searches for a record in the
  260.   printcon database.
  261.  
  262.   -DbOwner specifies the database to read from.
  263.   -PJobName contains the name of the print job to find.
  264.   If the function is successful in finding the specified
  265.   record, the buffer pointed to by -pJobRecord is filled
  266.   with the contents of the record found
  267.  
  268.   The return value is 0 if the function is successful,
  269.   otherwise an error code is returned.
  270.   ======================================================*/
  271. NWCCODE NWAPI NWPSJobRead( 
  272.   WORD  connType,
  273.   DWORD connID, 
  274.   char  NWPTR dbOwner,
  275.   char  NWPTR pJobName,
  276.   NWPS_Job_Rec NWPTR pJobRecord);
  277.  
  278. /*================================================
  279.   NWPSJobDelete removes a record from the
  280.   printcon database.
  281.   -DbOwner specifies the database where the print
  282.   job is defined.
  283.   -PJobName is the name of the NWPS_Job_Rec to be
  284.   deleted from the database and is required.
  285.  
  286.   The function returns a 0 if it is successful,
  287.   otherwise it returns the pertinent error code.
  288.   If the print job does not exist in the database,
  289.   success is returned.
  290.   ================================================*/
  291. NWCCODE NWAPI NWPSJobDelete( 
  292.   WORD  connType,
  293.   DWORD connID,
  294.   char  NWPTR dbOwner,
  295.   char  NWPTR pJobName);
  296.  
  297. /*================================================
  298.   NWPSJobGetDefault gets the name and/or
  299.   contents of the default NWPS_Job_Rec record in
  300.   the PrnConDB database.
  301.  
  302.   -SearchFlag specifies whether to do look only
  303.   in the specified database (NWPS_SINGLE_SEARCH),
  304.   to look in all the public databases until
  305.   a default is found (NWPS_EXTENDED_SEARCH), or to
  306.     look in only the first public database found
  307.     (NWPS_LIMITED_SEARCH);
  308.  
  309.   -DbOwner specifies the start point of the search
  310.   for a default print job. And returns the actual
  311.   location where the default print job was found.
  312.   -PJobName returns the name of the default 
  313.   print job.
  314.   -PJobRecord returns the print job information.
  315.  
  316.   The return value is 0 of the call is successful,
  317.   otherwise an error code is returned.
  318.   ================================================*/
  319. NWCCODE NWAPI NWPSJobGetDefault(
  320.   WORD  connType,
  321.   DWORD connID,
  322.   WORD  searchFlag,
  323.   char  NWPTR dbOwner,
  324.   char  NWPTR pJobName,
  325.   NWPS_Job_Rec NWPTR pJobRecord);
  326.  
  327. /*=====================================================
  328.   NWPSJobSetDefault sets the default NWPS_Job_Rec
  329.   record in either the user or one of the public
  330.   printcon databases.
  331.  
  332.   -DbOwner specifies the database to set/reset the
  333.   default print job.
  334.   -PJobName should contain the name of the NWPS_Job_Rec
  335.   to be set as the system's default.  If PJobName is
  336.   NULL or empty, the current default is erased.
  337.   -PJobOwner is similar to dbOwner, but it specifies
  338.   where the print job is defined. No attempt is made
  339.   to verify that the print job exists in the
  340.   pjobOwner database.
  341.  
  342.   The function returns a 0 if successful otherwise an
  343.   error code.
  344.   =====================================================*/
  345. NWCCODE NWAPI NWPSJobSetDefault(
  346.   WORD  connType,
  347.   DWORD connID,
  348.   char  NWPTR dbOwner,
  349.   char  NWPTR pJobName,
  350.   char  NWPTR pJobOwner);
  351.  
  352. NWCCODE NWAPI NWPSJobDeleteDatabase(
  353.   WORD  connType,                      /* Type of server/network                */
  354.   DWORD connID,                                /* NetWare Server Connection ID        */
  355.   char  NWPTR dbOwner);                /* database Owner                   */
  356.  
  357. #ifdef __cplusplus
  358. }
  359. #endif
  360.  
  361. #endif  /* NWPS_JOB_INC */
  362.  
  363.