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.

58 lines
1.4 KiB

  1. /******************************************************************************
  2. * getopt.h *
  3. *----------*
  4. * This is the equivalent to the program options parsing utility
  5. * found in most UNIX compilers.
  6. *------------------------------------------------------------------------------
  7. * Copyright (C) 1997 Entropic Research Laboratory, Inc.
  8. * Copyright (C) 1998 Entropic, Inc.
  9. * Copyright (C) 2000 Microsoft Corporation Date: 03/21/00
  10. * All Rights Reserved
  11. *
  12. ********************************************************************* PACOG ***/
  13. #ifndef __GETOPT_H_
  14. #define __GETOPT_H_
  15. #include <windows.h>
  16. class CGetOpt
  17. {
  18. public:
  19. CGetOpt (bool fReportError = true);
  20. void Init ( int argc, char* argv[], char* opstring);
  21. int NextOption ();
  22. char* OptArg ();
  23. int OptInd ();
  24. private:
  25. int m_argc;
  26. char** m_argv;
  27. char* m_optstring;
  28. char* m_scan;
  29. int m_optind;
  30. char* m_optarg;
  31. bool m_opterr;
  32. };
  33. class CWGetOpt
  34. {
  35. public:
  36. CWGetOpt (bool fReportError = true);
  37. void Init ( int argc, WCHAR* argv[], WCHAR* opstring);
  38. int NextOption ();
  39. WCHAR* OptArg ();
  40. int OptInd ();
  41. private:
  42. int m_argc;
  43. WCHAR** m_argv;
  44. WCHAR* m_optstring;
  45. WCHAR* m_scan;
  46. int m_optind;
  47. WCHAR* m_optarg;
  48. bool m_opterr;
  49. };
  50. #endif