home *** CD-ROM | disk | FTP | other *** search
/ Network Support Encyclopedia 96-1 / novell-nsepro-1996-1-cd2.iso / download / netware / capflg.exe / GETCAPFL.C < prev    next >
C/C++ Source or Header  |  1994-09-29  |  3KB  |  122 lines

  1.  
  2. /****************************************************************************
  3. **        DISCLAIMER
  4. **
  5. **    Novell, Inc. makes no representations or warranties with respect to
  6. **    any NetWare software, and specifically disclaims any express or
  7. **    implied warranties of merchantability, title, or fitness for a
  8. **    particular purpose.
  9. **
  10. **    Distribution of any NetWare software is forbidden without the
  11. **    express written consent of Novell, Inc.  Further, Novell reserves
  12. **    the right to discontinue distribution of any NetWare software.
  13. **
  14. **    Novell is not responsible for lost profits or revenue, loss of use
  15. **    of the software, loss of data, costs of re-creating lost data, the
  16. **    cost of any substitute equipment or program, or claims by any party
  17. **    other than you.  Novell strongly recommends a backup be made before
  18. **    any software is installed.   Technical support for this software
  19. **    may be provided at the discretion of Novell.
  20. ****************************************************************************
  21. #include <stdio.h>
  22. #include <string.h>
  23.  
  24. #include <nwcalls.h>
  25.  
  26. void main (int argc, char *argv[])
  27. {
  28.     NWCCODE                    ccode;
  29.     NWCAPTURE_FLAGSRW        flags1;
  30.     NWCAPTURE_FLAGSRO        flags2;
  31.     NWCONN_HANDLE            conn;
  32.  
  33.  
  34.     if (argc != 3)
  35.     {
  36.         printf ("Usage:  GETCAPFL <mode> <flag>\n\n");
  37.         printf ("<mode>  CLEAR, SET, or TOGGLE\n");
  38.         printf ("<flag>  RELEASE, SUPPRESS, NOTIFY, TAB, BANNER\n");
  39.         return;
  40.     }
  41.  
  42.     ccode = NWCallsInit (NULL,NULL);
  43.     if (ccode) return;
  44.  
  45.     ccode = NWGetDefaultConnectionID (&conn);
  46.     if (ccode) return;
  47.  
  48.     ccode = NWGetCaptureFlags (0x01, &flags1, &flags2);
  49.     if (ccode) return;
  50.  
  51.     if (stricmp (argv[1], "CLEAR") == 0)
  52.     {
  53.         if (stricmp (argv[2], "RELEASE") == 0)
  54.         {
  55.             flags1.printFlags &= 0xFFFB;
  56.         }
  57.         if (stricmp (argv[2], "SUPPRESS") == 0)
  58.         {
  59.             flags1.printFlags &= 0xFFF7;
  60.         }
  61.         if (stricmp (argv[2], "NOTIFY") == 0)
  62.         {
  63.             flags1.printFlags &= 0xFFEF;
  64.         }
  65.         if (stricmp (argv[2], "TAB") == 0)
  66.         {
  67.             flags1.printFlags &= 0xFFBF;
  68.         }
  69.         if (stricmp (argv[2], "BANNER") == 0)
  70.         {
  71.             flags1.printFlags &= 0xFF7F;
  72.         }
  73.     }
  74.     else if (stricmp (argv[1], "SET") == 0)
  75.     {
  76.         if (stricmp (argv[2], "RELEASE") == 0)
  77.         {
  78.             flags1.printFlags |= 0x0004;
  79.         }
  80.         if (stricmp (argv[2], "SUPPRESS") == 0)
  81.         {
  82.             flags1.printFlags |= 0x0008;
  83.         }
  84.         if (stricmp (argv[2], "NOTIFY") == 0)
  85.         {
  86.             flags1.printFlags |= 0x0010;
  87.         }
  88.         if (stricmp (argv[2], "TAB") == 0)
  89.         {
  90.             flags1.printFlags |= 0x0040;
  91.         }
  92.         if (stricmp (argv[2], "BANNER") == 0)
  93.         {
  94.             flags1.printFlags |= 0x0080;
  95.         }
  96.     }
  97.     else
  98.     {
  99.         if (stricmp (argv[2], "RELEASE") == 0)
  100.         {
  101.             flags1.printFlags ^= 0x0004;
  102.         }
  103.         if (stricmp (argv[2], "SUPPRESS") == 0)
  104.         {
  105.             flags1.printFlags ^= 0x0008;
  106.         }
  107.         if (stricmp (argv[2], "NOTIFY") == 0)
  108.         {
  109.             flags1.printFlags ^= 0x0010;
  110.         }
  111.         if (stricmp (argv[2], "TAB") == 0)
  112.         {
  113.             flags1.printFlags ^= 0x0040;
  114.         }
  115.         if (stricmp (argv[2], "BANNER") == 0)
  116.         {
  117.             flags1.printFlags ^= 0x0080;
  118.         }
  119.     }
  120.     ccode = NWSetCaptureFlags (conn, 0x01, &flags1);
  121.     if (ccode) return;
  122. }