home *** CD-ROM | disk | FTP | other *** search
/ Network Support Encyclopedia 96-1 / novell-nsepro-1996-1-cd2.iso / download / netware / prnflg.exe / CAPFLAGS.C next >
Text File  |  1995-02-05  |  6KB  |  169 lines

  1. /****************************************************************************
  2. **      DISCLAIMER
  3. **
  4. **   Novell, Inc. makes no representations or warranties with respect to
  5. **   any NetWare software, and specifically disclaims any express or
  6. **   implied warranties of merchantability, title, or fitness for a
  7. **   particular purpose.
  8. **
  9. **   Distribution of any NetWare software is forbidden without the
  10. **   express written consent of Novell, Inc.  Further, Novell reserves
  11. **   the right to discontinue distribution of any NetWare software.
  12. **
  13. **   Novell is not responsible for lost profits or revenue, loss of use
  14. **   of the software, loss of data, costs of re-creating lost data, the
  15. **   cost of any substitute equipment or program, or claims by any party
  16. **   other than you.  Novell strongly recommends a backup be made before
  17. **   any software is installed.   Technical support for this software
  18. **   may be provided at the discretion of Novell.
  19. ****************************************************************************
  20. **
  21. **   File:  CAPFLAGS.C
  22. **
  23. **  Desc:   The program will print out the capture flags from the flags1
  24. **          and flags2 structures.  The user must specify the lpt port.
  25. **
  26. **
  27. **   Programmers:
  28. **   Ini   Who               Firm
  29. **   ------------------------------------------------------------------
  30. **   ARM   A. Ray Maxwell    Novell Developer Support.
  31. **
  32. **   History:
  33. **
  34. **   ------------------------------------------------------------------
  35. **   01-29-95   ARM   First code.
  36. */
  37.  
  38.  
  39. /****************************************************************************
  40. ** Include Headers, Macros & function Prototypes.
  41. */
  42.     /*-------------------------------------------------------------------
  43.     ** Borland C.
  44.     */
  45.     #include <stdio.h>    /* getch()       */
  46.     #include <stdlib.h>   /* exit() atoi() */
  47.     #include <conio.h>    /* cputs()       */
  48.     #include <string.h>   /* strcpy()      */
  49.  
  50.  
  51.  
  52.     /*-------------------------------------------------------------------
  53.     ** Netware NWCALLS etc.
  54.     */
  55.     #include <nwcalls.h>
  56.  
  57.  
  58.     /*-------------------------------------------------------------------
  59.     **  Prototypes
  60.     */
  61.     void helpScreen(void);
  62.     void printFlags(NWCAPTURE_FLAGS1 *,NWCAPTURE_FLAGS2 *);
  63.  
  64.  
  65.  
  66. /****************************************************************************
  67. **   Program Start
  68. */
  69. void main (int argc, char **argv)
  70. {
  71.  
  72.  
  73.      NWCAPTURE_FLAGS1 f1;       /* new capture flags for queue         */
  74.      NWCAPTURE_FLAGS2 f2;       /* new capture flags for queue         */
  75.      int lptPort;               /* buffer for lpt                      */
  76.      NWCCODE ccode;             /* error code buffer                   */
  77.  
  78.  
  79.  
  80.     if (argc != 2){
  81.         helpScreen();
  82.         exit(-1);
  83.     }
  84.  
  85.     lptPort=atoi(argv[1]);                                /* set up the port */
  86.  
  87.     ccode = NWCallsInit(NULL, NULL);
  88.     if (ccode != 0x0000){
  89.         printf("NWCallsInit failed with ccode =%X\n",ccode);
  90.     }
  91.  
  92.         /*--------------------------------------------------------------------
  93.         ** Check the capture status and if captured put the queue flags1 and 2
  94.         ** into temp buffers.
  95.         */
  96.         ccode = NWGetCaptureStatus(lptPort);
  97.         if (ccode ==0x00FF){
  98.             /*------------------------------------------------------------
  99.             ** Sets a flag telling us there was a previous capture.  This
  100.             ** is used in resetOriginalCapture()
  101.             */
  102.  
  103.             ccode = NWGetCaptureFlags(
  104.                       /* port 1,2,3    > */ lptPort,
  105.                       /* captureflags1 < */ &f1,
  106.                       /* captureflags2 < */ &f2);
  107.  
  108.             if (ccode != 0x0000){
  109.                 printf("NWGetCaptureFlags failed with ccode =%X\n",ccode);
  110.                 exit(-1);
  111.             }
  112.  
  113.         }
  114.         else
  115.             printf("LPT PORT %d is not currently captured\n",lptPort);
  116.  
  117.         printFlags(&f1,&f2);
  118. }
  119.  
  120. /****************************************************************************
  121. ** Usage and help screen.
  122. */
  123. void helpScreen (void)
  124. {
  125.     clrscr();
  126.     gotoxy (34,5);
  127.     cputs ("CAP Usage");
  128.     gotoxy (11,7);
  129.     cprintf("Usage: CAPFLAGS <lpt port>");
  130.     gotoxy (15,8);
  131.     cputs("lpt port = the port 1,2,3 that you are captured to.");
  132.     gotoxy (31,16);
  133.     cputs ("Hit Return to Exit");
  134.     getch();
  135. }
  136. /****************************************************************************
  137. ** Print the flags1 and flags2 field.
  138. */
  139. void printFlags(NWCAPTURE_FLAGS1 *f1, NWCAPTURE_FLAGS2 *f2)
  140. {
  141.  
  142.     printf("Job Description:       %s\n",f1->jobDescription);
  143.     printf("tabsize:               %d\n",f1->tabSize);
  144.     printf("Number of copies:      %d\n",f1->numCopies);
  145.     printf("Print flags:           %X\n",f1->printFlags);
  146.     printf("Maximum Lines:         %d\n",f1->maxLines);
  147.     printf("Maximum Charaters:     %d\n",f1->maxChars);
  148.     printf("Maximum Lines:         %d\n",f1->maxLines);
  149.     printf("Form Name:             %s\n",f1->formName);
  150.     printf("formType:              %X\n",f1->formType);
  151.     printf("Maximum Lines:         %d\n",f1->maxLines);
  152.     printf("Banner Text:           %s\n",f1->bannerText);
  153.     printf("Flush Capture time out,%d\n",f1->flushCaptureTimeout);
  154.     printf("Flush Capture on close %d\n",f1->flushCaptureOnClose);
  155.  
  156.     printf("Queue ID:              %08lX\n",f2->queueID);
  157.     printf("SetUpStringMaxLen:     %d\n",f2->setupStringMaxLen);
  158.     printf("resetStringMaxLen:     %d\n",f2->resetStringMaxLen);
  159.     printf("LPTCaptureFlag:        %X\n",f2->LPTCaptureFlag);
  160.     printf("fileCaptureFlag:       %X\n",f2->fileCaptureFlag);
  161.     printf("timeOutFlag:           %X\n",f2->timingOutFlag);
  162.     printf("inProgress:            %X\n",f2->inProgress);
  163.     printf("printQueueFlag:        %X\n",f2->printQueueFlag);
  164.     printf("printJobValid:         %X\n",f2->printJobValid);
  165.     printf("queueName:             %s\n",f2->queueName);
  166.  
  167. }
  168.  
  169.