#ifndef _aplmt_stdio_stdoutapi_h_ #define _aplmt_stdio_stdoutapi_h_ /*---------------------------------------------------------------------------- ** SUMMARY: Standard Stream Output Interface (STDOUT) ** ** DESCRIPTION: ** This file provides the interface for outputing formatted data to the ** the target's standard-output-device as well as to arbitrary file ** descriptors. ** ** NOTE: The file descriptor module/code is not required. It is only ** required (i.e. need to be compiled & linked) when the application ** make calls to Aplmt_fprintf(). Though a stubbed-out and/or empty ** 'platform/fdapi.h' is required. ** ** ** CONFIGURATION ** ------------- ** ** COMPILE: USE_APLMT_INIT_STDOUT_IN_SYSTEM_INIT. ** ** APPLICATION: OPTION_APLMT_RECOMMENDED_MIN_PRINTF_BUFFER ** ** PLATFORM: See platform documentation. ** ** ** NOTES: ** 1. Unless explicitly stated otherwise, NONE of the following methods may be ** called from interrupt service routines. ** 2. Unless explicitly stated otherwise, NONE of the following methods may be ** called before the platform's kernel is running. ** 3. Unless explicitly stated otherwise, all of the following methods ARE ** thread-safe. ** 4. For efficency/optimization some methods are 'inlined'. The inlining ** is done by using the preprocessor/macros. The application should ** treat all methods as function calls and not rely on the fact they may ** be currently defined as macros. ----------------------------------------------------------------------------*/ #include "aplcfg.h" /* For: Application configuration */ #include "aplmt/fd/fdapi.h" /* For: FD type */ #ifdef __cplusplus extern "C" { #endif /*-------------- CONSTANTS -------------------------------------------------*/ /** This constant is the recommended size of the internal formating buffer to be used. This is only a recommendation, because there are no required and/or guarantied implemenation semantics imposed on each platform's implementation. */ #ifndef OPTION_APLMT_RECOMMENDED_MIN_PRINTF_BUFFER #define OPTION_APLMT_RECOMMENDED_MIN_PRINTF_BUFFER 256 #endif /*-------------- INLINE IMPLEMENTATION -------------------------------------*/ #include "platform/stdoutapi.h" /* For: inline implementation */ /*-------------- PUBLIC/PUBLISHED API --------------------------------------*/ /** This method initialize the standard output device. Since the definition of standard-output-devices varies by target, this method must be implemented by the application and/or target platform code. NOTES: o If USE_APLMT_INIT_STDOUT_IN_SYSTEM_INIT is defined, then APL will internally call this method as part of the Aplmt_systemInit() */ #define Aplmt_stdoutInit _Aplmt_stdoutInit /*-------------- PUBLIC/PUBLISHED API --------------------------------------*/ /** This method outputs the formated data to the standard output device. The formatting syntax is the C library 'printf' formating. NOTES: o This method is *NOT* thread safe. If this method is going to be called from multiple threads, it is up to the application to practice safe printf'ing. Prototype: void Aplmt_printf( const char* format, .... ); */ #define Aplmt_printf _Aplmt_printf /** This method is the same as Aplmt_printf(), except that it outputs the data to the specified file descriptor. o This method is *NOT* thread safe. If this method is going to be called from multiple threads, it is up to the application to practice safe fprintf'ing. Prototype: void Aplmt_fprintf( AplmtFD dest, const char* format, .... ); */ #define Aplmt_fprintf _Aplmt_fprintf #ifdef __cplusplus } #endif /*--------------------------------------------------------------------------*/ #endif /* end _aplmt_stdio_stdoutapi_h_ */