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.0 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1996 - 1999
  3. All rights reserved.
  4. Module Name:
  5. getopt.hxx
  6. Abstract:
  7. System V getopt header
  8. Author:
  9. Steve Kiraly (SteveKi) 29-Sept-1996
  10. Revision History:
  11. --*/
  12. #ifndef _GETOPT_HXX
  13. #define _GETOPT_HXX
  14. #define INVALID_COMAND -4 // Invalid command switch found
  15. class TGetOptContext
  16. {
  17. public:
  18. TGetOptContext()
  19. : optind(1),
  20. optarg(NULL),
  21. opterr(FALSE),
  22. letP(NULL),
  23. SW(TEXT('/'))
  24. {}
  25. //
  26. // The getopt context variables
  27. //
  28. INT optind; // index of which argument is next
  29. TCHAR *optarg; // pointer to argument of current option
  30. INT opterr; // By default we do not allow error message
  31. TCHAR *letP; // remember next option char's location
  32. TCHAR SW; // Switch character '/'
  33. };
  34. extern "C"
  35. INT
  36. getopt(
  37. INT argc,
  38. TCHAR *argv[],
  39. TCHAR *optionS,
  40. TGetOptContext &context
  41. );
  42. #endif GETOPT_H