home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / top2src.zip / OS2.ZIP / CMDLINE.C < prev    next >
C/C++ Source or Header  |  1998-01-01  |  1KB  |  41 lines

  1. /******************************************************************************
  2. CMDLINE.C    Handle doorkit-specific command line parameters. */
  3. Copyright 1993 - 1998 Paul Sidorsky, All Rights Reserved
  4. Based on sample code by Joel Downer, author of Doors/2.
  5.  
  6. This manual handles some extra command line options for the OS/2 version of
  7. TOP.
  8. ******************************************************************************/
  9.  
  10. #include "top.h"
  11.  
  12. /* ProcessCmdLine() - Process extra command line options.
  13.    Parameters:  ac - Number of arguments (argc).
  14.                 av - String array of arguments (argv).
  15.    Returns:  Nothing. */
  16. void ProcessCmdLine(XINT ac, char *av[])
  17.    {
  18. #ifdef __OS2__
  19.    short ctr; /* Counter. */
  20.  
  21.    /* Don't bother processing if there's only one argument. */
  22.    if (ac > 1)
  23.       {
  24.       /* Process each argument. */
  25.       for (ctr = 1; ctr < ac; ctr++)
  26.          {
  27.          /* Port number mode (as opposed to handle mode). */
  28.          if ((!strcmpi(av[ctr], "-PORT")) || (!strcmpi(av[ctr], "/PORT")))
  29.             od_control.use_port = TRUE;
  30.          /* Nice mode (low CPU usage). */
  31.          else if ((!strcmpi(av[ctr], "-NICE")) || (!strcmpi(av[ctr], "/NICE")))
  32.             od_control.od_timing = TIMING_NICE;
  33.          /* Nasty mode (hogs the CPU). */
  34.          else if ((!strcmpi(av[ctr], "-NASTY")) || (!strcmpi(av[ctr], "/NASTY")))
  35.             od_control.od_timing = TIMING_NASTY;
  36.          }
  37.       }
  38. #endif
  39.    }
  40.  
  41.