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

pantheios/backends/bec.syslog.h

Go to the documentation of this file.
00001 /* /////////////////////////////////////////////////////////////////////////
00002  * File:        pantheios/backends/bec.syslog.h
00003  *
00004  * Purpose:     Declaration of the Pantheios syslog Stock Back-end API.
00005  *
00006  * Created:     23rd July 2005
00007  * Updated:     30th April 2010
00008  *
00009  * Home:        http://www.pantheios.org/
00010  *
00011  * Copyright (c) 2005-2010, Matthew Wilson and Synesis Software
00012  * All rights reserved.
00013  *
00014  * Redistribution and use in source and binary forms, with or without
00015  * modification, are permitted provided that the following conditions are
00016  * met:
00017  *
00018  * - Redistributions of source code must retain the above copyright notice,
00019  *   this list of conditions and the following disclaimer.
00020  * - Redistributions in binary form must reproduce the above copyright
00021  *   notice, this list of conditions and the following disclaimer in the
00022  *   documentation and/or other materials provided with the distribution.
00023  * - Neither the name(s) of Matthew Wilson and Synesis Software nor the
00024  *   names of any contributors may be used to endorse or promote products
00025  *   derived from this software without specific prior written permission.
00026  *
00027  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
00028  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
00029  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00030  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
00031  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00032  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00033  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00034  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00035  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00036  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00037  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00038  *
00039  * ////////////////////////////////////////////////////////////////////// */
00040 
00041 
00047 #ifndef PANTHEIOS_INCL_PANTHEIOS_BACKENDS_H_SYSLOG_SRC
00048 #define PANTHEIOS_INCL_PANTHEIOS_BACKENDS_H_SYSLOG_SRC
00049 
00050 /* /////////////////////////////////////////////////////////////////////////
00051  * Version information
00052  */
00053 
00054 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00055 # define PANTHEIOS_VER_PANTHEIOS_BACKENDS_H_BEC_SYSLOG_MAJOR    3
00056 # define PANTHEIOS_VER_PANTHEIOS_BACKENDS_H_BEC_SYSLOG_MINOR    1
00057 # define PANTHEIOS_VER_PANTHEIOS_BACKENDS_H_BEC_SYSLOG_REVISION 1
00058 # define PANTHEIOS_VER_PANTHEIOS_BACKENDS_H_BEC_SYSLOG_EDIT     22
00059 #endif /* !PANTHEIOS_DOCUMENTATION_SKIP_SECTION */
00060 
00061 /* /////////////////////////////////////////////////////////////////////////
00062  * Includes
00063  */
00064 
00065 #ifndef PANTHEIOS_INCL_PANTHEIOS_H_PANTHEIOS
00066 # include <pantheios/pantheios.h>
00067 #endif /* !PANTHEIOS_INCL_PANTHEIOS_H_PANTHEIOS */
00068 #ifndef PANTHEIOS_INCL_PANTHEIOS_H_BACKEND
00069 # include <pantheios/backend.h>
00070 #endif /* !PANTHEIOS_INCL_PANTHEIOS_H_BACKEND */
00071 
00072 /* /////////////////////////////////////////////////////////////////////////
00073  * Documentation
00074  */
00075 
00081 /* /////////////////////////////////////////////////////////////////////////
00082  * Typedefs
00083  */
00084 
00108 #define PANTHEIOS_BE_SYSLOG_F_PERROR    (0x00100000)
00109 
00120 #define PANTHEIOS_BE_SYSLOG_F_CONS      (0x00200000)
00121 
00131 #define PANTHEIOS_BE_SYSLOG_F_PID       (0x00400000)
00132 
00143 #define PANTHEIOS_BE_SYSLOG_F_NDELAY    (0x00800000)
00144 
00145 
00146 
00151 struct pan_be_syslog_init_t
00152 {
00153 #if !defined(PANTHEIOS_DOCUMENTATION_SKIP_SECTION) && \
00154     !defined(PANTHEIOS_NO_NAMESPACE)
00155     typedef pantheios::pan_uint8_t  pan_uint8_t;
00156     typedef pantheios::pan_uint16_t pan_uint16_t;
00157     typedef pantheios::pan_uint32_t pan_uint32_t;
00158 #endif /* !PANTHEIOS_DOCUMENTATION_SKIP_SECTION && !PANTHEIOS_NO_NAMESPACE */
00159 
00160     pan_uint32_t    version;    
00161     pan_uint32_t    flags;      
00162     pan_uint32_t    options;    
00163     pan_uint8_t     facility;   
00165 #ifdef __cplusplus
00166 public: /* Construction */
00167 # ifndef PANTHEIOS_BE_INIT_NO_CPP_STRUCT_INIT
00168     pan_be_syslog_init_t();
00169 # endif /* !PANTHEIOS_BE_INIT_NO_CPP_STRUCT_INIT */
00170 #endif /* __cplusplus */
00171 };
00172 #if !defined(__cplusplus)
00173 typedef struct pan_be_syslog_init_t     pan_be_syslog_init_t;
00174 #endif /* !__cplusplus */
00175 
00176 
00177 /* /////////////////////////////////////////////////////////////////////////
00178  * Application-defined functions
00179  */
00180 
00190 PANTHEIOS_CALL(void) pantheios_be_syslog_getAppInit(
00191     int                     backEndId
00192 ,   pan_be_syslog_init_t*   init
00193 ) /* throw() */;
00194 
00195 /* /////////////////////////////////////////////////////////////////////////
00196  * API
00197  */
00198 
00211 PANTHEIOS_CALL(void) pantheios_be_syslog_getDefaultAppInit(
00212     pan_be_syslog_init_t* init
00213 ) /* throw() */;
00214 
00218 PANTHEIOS_CALL(int) pantheios_be_syslog_init(
00219     PAN_CHAR_T const*           processIdentity
00220 ,   int                         id
00221 ,   pan_be_syslog_init_t const* init
00222 ,   void*                       reserved
00223 ,   void**                      ptoken
00224 );
00225 
00229 PANTHEIOS_CALL(void) pantheios_be_syslog_uninit(
00230     void* token
00231 );
00232 
00236 PANTHEIOS_CALL(int) pantheios_be_syslog_logEntry(
00237     void*               feToken
00238 ,   void*               beToken
00239 ,   int                 severity
00240 ,   PAN_CHAR_T const*   entry
00241 ,   size_t              cchEntry
00242 );
00243 
00271 PANTHEIOS_CALL(int) pantheios_be_syslog_parseArgs(
00272     size_t                          numArgs
00273 #ifdef PANTHEIOS_NO_NAMESPACE
00274 ,   struct pan_slice_t* const       args
00275 #else /* ? PANTHEIOS_NO_NAMESPACE */
00276 ,   pantheios::pan_slice_t* const   args
00277 #endif /* PANTHEIOS_NO_NAMESPACE */
00278 ,   pan_be_syslog_init_t*           init
00279 );
00280 
00281 
00282 /* ////////////////////////////////////////////////////////////////////// */
00283 
00284 #ifdef __cplusplus
00285 # ifndef PANTHEIOS_BE_INIT_NO_CPP_STRUCT_INIT
00286 inline pan_be_syslog_init_t::pan_be_syslog_init_t()
00287 {
00288     pantheios_be_syslog_getDefaultAppInit(this);
00289 }
00290 # endif /* !PANTHEIOS_BE_INIT_NO_CPP_STRUCT_INIT */
00291 #endif /* __cplusplus */
00292 
00293 /* ////////////////////////////////////////////////////////////////////// */
00294 
00295 #endif /* PANTHEIOS_INCL_PANTHEIOS_BACKENDS_H_SYSLOG_SRC */
00296 
00297 /* ///////////////////////////// end of file //////////////////////////// */

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