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.

56 lines
1.2 KiB

  1. /********************************************************************/
  2. /** Microsoft LAN Manager **/
  3. /** Copyright(c) Microsoft Corp., 1987-1990 **/
  4. /********************************************************************/
  5. #define INCL_NOCOMMON
  6. #include <os2.h>
  7. #include <stddef.h>
  8. #include <stdio.h>
  9. #include "netcmds.h"
  10. #include "os2incl.h"
  11. #include "os2cmd.h"
  12. /*
  13. * LEXOR - identify the next input word.
  14. */
  15. int lexor(register TOKSTACK *t)
  16. {
  17. extern KEYTAB KeyTab[];
  18. KEYTAB *p;
  19. static int index = 0;
  20. #ifdef DEBUG
  21. WriteToCon( TEXT("LEX (index=%d) "),index);
  22. #endif
  23. if ((t->node = ArgList[index]) == NULL)
  24. {
  25. #ifdef DEBUG
  26. WriteToCon( TEXT("no more tokens (EOS)\n"));
  27. #endif
  28. return(t->token = EOS);
  29. }
  30. ++index;
  31. #ifdef DEBUG
  32. WriteToCon( TEXT("token is <%s> "),t->node);
  33. #endif
  34. /* see if there is a keyword match */
  35. for (p = KeyTab; p->text; ++p)
  36. if (!_tcsicmp(p->text, t->node))
  37. {
  38. #ifdef DEBUG
  39. WriteToCon( TEXT("matches <%s>, value %d\n"),p->text,p->key);
  40. #endif
  41. return(t->token = p->key);
  42. }
  43. /* no match found */
  44. #ifdef DEBUG
  45. WriteToCon( TEXT("no match\n"));
  46. #endif
  47. return(t->token = UNKNOWN);
  48. }