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.

226 lines
8.7 KiB

  1. /* /////////////////////////////////////////////////////////////////////////
  2. * File: pantheios/backends/bec.WindowsDebugger.h
  3. *
  4. * Purpose: Declaration of the Pantheios WindowsDebugger Stock Back-end API.
  5. *
  6. * Created: 21st June 2005
  7. * Updated: 30th April 2010
  8. *
  9. * Home: http://www.pantheios.org/
  10. *
  11. * Copyright (c) 2005-2010, Matthew Wilson and Synesis Software
  12. * All rights reserved.
  13. *
  14. * Redistribution and use in source and binary forms, with or without
  15. * modification, are permitted provided that the following conditions are
  16. * met:
  17. *
  18. * - Redistributions of source code must retain the above copyright notice,
  19. * this list of conditions and the following disclaimer.
  20. * - Redistributions in binary form must reproduce the above copyright
  21. * notice, this list of conditions and the following disclaimer in the
  22. * documentation and/or other materials provided with the distribution.
  23. * - Neither the name(s) of Matthew Wilson and Synesis Software nor the
  24. * names of any contributors may be used to endorse or promote products
  25. * derived from this software without specific prior written permission.
  26. *
  27. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  28. * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  29. * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  30. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  31. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  32. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  33. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  34. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  35. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  36. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  37. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  38. *
  39. * ////////////////////////////////////////////////////////////////////// */
  40. /** \file pantheios/backends/bec.WindowsDebugger.h
  41. *
  42. * [C, C++] Pantheios Windows Debugger Back-end Common API
  43. */
  44. #ifndef PANTHEIOS_INCL_PANTHEIOS_BACKENDS_H_BEC_WINDOWSDEBUGGER
  45. #define PANTHEIOS_INCL_PANTHEIOS_BACKENDS_H_BEC_WINDOWSDEBUGGER
  46. /* /////////////////////////////////////////////////////////////////////////
  47. * Version information
  48. */
  49. #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
  50. # define PANTHEIOS_VER_PANTHEIOS_BACKENDS_H_BEC_WINDOWSDEBUGGER_MAJOR 3
  51. # define PANTHEIOS_VER_PANTHEIOS_BACKENDS_H_BEC_WINDOWSDEBUGGER_MINOR 1
  52. # define PANTHEIOS_VER_PANTHEIOS_BACKENDS_H_BEC_WINDOWSDEBUGGER_REVISION 1
  53. # define PANTHEIOS_VER_PANTHEIOS_BACKENDS_H_BEC_WINDOWSDEBUGGER_EDIT 22
  54. #endif /* !PANTHEIOS_DOCUMENTATION_SKIP_SECTION */
  55. /* /////////////////////////////////////////////////////////////////////////
  56. * Includes
  57. */
  58. #ifndef PANTHEIOS_INCL_PANTHEIOS_H_PANTHEIOS
  59. # include <pantheios/pantheios.h>
  60. #endif /* !PANTHEIOS_INCL_PANTHEIOS_H_PANTHEIOS */
  61. #ifndef PANTHEIOS_INCL_PANTHEIOS_H_BACKEND
  62. # include <pantheios/backend.h>
  63. #endif /* !PANTHEIOS_INCL_PANTHEIOS_H_BACKEND */
  64. #ifndef PANTHEIOS_INCL_PANTHEIOS_UTIL_BACKENDS_H_ARGUMENTS
  65. # include <pantheios/util/backends/arguments.h>
  66. #endif /* !PANTHEIOS_INCL_PANTHEIOS_UTIL_BACKENDS_H_ARGUMENTS */
  67. /* /////////////////////////////////////////////////////////////////////////
  68. * Documentation
  69. */
  70. /** \defgroup group__backend__stock_backends__WindowsDebugger Pantheios Windows Debugger Stock Back-end
  71. * \ingroup group__backend__stock_backends
  72. * Back-end library that outputs to the Windows debugger.
  73. */
  74. /* /////////////////////////////////////////////////////////////////////////
  75. * Constants
  76. */
  77. /** \defgroup group__backend__stock_backends__WindowsDebugger__flags Pantheios Windows Debugger Stock Back-end Flags
  78. * \ingroup group__backend__stock_backends__WindowsDebugger
  79. * Flags for the \ref group__backend__stock_backends__WindowsDebugger
  80. */
  81. /* /////////////////////////////////////////////////////////////////////////
  82. * Typedefs
  83. */
  84. /** Structure used for specifying initialisation information to the
  85. * be.WindowsDebugger library.
  86. * \ingroup group__backend__stock_backends__WindowsDebugger
  87. */
  88. struct pan_be_WindowsDebugger_init_t
  89. {
  90. #if !defined(PANTHEIOS_DOCUMENTATION_SKIP_SECTION) && \
  91. !defined(PANTHEIOS_NO_NAMESPACE)
  92. typedef pantheios::pan_uint32_t pan_uint32_t;
  93. #endif /* !PANTHEIOS_DOCUMENTATION_SKIP_SECTION && !PANTHEIOS_NO_NAMESPACE */
  94. pan_uint32_t version; /*!< Must be initialised to the value of PANTHEIOS_VER */
  95. pan_uint32_t flags; /*!< \ref group__backend__stock_backends__WindowsDebugger__flags "Flags" that control the information displayed. */
  96. #ifdef __cplusplus
  97. public: /* Construction */
  98. # ifndef PANTHEIOS_BE_INIT_NO_CPP_STRUCT_INIT
  99. pan_be_WindowsDebugger_init_t();
  100. # endif /* !PANTHEIOS_BE_INIT_NO_CPP_STRUCT_INIT */
  101. #endif /* __cplusplus */
  102. };
  103. #ifndef __cplusplus
  104. typedef struct pan_be_WindowsDebugger_init_t pan_be_WindowsDebugger_init_t;
  105. #endif /* !__cplusplus */
  106. /* /////////////////////////////////////////////////////////////////////////
  107. * Application-defined functions
  108. */
  109. /** Callback function defined by the application, invoked when the
  110. * API is initialised with a NULL <code>init</code> parameter.
  111. *
  112. * \note When using explicit initialisation, this function must be defined,
  113. * but will not be invoked.
  114. */
  115. PANTHEIOS_CALL(void) pantheios_be_WindowsDebugger_getAppInit(
  116. int backEndId
  117. , pan_be_WindowsDebugger_init_t* init
  118. ) /* throw() */;
  119. /* /////////////////////////////////////////////////////////////////////////
  120. * API
  121. */
  122. /** Fills out a copy of the initialisation structure with default
  123. * values (representative of the default behaviour of the library),
  124. * ready to be customised and passed to the API initialiser function
  125. * pantheios_be_WindowsDebugger_init().
  126. */
  127. PANTHEIOS_CALL(void) pantheios_be_WindowsDebugger_getDefaultAppInit(
  128. pan_be_WindowsDebugger_init_t* init
  129. ) /* throw() */;
  130. /** Implements the functionality for pantheios_be_init() over the Windows Debugger API.
  131. * \ingroup group__backend__stock_backends__WindowsDebugger
  132. */
  133. PANTHEIOS_CALL(int) pantheios_be_WindowsDebugger_init(
  134. PAN_CHAR_T const* processIdentity
  135. , int id
  136. , pan_be_WindowsDebugger_init_t const* init
  137. , void* reserved
  138. , void** ptoken
  139. );
  140. /** Implements the functionality for pantheios_be_uninit() over the Windows Debugger API.
  141. * \ingroup group__backend__stock_backends__WindowsDebugger
  142. */
  143. PANTHEIOS_CALL(void) pantheios_be_WindowsDebugger_uninit(
  144. void* token
  145. );
  146. /** Implements the functionality for pantheios_be_logEntry() over the Windows Debugger API.
  147. * \ingroup group__backend__stock_backends__WindowsDebugger
  148. */
  149. PANTHEIOS_CALL(int) pantheios_be_WindowsDebugger_logEntry(
  150. void* feToken
  151. , void* beToken
  152. , int severity
  153. , PAN_CHAR_T const* entry
  154. , size_t cchEntry
  155. );
  156. /** \def pantheios_be_WindowsDebugger_parseArgs
  157. *
  158. * Parses the be.WindowsDebugger back-end flags
  159. *
  160. * \ingroup group__backend
  161. *
  162. * Processes an argument list in the same way as
  163. * pantheios_be_parseStockArgs(), filling out the
  164. * pan_be_WindowsDebugger_init_t in accordance with the arguments
  165. * found.
  166. *
  167. * Recognises the following standard argument names:
  168. * - "showProcessId" (Boolean)
  169. * - "showTime" (Boolean)
  170. * - "showSeverity" (Boolean)
  171. * - "useSystemTime" (Boolean)
  172. * - "showDetailsAtStart" (Boolean)
  173. * - "useUnixFormat" (Boolean)
  174. * - "showDate" (Boolean)
  175. * - "showTime" (Boolean)
  176. * - "highResolution" (Boolean)
  177. * - "lowResolution" (Boolean)
  178. *
  179. * There are currently no back-end specific arguments, hence
  180. * pantheios_be_WindowsDebugger_parseArgs is actually a \#define for
  181. * pantheios_be_parseStockArgs. At such time as back-end specific arguments
  182. * are required, it will become a first-class function.
  183. */
  184. #define pantheios_be_WindowsDebugger_parseArgs(num, args, init) pantheios_be_parseStockArgs((num), (args), (NULL == (init)) ? NULL : (&(init)->flags))
  185. /* ////////////////////////////////////////////////////////////////////// */
  186. #ifdef __cplusplus
  187. # ifndef PANTHEIOS_BE_INIT_NO_CPP_STRUCT_INIT
  188. inline pan_be_WindowsDebugger_init_t::pan_be_WindowsDebugger_init_t()
  189. {
  190. pantheios_be_WindowsDebugger_getDefaultAppInit(this);
  191. }
  192. # endif /* !PANTHEIOS_BE_INIT_NO_CPP_STRUCT_INIT */
  193. #endif /* __cplusplus */
  194. /* ////////////////////////////////////////////////////////////////////// */
  195. #endif /* PANTHEIOS_INCL_PANTHEIOS_BACKENDS_H_BEC_WINDOWSDEBUGGER */
  196. /* ///////////////////////////// end of file //////////////////////////// */