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.

156 lines
6.0 KiB

  1. /* /////////////////////////////////////////////////////////////////////////
  2. * File: pantheios/frontends/fe.N.h
  3. *
  4. * Purpose: Declaration of the Pantheios fe.N Stock Front-end API.
  5. *
  6. * Created: 18th October 2006
  7. * Updated: 20th March 2012
  8. *
  9. * Home: http://www.pantheios.org/
  10. *
  11. * Copyright (c) 2006-2012, 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/frontends/fe.N.h
  41. *
  42. * [C,C++] Pantheios fe.N Stock Front-end API
  43. */
  44. #ifndef PANTHEIOS_INCL_PANTHEIOS_FRONTENDS_H_FE_N
  45. #define PANTHEIOS_INCL_PANTHEIOS_FRONTENDS_H_FE_N
  46. /* /////////////////////////////////////////////////////////////////////////
  47. * Version information
  48. */
  49. #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
  50. # define PANTHEIOS_VER_PANTHEIOS_FRONTENDS_H_FE_N_MAJOR 2
  51. # define PANTHEIOS_VER_PANTHEIOS_FRONTENDS_H_FE_N_MINOR 2
  52. # define PANTHEIOS_VER_PANTHEIOS_FRONTENDS_H_FE_N_REVISION 3
  53. # define PANTHEIOS_VER_PANTHEIOS_FRONTENDS_H_FE_N_EDIT 15
  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_FRONTENDS_H_STOCK
  62. # include <pantheios/frontends/stock.h>
  63. #endif /* !PANTHEIOS_INCL_PANTHEIOS_FRONTENDS_H_STOCK */
  64. /** \defgroup group__frontend__stock_frontends__N Pantheios N Stock Front-end
  65. * \ingroup group__frontend__stock_frontends
  66. * Front-end library that can filter N back-ends.
  67. */
  68. /* /////////////////////////////////////////////////////////////////////////
  69. * API
  70. */
  71. /* /////////////////////////////////////////////////////////////////////////
  72. * Typedefs
  73. */
  74. /** Structure that describes a filter entry.
  75. *
  76. * \ingroup group__frontend__stock_frontends__N
  77. *
  78. *
  79. \htmlonly
  80. <pre>
  81. PANTHEIOS_EXTERN_C pan_fe_N_t PAN_FE_N_SEVERITY_CEILINGS[] =
  82. {
  83. { 1, PANTHEIOS_SEV_WARNING }, // Back-end 1 has a ceiling of WARNING (so will log WARNING, ERROR, CRITICAL, ALERT, and EMERGENCY)
  84. { 2, PANTHEIOS_SEV_ERROR }, // Back-end 2 has a ceiling of ERROR (so will log ERROR, CRITICAL, ALERT, and EMERGENCY)
  85. PANTHEIOS_FE_N_TERMINATOR_ENTRY(PANTHEIOS_SEV_NOTICE) // default severity of NOTICE
  86. };
  87. </pre>
  88. \endhtmlonly
  89. */
  90. struct pan_fe_N_t
  91. {
  92. /** The back-end identifier. Specify 0 to terminate the array. */
  93. int backEndId;
  94. /** The severity ceiling. When backEndId is 0, this specifies the default ceiling */
  95. int severityCeiling;
  96. };
  97. #ifndef __cplusplus
  98. typedef struct pan_fe_N_t pan_fe_N_t;
  99. #endif /* __cplusplus */
  100. /** \def PANTHEIOS_FE_N_TERMINATOR_ENTRY
  101. *
  102. * Defines a terminating entry in an array of pan_fe_N_t
  103. *
  104. * \ingroup group__frontend__stock_frontends__N
  105. *
  106. * \see pan_fe_N_t
  107. */
  108. #define PANTHEIOS_FE_N_TERMINATOR_ENTRY(defaultCeiling) { 0, defaultCeiling }
  109. /* /////////////////////////////////////////////////////////////////////////
  110. * External Declarations
  111. */
  112. #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
  113. struct Pantheios_no_longer_uses_the_symbol_PAN_FE_N_PROCESS_IDENTITY_all_front_ends_now_recognise_PANTHEIOS_FE_PROCESS_IDENTITY_;
  114. # define PAN_FE_N_PROCESS_IDENTITY (Pantheios_no_longer_uses_the_symbol_PAN_FE_N_PROCESS_IDENTITY_all_front_ends_now_recognise_PANTHEIOS_FE_PROCESS_IDENTITY_)
  115. #endif /* !PANTHEIOS_DOCUMENTATION_SKIP_SECTION */
  116. /** The application must define this variable, to contain an array
  117. * of filter entries whose last, "null", element has a <code>0</code>
  118. * \link pan_fe_N_t::backEndId backEndId\endlink.
  119. *
  120. * \warning Due to the inherent ordering imperfection in C++ - it's not
  121. * predictable between compilation units; see Chapter 11 of Imperfect
  122. * C++ (http://imperfectcplusplus.com) - you should <b>not</b> use
  123. * the pseudo-constants (pantheios::debug, pantheios::informational, ...
  124. * pantheios::emergency) in the initialisers for this array. Instead,
  125. * use the enumerators in
  126. * \link pantheios::pan_severity_t pan_severity_t\endlink.
  127. *
  128. * \note This array is declared mutable (non-const), but that is only as
  129. * an expedient for testing. Its contents <b>must not be changed</b>\
  130. * at any time
  131. *
  132. * \ingroup group__frontend__stock_frontends__N
  133. */
  134. PANTHEIOS_EXTERN_C pan_fe_N_t PAN_FE_N_SEVERITY_CEILINGS[];
  135. /* ////////////////////////////////////////////////////////////////////// */
  136. #endif /* PANTHEIOS_INCL_PANTHEIOS_FRONTENDS_H_FE_N */
  137. /* ///////////////////////////// end of file //////////////////////////// */