Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
3.8 KiB

  1. //Copyright (c) 1998 - 1999 Microsoft Corporation
  2. /*****************************************************************************
  3. *
  4. * OPTIONS.H
  5. *
  6. * Copyright Citrix Systems Inc. 1992
  7. *
  8. * Author: Kurt Perry
  9. *
  10. *
  11. ****************************************************************************/
  12. /*=============================================================================
  13. == Defines
  14. =============================================================================*/
  15. #define FALSE 0
  16. #define TRUE 1
  17. #define OP_BOOL 0x01
  18. #define OP_UINT 0x02
  19. #define OP_STRING 0x04
  20. /*=============================================================================
  21. == Variables
  22. =============================================================================*/
  23. extern char bDefaults;
  24. extern char bQ;
  25. extern char bStartMonitor;
  26. extern char bStopMonitor;
  27. extern int dDetectProbationCount;
  28. extern int dInProbationCount;
  29. extern int dmsAllowed;
  30. extern int dmsSleep;
  31. extern int dBusymsAllowed;
  32. extern int dmsProbationTrial;
  33. extern int dmsGoodProbationEnd;
  34. extern int dDetectionInterval;
  35. char fHelp = FALSE;
  36. /*=============================================================================
  37. == Structures
  38. =============================================================================*/
  39. typedef struct _OPTION {
  40. char * option;
  41. int optype;
  42. char * * string;
  43. char * bool;
  44. unsigned int * unint;
  45. char * help;
  46. } OPTION, * POPTION;
  47. /*
  48. * Option array, all valid command line options.
  49. */
  50. OPTION options[] = {
  51. { "?", OP_BOOL, NULL, &fHelp, NULL,
  52. "" },
  53. { "DEFAULTS", OP_BOOL, NULL, &bDefaults, NULL,
  54. "/DEFAULTS Reset all tuning parameters to system defaults.\n" },
  55. { "Q", OP_BOOL, NULL, &bQ, NULL,
  56. "/Q Do not display any information.\n" },
  57. { "DETECTPROBATIONCOUNT:", OP_UINT, NULL, NULL, &dDetectProbationCount,
  58. "/DETECTPROBATIONCOUNT:nnn # of peeks in the detection interval required to force \
  59. the application into the probation state and to sleep the application.\n" },
  60. { "INPROBATIONCOUNT:", OP_UINT, NULL, NULL, &dInProbationCount,
  61. "/INPROBATIONCOUNT:nnn # of peeks in the detection interval required to sleep \
  62. the application when the application is in probation. Should be <= DETECTPROBATIONCOUNT.\n" },
  63. { "MSALLOWED:", OP_UINT, NULL, NULL, &dmsAllowed,
  64. "/MSALLOWED:nnn # of milliseconds the application is allowed \
  65. to be in the probation state before the system starts sleeping the application.\n" },
  66. { "MSSLEEP:", OP_UINT, NULL, NULL, &dmsSleep,
  67. "/MSSLEEP:nnn # of milliseconds that the application is put to sleep.\n" },
  68. { "BUSYMSALLOWED:", OP_UINT, NULL, NULL, &dBusymsAllowed,
  69. "/BUSYMSALLOWED:nnn When the application is detected as 'busy' the \
  70. application cannot be put into the probation state for this # of milliseconds.\n" },
  71. { "MSPROBATIONTRIAL:", OP_UINT, NULL, NULL, &dmsProbationTrial,
  72. "/MSPROBATIONTRIAL:nnn When the application is in probation, \
  73. DETECTPROBATIONCOUNT is used instead of INPROBATIONCOUNT every MSPROBATIONTRIAL milliseconds.\n" },
  74. { "MSGOODPROBATIONEND:", OP_UINT, NULL, NULL, &dmsGoodProbationEnd,
  75. "/MSGOODPROBATIONEND:nnn When the application is in probation it must \
  76. avoid being put to sleep for this # of milliseconds in order to be removed from probation.\n" },
  77. { "DETECTIONINTERVAL:", OP_UINT, NULL, NULL, &dDetectionInterval,
  78. "/DETECTIONINTERVAL:nnn The length of time (in ticks) used to count up \
  79. the number of polling events.\n" },
  80. { "STARTMONITOR", OP_BOOL, NULL, &bStartMonitor, NULL,
  81. "/STARTMONITOR [appname] Start gathering polling statistics.\n"},
  82. { "STOPMONITOR", OP_BOOL, NULL, &bStopMonitor, NULL,
  83. "/STOPMONITOR Stop gathering polling information and display statistics.\n"},
  84. };
  85. #define ARG_COUNT (int)(sizeof(options) / sizeof(OPTION))