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.

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