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.

112 lines
2.8 KiB

  1. /* /////////////////////////////////////////////////////////////////////////
  2. * File: test/scratch/test.scratch.fe.WindowsRegistry/test.scratch.fe.WindowsRegistry.cpp
  3. *
  4. * Purpose: Implementation file for the test.scratch.fe.WindowsRegistry project.
  5. *
  6. * Created: 28th October 2007
  7. * Updated: 6th August 2012
  8. *
  9. * Status: Wizard-generated
  10. *
  11. * License: (Licensed under the Synesis Software Open License)
  12. *
  13. * Copyright (c) 2007-2012, Synesis Software Pty Ltd.
  14. * All rights reserved.
  15. *
  16. * www: http://www.synesis.com.au/software
  17. *
  18. * ////////////////////////////////////////////////////////////////////// */
  19. #define PANTHEIOS_NO_INCLUDE_OS_AND_3PTYLIB_STRING_ACCESS
  20. /* Pantheios Header Files */
  21. #include <pantheios/pantheios.hpp>
  22. /* STLSoft Header Files */
  23. #include <winstl/error/error_desc.hpp>
  24. /* Standard C++ Header Files */
  25. #include <exception>
  26. #include <iostream>
  27. /* Standard C Header Files */
  28. #include <stdlib.h>
  29. #if defined(_MSC_VER) && \
  30. defined(_DEBUG)
  31. # include <crtdbg.h>
  32. #endif /* _MSC_VER) && _DEBUG */
  33. /* /////////////////////////////////////////////////////////////////////////
  34. * Globals
  35. */
  36. PANTHEIOS_EXTERN_C PAN_CHAR_T const PANTHEIOS_FE_PROCESS_IDENTITY[] = PANTHEIOS_LITERAL_STRING("test.scratch.fe.WindowsRegistry");
  37. /* ////////////////////////////////////////////////////////////////////// */
  38. static int main_(int /* argc */, char** /*argv*/)
  39. {
  40. pantheios::log_DEBUG("debug");
  41. pantheios::log_INFORMATIONAL("informational");
  42. pantheios::log_NOTICE("notice");
  43. pantheios::log_WARNING("warning");
  44. pantheios::log_ERROR("error");
  45. pantheios::log_CRITICAL("critical");
  46. pantheios::log_ALERT("alert");
  47. pantheios::log_EMERGENCY("emergency");
  48. return EXIT_SUCCESS;
  49. }
  50. int main(int argc, char** argv)
  51. {
  52. int res;
  53. #if defined(_MSC_VER) && \
  54. defined(_DEBUG)
  55. _CrtMemState memState;
  56. #endif /* _MSC_VER && _MSC_VER */
  57. #if defined(_MSC_VER) && \
  58. defined(_DEBUG)
  59. _CrtMemCheckpoint(&memState);
  60. #endif /* _MSC_VER && _MSC_VER */
  61. #if 0
  62. { for(size_t i = 0; i < 0xffffffff; ++i){} }
  63. #endif /* 0 */
  64. try
  65. {
  66. #if defined(_DEBUG) || \
  67. defined(__SYNSOFT_DBS_DEBUG)
  68. pantheios::log_DEBUG("test.scratch.fe.WindowsRegistry: " __STLSOFT_COMPILER_LABEL_STRING);
  69. #endif /* debug */
  70. res = main_(argc, argv);
  71. }
  72. catch(std::exception &x)
  73. {
  74. pantheios::log_ALERT("Unexpected general error: ", x, ". Application terminating");
  75. res = EXIT_FAILURE;
  76. }
  77. catch(...)
  78. {
  79. pantheios::logputs(pantheios::emergency, "Unhandled unknown error");
  80. res = EXIT_FAILURE;
  81. }
  82. #if defined(_MSC_VER) && \
  83. defined(_DEBUG)
  84. _CrtMemDumpAllObjectsSince(&memState);
  85. #endif /* _MSC_VER) && _DEBUG */
  86. return res;
  87. }
  88. /* ////////////////////////////////////////////////////////////////////// */