Leaked source code of windows server 2003
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.

105 lines
2.5 KiB

  1. /*++
  2. Copyright (c) 1988-1999 Microsoft Corporation
  3. Module Name:
  4. ckeys.c
  5. Abstract:
  6. Dummy support for DOS KEYS command
  7. --*/
  8. #include "cmd.h"
  9. extern TCHAR KeysStr[];
  10. /* global variables */
  11. int KeysFlag = 0; /* KeysFlag indicates on / off */
  12. /**************** START OF SPECIFICATIONS ***********************/
  13. /* */
  14. /* SUBROUTINE NAME: eKeys */
  15. /* */
  16. /* DESCRIPTIVE NAME: Keys internal command */
  17. /* */
  18. /* FUNCTION: If no argument supplied then display the state */
  19. /* of on / off. If argument is on / off then */
  20. /* change the state. If argument is list then */
  21. /* display the stack. */
  22. /* */
  23. /* NOTES: New for OS/2 1.2. */
  24. /* */
  25. /* ENTRY POINT: eKeys */
  26. /* LINKAGE: */
  27. /* */
  28. /* INPUT: */
  29. /* n */
  30. /* */
  31. /* EXIT-NORMAL: */
  32. /* returns SUCCESS */
  33. /* */
  34. /* EXIT-ERROR: */
  35. /* none. */
  36. /* */
  37. /* EFFECTS: */
  38. /* */
  39. /* INTERNAL REFERENCES: */
  40. /* ROUTINES: */
  41. /* PutStdErr */
  42. /* PutStdOut */
  43. /* TokStr */
  44. /* strcmpi */
  45. /* strncpy */
  46. /* */
  47. /* EXTERNAL REFERENCES: */
  48. /* ROUTINES: */
  49. /**************** END OF SPECIFICATIONS *************************/
  50. eKeys( n )
  51. struct cmdnode *n; /* the command node for the Keys command */
  52. {
  53. TCHAR *argptr; /* pointer to tozenized argument */
  54. /* get the value of the argument pointer */
  55. argptr = TokStr( n->argptr, 0, TS_NOFLAGS );
  56. /* take action based on the argument */
  57. if ((*argptr == 0) && (KeysFlag)) {
  58. PutStdOut( MSG_KEYS_ON, NOARGS );
  59. }
  60. else if ((*argptr == 0) && (!KeysFlag)) {
  61. PutStdOut( MSG_KEYS_OFF, NOARGS );
  62. }
  63. else if (!(argptr[ mystrlen( argptr ) + 1 ] == 0)) {
  64. /* too many parameters */
  65. PutStdErr( MSG_BAD_SYNTAX, NOARGS );
  66. }
  67. else if (_tcsicmp( argptr, TEXT("ON") ) == 0) {
  68. /* set keys on */
  69. KeysFlag = TRUE;
  70. SetEnvVar(KeysStr, TEXT("ON") );
  71. }
  72. else if (_tcsicmp( argptr, TEXT("OFF") ) == 0) {
  73. /* set keys off */
  74. KeysFlag = FALSE;
  75. SetEnvVar(KeysStr, TEXT("OFF") );
  76. }
  77. else if (_tcsicmp( argptr, TEXT("LIST") ) == 0) {
  78. }
  79. else {
  80. /* invalid parameter */
  81. PutStdErr( MSG_BAD_PARM1, NOARGS );
  82. }
  83. return SUCCESS;
  84. } /* eKeys */