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

pantheios/backends/bec.console.h

Go to the documentation of this file.
00001 /* /////////////////////////////////////////////////////////////////////////
00002  * File:        pantheios/backends/bec.console.h
00003  *
00004  * Purpose:     Platform-specific console back-end
00005  *
00006  * Created:     3rd July 2009
00007  * Updated:     26th November 2010
00008  *
00009  * Home:        http://www.pantheios.org/
00010  *
00011  * Copyright (c) 2009-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_BEC_CONSOLE
00048 #define PANTHEIOS_INCL_PANTHEIOS_BACKENDS_H_BEC_CONSOLE
00049 
00050 /* /////////////////////////////////////////////////////////////////////////
00051  * Version information
00052  */
00053 
00054 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00055 # define PANTHEIOS_VER_PANTHEIOS_BACKENDS_H_BEC_CONSOLE_MAJOR       1
00056 # define PANTHEIOS_VER_PANTHEIOS_BACKENDS_H_BEC_CONSOLE_MINOR       0
00057 # define PANTHEIOS_VER_PANTHEIOS_BACKENDS_H_BEC_CONSOLE_REVISION    1
00058 # define PANTHEIOS_VER_PANTHEIOS_BACKENDS_H_BEC_CONSOLE_EDIT        2
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 #ifndef PLATFORMSTL_INCL_PLATFORMSTL_H_PLATFORMSTL
00073 # include <platformstl/platformstl.h>
00074 #endif /* !PLATFORMSTL_INCL_PLATFORMSTL_H_PLATFORMSTL */
00075 
00076 #if defined(PLATFORMSTL_OS_IS_WINDOWS)
00077 # ifndef PANTHEIOS_INCL_PANTHEIOS_BACKENDS_H_BEC_WINDOWSCONSOLE
00078 #  include <pantheios/backends/bec.WindowsConsole.h>
00079 # endif /* !PANTHEIOS_INCL_PANTHEIOS_BACKENDS_H_BEC_WINDOWSCONSOLE */
00080 #else /* ? OS */
00081 # ifndef PANTHEIOS_INCL_PANTHEIOS_BACKENDS_H_BEC_FPRINTF
00082 #  include <pantheios/backends/bec.fprintf.h>
00083 # endif /* !PANTHEIOS_INCL_PANTHEIOS_BACKENDS_H_BEC_FPRINTF */
00084 #endif /* OS */
00085 
00086 /* /////////////////////////////////////////////////////////////////////////
00087  * Documentation
00088  */
00089 
00102 /* /////////////////////////////////////////////////////////////////////////
00103  * Constants
00104  */
00105 
00117 #if defined(PLATFORMSTL_OS_IS_WINDOWS)
00118 # define PANTHEIOS_BE_CONSOLE_F_NO_COLOURS          PANTHEIOS_BE_WINDOWSCONSOLE_F_NO_COLOURS
00119 #else /* ? OS */
00120 # define PANTHEIOS_BE_CONSOLE_F_NO_COLOURS          (0)
00121 #endif /* OS */
00122 
00123 /* /////////////////////////////////////////////////////////////////////////
00124  * Typedefs
00125  */
00126 
00132 #if defined(PLATFORMSTL_OS_IS_WINDOWS)
00133 typedef pan_be_WindowsConsole_init_t        pan_be_console_init_t;
00134 #else /* ? OS */
00135 typedef pan_be_fprintf_init_t               pan_be_console_init_t;
00136 #endif /* OS */
00137 
00138 /* /////////////////////////////////////////////////////////////////////////
00139  * Application-defined functions
00140  */
00141 
00142 #if defined(PANTHEIOS_DOCUMENTATION_SKIP_SECTION)
00143 
00183 PANTHEIOS_CALL(void) pantheios_be_console_getAppInit(
00184     int                     backEndId
00185 ,   pan_be_console_init_t*  init
00186 ) /* throw() */;
00187 
00188 #else /* ? PANTHEIOS_DOCUMENTATION_SKIP_SECTION */
00189 # if defined(PLATFORMSTL_OS_IS_WINDOWS)
00190 #  define pantheios_be_console_getAppInit(backEndId, init)  pantheios_be_WindowsConsole_getAppInit(backEndId, init)
00191 # else /* ? OS */
00192 #  define pantheios_be_console_getAppInit(backEndId, init)  pantheios_be_fprintf_getAppInit(backEndId, init)
00193 # endif /* OS */
00194 #endif /* PANTHEIOS_DOCUMENTATION_SKIP_SECTION */
00195 
00196 /* /////////////////////////////////////////////////////////////////////////
00197  * API functions
00198  */
00199 
00213 #if defined(PLATFORMSTL_OS_IS_WINDOWS)
00214 # define pantheios_be_console_getDefaultAppInit(init)   pantheios_be_WindowsConsole_getAppInit(init)
00215 #else /* ? OS */
00216 # define pantheios_be_console_getDefaultAppInit(init)   pantheios_be_fprintf_getAppInit(init)
00217 #endif /* OS */
00218 
00219 
00226 #if defined(PLATFORMSTL_OS_IS_WINDOWS)
00227 # define pantheios_be_console_init      pantheios_be_WindowsConsole_init
00228 #else /* ? OS */
00229 # define pantheios_be_console_init      pantheios_be_fprintf_init
00230 #endif /* OS */
00231 
00232 
00239 #if defined(PLATFORMSTL_OS_IS_WINDOWS)
00240 # define pantheios_be_console_uninit    pantheios_be_WindowsConsole_uninit
00241 #else /* ? OS */
00242 # define pantheios_be_console_uninit    pantheios_be_fprintf_uninit
00243 #endif /* OS */
00244 
00245 
00252 #if defined(PLATFORMSTL_OS_IS_WINDOWS)
00253 # define pantheios_be_console_logEntry  pantheios_be_WindowsConsole_logEntry
00254 #else /* ? OS */
00255 # define pantheios_be_console_logEntry  pantheios_be_fprintf_logEntry
00256 #endif /* OS */
00257 
00258 
00287 #if defined(PLATFORMSTL_OS_IS_WINDOWS)
00288 # define pantheios_be_console_parseArgs(numArgs, args, init)        pantheios_be_WindowsConsole_parseArgs(numArgs, args, init)
00289 #else /* ? OS */
00290 # define pantheios_be_console_parseArgs(numArgs, args, init)        pantheios_be_fprintf_parseArgs(numArgs, args, init)
00291 #endif /* OS */
00292 
00293 /* ////////////////////////////////////////////////////////////////////// */
00294 
00295 #endif /* PANTHEIOS_INCL_PANTHEIOS_BACKENDS_H_BEC_CONSOLE */
00296 
00297 /* ///////////////////////////// end of file //////////////////////////// */

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