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

pantheios/backend.h

Go to the documentation of this file.
00001 /* /////////////////////////////////////////////////////////////////////////
00002  * File:        pantheios/backend.h
00003  *
00004  * Purpose:     Pantheios back end API
00005  *
00006  * Created:     21st June 2005
00007  * Updated:     26th November 2010
00008  *
00009  * Home:        http://www.pantheios.org/
00010  *
00011  * Copyright (c) 2005-2010, Matthew Wilson and Synesis Software
00012  * Copyright (c) 1999-2005, Synesis Software and Matthew Wilson
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 
00048 #ifndef PANTHEIOS_INCL_PANTHEIOS_H_BACKEND
00049 #define PANTHEIOS_INCL_PANTHEIOS_H_BACKEND
00050 
00051 /* /////////////////////////////////////////////////////////////////////////
00052  * Version information
00053  */
00054 
00055 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00056 # define PANTHEIOS_VER_PANTHEIOS_H_BACKEND_MAJOR      3
00057 # define PANTHEIOS_VER_PANTHEIOS_H_BACKEND_MINOR      11
00058 # define PANTHEIOS_VER_PANTHEIOS_H_BACKEND_REVISION   1
00059 # define PANTHEIOS_VER_PANTHEIOS_H_BACKEND_EDIT       31
00060 #endif /* !PANTHEIOS_DOCUMENTATION_SKIP_SECTION */
00061 
00062 /* /////////////////////////////////////////////////////////////////////////
00063  * Includes
00064  */
00065 
00066 #ifndef PANTHEIOS_INCL_PANTHEIOS_H_PANTHEIOS
00067 # include <pantheios/pantheios.h>
00068 #endif /* !PANTHEIOS_INCL_PANTHEIOS_H_PANTHEIOS */
00069 
00070 /* /////////////////////////////////////////////////////////////////////////
00071  * Back-end API
00072  */
00073 
00117 #define PANTHEIOS_BEID_ALL                      (0)
00118 
00126 #define PANTHEIOS_BEID_LOCAL                    (1)
00127 
00136 #define PANTHEIOS_BEID_REMOTE                   (2)
00137 
00138 /* /////////////////////////////////////////////////////////////////////////
00139  * Constants
00140  */
00141 
00218 #define PANTHEIOS_BE_INIT_F_NO_PROCESS_ID       (0x00000001)
00219 #define PANTHEIOS_BE_INIT_F_NO_THREAD_ID        (0x00001000)
00220 #define PANTHEIOS_BE_INIT_F_NO_DATETIME         (0x00000002)
00221 #define PANTHEIOS_BE_INIT_F_NO_SEVERITY         (0x00000004)
00222 #define PANTHEIOS_BE_INIT_F_USE_SYSTEM_TIME     (0x00000008)
00223 #define PANTHEIOS_BE_INIT_F_DETAILS_AT_START    (0x00000010)
00224 #define PANTHEIOS_BE_INIT_F_USE_UNIX_FORMAT     (0x00000020)
00225 #define PANTHEIOS_BE_INIT_F_HIDE_DATE           (0x00000040)
00226 #define PANTHEIOS_BE_INIT_F_HIDE_TIME           (0x00000080)
00227 #define PANTHEIOS_BE_INIT_F_HIGH_RESOLUTION     (0x00000100)
00228 #define PANTHEIOS_BE_INIT_F_LOW_RESOLUTION      (0x00000200)
00229 
00230 
00242 #define PANTHEIOS_BE_INIT_F_COMMON_MASK         (0x000fffff)
00243 #ifdef __cplusplus
00244 # define PANTHEIOS_BE_INIT_F_CUSTOM_MASK        (~static_cast<int>(PANTHEIOS_BE_INIT_F_COMMON_MASK))
00245 #else /* ? __cplusplus */
00246 # define PANTHEIOS_BE_INIT_F_CUSTOM_MASK        (~((int)PANTHEIOS_BE_INIT_F_COMMON_MASK))
00247 #endif /* __cplusplus */
00248 
00249 
00250 
00283 PANTHEIOS_CALL(int) pantheios_be_init(
00284     PAN_CHAR_T const*   processIdentity
00285 ,   void*               reserved
00286 ,   void**              ptoken
00287 );
00288 
00303 PANTHEIOS_CALL(void) pantheios_be_uninit(void* token);
00304 
00329 PANTHEIOS_CALL(int) pantheios_be_logEntry(
00330     void*               feToken
00331 ,   void*               beToken
00332 ,   int                 severity
00333 ,   PAN_CHAR_T const*   entry
00334 ,   size_t              cchEntry
00335 );
00336 
00339 /* /////////////////////////////////////////////////////////////////////////
00340  * Generation Macros
00341  */
00342 
00361 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00362 # define PANTHEIOS_BE_DEFINE_BE_FUNCTIONS_(fullId)                                                                               \
00363                                                                                                                                 \
00364     PANTHEIOS_CALL(int) pantheios_be_init(PAN_CHAR_T const* processIdentity, void* reserved, void** ptoken)                           \
00365     { return fullId##_init(processIdentity, PANTHEIOS_BEID_LOCAL, NULL, reserved, ptoken); }                                    \
00366     PANTHEIOS_CALL(void) pantheios_be_uninit(void* token)                                                                       \
00367     { fullId##_uninit(token); }                                                                                                 \
00368     PANTHEIOS_CALL(int) pantheios_be_logEntry(void* feToken, void* beToken, int severity, PAN_CHAR_T const* entry, size_t cchEntry)   \
00369     { STLSOFT_SUPPRESS_UNUSED(feToken); return fullId##_logEntry(feToken, beToken, severity, entry, cchEntry); }
00370 #endif /* !PANTHEIOS_DOCUMENTATION_SKIP_SECTION */
00371 
00372 #define PANTHEIOS_BE_DEFINE_BE_FUNCTIONS(id)    PANTHEIOS_BE_DEFINE_BE_FUNCTIONS_(pantheios_be_##id)
00373 
00374 
00375 
00376 
00395 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00396 # define PANTHEIOS_BE_DEFINE_BEL_FUNCTIONS_(fullId)                                                                                  \
00397                                                                                                                                     \
00398     PANTHEIOS_CALL(int) pantheios_be_local_init(PAN_CHAR_T const* processIdentity, void* reserved, void** ptoken)                         \
00399     { return fullId##_init(processIdentity, PANTHEIOS_BEID_LOCAL, NULL, reserved, ptoken); }                                        \
00400     PANTHEIOS_CALL(void) pantheios_be_local_uninit(void* token)                                                                     \
00401     { fullId##_uninit(token); }                                                                                                     \
00402     PANTHEIOS_CALL(int) pantheios_be_local_logEntry(void* feToken, void* beToken, int severity, PAN_CHAR_T const* entry, size_t cchEntry) \
00403     { STLSOFT_SUPPRESS_UNUSED(feToken); return fullId##_logEntry(feToken, beToken, severity, entry, cchEntry); }
00404 #endif /* !PANTHEIOS_DOCUMENTATION_SKIP_SECTION */
00405 
00406 #define PANTHEIOS_BE_DEFINE_BEL_FUNCTIONS(id)   PANTHEIOS_BE_DEFINE_BEL_FUNCTIONS_(pantheios_be_##id)
00407 
00426 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00427 # define PANTHEIOS_BE_DEFINE_BER_FUNCTIONS_(fullId)                                                                                      \
00428                                                                                                                                         \
00429     PANTHEIOS_CALL(int) pantheios_be_remote_init(PAN_CHAR_T const* processIdentity, void* reserved, void** ptoken)                            \
00430     { return fullId##_init(processIdentity, PANTHEIOS_BEID_REMOTE, NULL, reserved, ptoken); }                                           \
00431     PANTHEIOS_CALL(void) pantheios_be_remote_uninit(void* token)                                                                        \
00432     { fullId##_uninit(token); }                                                                                                         \
00433     PANTHEIOS_CALL(int) pantheios_be_remote_logEntry(void* feToken, void* beToken, int severity, PAN_CHAR_T const* entry, size_t cchEntry)    \
00434     { STLSOFT_SUPPRESS_UNUSED(feToken); return fullId##_logEntry(feToken, beToken, severity, entry, cchEntry); }
00435 #endif /* !PANTHEIOS_DOCUMENTATION_SKIP_SECTION */
00436 
00437 #define PANTHEIOS_BE_DEFINE_BER_FUNCTIONS(id)   PANTHEIOS_BE_DEFINE_BER_FUNCTIONS_(pantheios_be_##id)
00438 
00439 /* ////////////////////////////////////////////////////////////////////// */
00440 
00441 #endif /* !PANTHEIOS_INCL_PANTHEIOS_H_BACKEND */
00442 
00443 /* ///////////////////////////// end of file //////////////////////////// */

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