Synesis Software STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ...

pantheios/util/core/apidefs.hpp

Go to the documentation of this file.
00001 /* /////////////////////////////////////////////////////////////////////////
00002  * File:        pantheios/util/core/apidefs.hpp
00003  *
00004  * Purpose:     API definition helpers for use in Pantheios back- and front-
00005  *              ends.
00006  *
00007  * Created:     3rd November 2007
00008  * Updated:     10th August 2009
00009  *
00010  * Home:        http://www.pantheios.org/
00011  *
00012  * Copyright (c) 2007-2009, Matthew Wilson and Synesis Software
00013  * All rights reserved.
00014  *
00015  * Redistribution and use in source and binary forms, with or without
00016  * modification, are permitted provided that the following conditions are
00017  * met:
00018  *
00019  * - Redistributions of source code must retain the above copyright notice,
00020  *   this list of conditions and the following disclaimer.
00021  * - Redistributions in binary form must reproduce the above copyright
00022  *   notice, this list of conditions and the following disclaimer in the
00023  *   documentation and/or other materials provided with the distribution.
00024  * - Neither the name(s) of Matthew Wilson and Synesis Software nor the
00025  *   names of any contributors may be used to endorse or promote products
00026  *   derived from this software without specific prior written permission.
00027  *
00028  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
00029  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
00030  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00031  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
00032  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00033  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00034  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00035  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00036  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00037  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00038  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00039  *
00040  * ////////////////////////////////////////////////////////////////////// */
00041 
00042 
00049 #ifndef PANTHEIOS_INCL_PANTHEIOS_UTIL_CORE_HPP_APIDEFS
00050 #define PANTHEIOS_INCL_PANTHEIOS_UTIL_CORE_HPP_APIDEFS
00051 
00052 /* /////////////////////////////////////////////////////////////////////////
00053  * Version information
00054  */
00055 
00056 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00057 # define PANTHEIOS_VER_PANTHEIOS_UTIL_CORE_HPP_APIDEFS_MAJOR    2
00058 # define PANTHEIOS_VER_PANTHEIOS_UTIL_CORE_HPP_APIDEFS_MINOR    1
00059 # define PANTHEIOS_VER_PANTHEIOS_UTIL_CORE_HPP_APIDEFS_REVISION 1
00060 # define PANTHEIOS_VER_PANTHEIOS_UTIL_CORE_HPP_APIDEFS_EDIT     15
00061 #endif /* !PANTHEIOS_DOCUMENTATION_SKIP_SECTION */
00062 
00063 /* /////////////////////////////////////////////////////////////////////////
00064  * Includes
00065  */
00066 
00067 #ifndef PANTHEIOS_INCL_PANTHEIOS_H_PANTHEIOS
00068 # include <pantheios/pantheios.h>
00069 #endif /* !PANTHEIOS_INCL_PANTHEIOS_H_PANTHEIOS */
00070 #ifndef PANTHEIOS_INCL_PANTHEIOS_H_BACKEND
00071 # include <pantheios/backend.h>
00072 #endif /* !PANTHEIOS_INCL_PANTHEIOS_H_BACKEND */
00073 #ifndef PANTHEIOS_INCL_PANTHEIOS_H_FRONTEND
00074 # include <pantheios/frontend.h>
00075 #endif /* !PANTHEIOS_INCL_PANTHEIOS_H_FRONTEND */
00076 #ifndef PANTHEIOS_INCL_PANTHEIOS_H_INIT_CODES
00077 # include <pantheios/init_codes.h>
00078 #endif /* !PANTHEIOS_INCL_PANTHEIOS_H_INIT_CODES */
00079 
00080 #ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT
00081 # include <stlsoft/stlsoft.h>
00082 #endif /* !STLSOFT_INCL_STLSOFT_H_STLSOFT */
00083 
00084 /* /////////////////////////////////////////////////////////////////////////
00085  * Typedefs
00086  */
00087 
00089 typedef int (PANTHEIOS_CALLCONV* pantheios_fe_X_init_pfn_t)(
00090     void*   reserved
00091 ,   void**  ptoken
00092 );
00093 
00095 typedef int (PANTHEIOS_CALLCONV* pantheios_fe_X_uninit_pfn_t)(
00096     void*   token
00097 );
00098 
00100 typedef PAN_CHAR_T const* (PANTHEIOS_CALLCONV* pantheios_fe_X_getProcessIdentity_pfn_t)(void* token);
00101 
00103 typedef int (PANTHEIOS_CALLCONV* pantheios_fe_X_isSeverityLogged_pfn_t)(
00104     void*   token
00105 ,   int     severity
00106 ,   int     backEndId
00107 );
00108 
00109 
00111 typedef int (PANTHEIOS_CALLCONV* pantheios_be_X_init_pfn_t)(
00112     PAN_CHAR_T const*   processIdentity
00113 ,   int                 backEndId
00114 ,   void const*         init
00115 ,   void*               reserved
00116 ,   void**              ptoken
00117 );
00118 
00120 typedef int (PANTHEIOS_CALLCONV* pantheios_be_X_uninit_pfn_t)(
00121     void*       token
00122 );
00123 
00125 typedef int (PANTHEIOS_CALLCONV* pantheios_be_X_logEntry_pfn_t)(
00126     void*               feToken
00127 ,   void*               beToken
00128 ,   int                 severity
00129 ,   PAN_CHAR_T const*   entry
00130 ,   size_t              cchEntry
00131 );
00132 
00133 /* /////////////////////////////////////////////////////////////////////////
00134  * Front-end Functions
00135  */
00136 
00137 #if defined(STLSOFT_CF_EXCEPTION_SUPPORT) || \
00138     defined(PANTHEIOS_DOCUMENTATION_SKIP_SECTION)
00139 
00146 PANTHEIOS_CALL(int) pantheios_call_fe_init(
00147     pantheios_fe_X_init_pfn_t   pfn
00148 ,   void*                       reserved
00149 ,   void**                      ptoken
00150 );
00151 #else /* ? STLSOFT_CF_EXCEPTION_SUPPORT */
00152 inline int pantheios_call_fe_uninit(pantheios_fe_X_init_pfn_t pfn, void* reserved, void** ptoken)
00153 {
00154     return pfn(reserved, ptoken);
00155 }
00156 #endif /* STLSOFT_CF_EXCEPTION_SUPPORT */
00157 
00158 
00159 #if defined(STLSOFT_CF_EXCEPTION_SUPPORT) || \
00160     defined(PANTHEIOS_DOCUMENTATION_SKIP_SECTION)
00161 
00167 PANTHEIOS_CALL(int) pantheios_call_fe_uninit(
00168     pantheios_fe_X_uninit_pfn_t pfn
00169 ,   void*                       token
00170 );
00171 #else /* ? STLSOFT_CF_EXCEPTION_SUPPORT */
00172 inline int pantheios_call_fe_uninit(pantheios_fe_X_uninit_pfn_t pfn, void* token)
00173 {
00174     return pfn(token);
00175 }
00176 #endif /* STLSOFT_CF_EXCEPTION_SUPPORT */
00177 
00178 
00179 #if defined(STLSOFT_CF_EXCEPTION_SUPPORT) || \
00180     defined(PANTHEIOS_DOCUMENTATION_SKIP_SECTION)
00181 
00187 PANTHEIOS_CALL(PAN_CHAR_T const*) pantheios_call_fe_getProcessIdentity(
00188     pantheios_fe_X_getProcessIdentity_pfn_t pfn
00189 ,   void*                                   token
00190 );
00191 #else /* ? STLSOFT_CF_EXCEPTION_SUPPORT */
00192 inline PAN_CHAR_T const* pantheios_call_fe_getProcessIdentity(pantheios_fe_X_getProcessIdentity_pfn_t pfn, void* token)
00193 {
00194     return pfn(token);
00195 }
00196 #endif /* STLSOFT_CF_EXCEPTION_SUPPORT */
00197 
00198 
00199 #if defined(STLSOFT_CF_EXCEPTION_SUPPORT) || \
00200     defined(PANTHEIOS_DOCUMENTATION_SKIP_SECTION)
00201 
00216 PANTHEIOS_CALL(int) pantheios_call_fe_isSeverityLogged(
00217     pantheios_fe_X_isSeverityLogged_pfn_t   pfn
00218 ,   void*                                   token
00219 ,   int                                     severity
00220 ,   int                                     backEndId
00221 );
00222 #else /* ? STLSOFT_CF_EXCEPTION_SUPPORT */
00223 inline int pantheios_call_fe_isSeverityLogged(pantheios_fe_X_isSeverityLogged_pfn_t pfn, void* token, int severity, int backEndId)
00224 {
00225     return pfn(token, severity, backEndId);
00226 }
00227 #endif /* STLSOFT_CF_EXCEPTION_SUPPORT */
00228 
00229 /* /////////////////////////////////////////////////////////////////////////
00230  * Back-end Functions
00231  */
00232 
00233 #if defined(STLSOFT_CF_EXCEPTION_SUPPORT) || \
00234     defined(PANTHEIOS_DOCUMENTATION_SKIP_SECTION)
00235 
00245 PANTHEIOS_CALL(int) pantheios_call_be_void_init(
00246     pantheios_be_X_init_pfn_t   pfn
00247 ,   PAN_CHAR_T const*           processIdentity
00248 ,   int                         backEndId
00249 ,   void const*                 init
00250 ,   void*                       reserved
00251 ,   void**                      ptoken
00252 );
00253 #else /* ? STLSOFT_CF_EXCEPTION_SUPPORT */
00254 inline int pantheios_call_be_void_init(
00255     pantheios_be_X_init_pfn_t   pfn
00256 ,   PAN_CHAR_T const*           processIdentity
00257 ,   int                         backEndId
00258 ,   void const*                 init
00259 ,   void*                       reserved
00260 ,   void**                      ptoken
00261 )
00262 {
00263     return pfn(processIdentity, backEndId, init, reserved, ptoken);
00264 }
00265 #endif /* STLSOFT_CF_EXCEPTION_SUPPORT */
00266 
00267 
00278 template <typename T>
00279 inline int pantheios_call_be_X_init(
00280 #ifdef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00281     int (*                      pfn)(PAN_CHAR_T const*, int, T const*, void*, void**)
00282 #else /* ? PANTHEIOS_DOCUMENTATION_SKIP_SECTION */
00283     int (PANTHEIOS_CALLCONV*    pfn)(PAN_CHAR_T const*, int, T const*, void*, void**)
00284 #endif /* PANTHEIOS_DOCUMENTATION_SKIP_SECTION */
00285 ,   PAN_CHAR_T const*           processIdentity
00286 ,   int                         backEndId
00287 ,   T const*                    init
00288 ,   void*                       reserved
00289 ,   void**                      ptoken
00290 )
00291 {
00292     return pantheios_call_be_void_init(reinterpret_cast<pantheios_be_X_init_pfn_t>(pfn), processIdentity, backEndId, init, reserved, ptoken);
00293 }
00294 
00295 
00296 #if defined(STLSOFT_CF_EXCEPTION_SUPPORT) || \
00297     defined(PANTHEIOS_DOCUMENTATION_SKIP_SECTION)
00298 
00304 PANTHEIOS_CALL(int) pantheios_call_be_uninit(
00305     pantheios_be_X_uninit_pfn_t pfn
00306 ,   void*                       token
00307 );
00308 #else /* ? STLSOFT_CF_EXCEPTION_SUPPORT */
00309 inline int pantheios_call_be_uninit(pantheios_be_X_uninit_pfn_t pfn, void* token)
00310 {
00311     return pfn(token);
00312 }
00313 #endif /* STLSOFT_CF_EXCEPTION_SUPPORT */
00314 
00315 
00316 #if defined(STLSOFT_CF_EXCEPTION_SUPPORT) || \
00317     defined(PANTHEIOS_DOCUMENTATION_SKIP_SECTION)
00318 
00328 PANTHEIOS_CALL(int) pantheios_call_be_logEntry(
00329     pantheios_be_X_logEntry_pfn_t   pfn
00330 ,   void*                           feToken
00331 ,   void*                           beToken
00332 ,   int                             severity
00333 ,   PAN_CHAR_T const*               entry
00334 ,   size_t                          cchEntry
00335 );
00336 #else /* ? STLSOFT_CF_EXCEPTION_SUPPORT */
00337 inline int pantheios_call_be_logEntry(
00338     pantheios_be_X_logEntry_pfn_t   pfn
00339 ,   void*                           feToken
00340 ,   void*                           beToken
00341 ,   int                             severity
00342 ,   PAN_CHAR_T const*               entry
00343 ,   size_t                          cchEntry
00344 )
00345 {
00346     return pfn(feToken, beToken, severity, entry, cchEntry);
00347 }
00348 #endif /* STLSOFT_CF_EXCEPTION_SUPPORT */
00349 
00350 /* ////////////////////////////////////////////////////////////////////// */
00351 
00352 #endif /* !PANTHEIOS_INCL_PANTHEIOS_UTIL_CORE_HPP_APIDEFS */
00353 
00354 /* ///////////////////////////// end of file //////////////////////////// */

pantheios Library documentation © Matthew Wilson & Synesis Software, 2006-2011 SourceForge.net Logo