00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00049 #ifndef PANTHEIOS_INCL_PANTHEIOS_H_PANTHEIOS
00050 #define PANTHEIOS_INCL_PANTHEIOS_H_PANTHEIOS
00051
00052
00053
00054
00055
00056 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00057 # define PANTHEIOS_VER_PANTHEIOS_H_PANTHEIOS_MAJOR 3
00058 # define PANTHEIOS_VER_PANTHEIOS_H_PANTHEIOS_MINOR 43
00059 # define PANTHEIOS_VER_PANTHEIOS_H_PANTHEIOS_REVISION 6
00060 # define PANTHEIOS_VER_PANTHEIOS_H_PANTHEIOS_EDIT 333
00061 #endif
00062
00079 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00080 # define PANTHEIOS_VER_1_0_1_B2 0x01000102
00081 # define PANTHEIOS_VER_1_0_1_B193 0x010001c1
00082 # define PANTHEIOS_VER_1_0_1_B194 0x010001c2
00083 # define PANTHEIOS_VER_1_0_1_B195 0x010001c3
00084 # define PANTHEIOS_VER_1_0_1_B196 0x010001c4
00085 # define PANTHEIOS_VER_1_0_1_B197 0x010001c5
00086 # define PANTHEIOS_VER_1_0_1_B198 0x010001c6
00087 # define PANTHEIOS_VER_1_0_1_B199 0x010001c7
00088 # define PANTHEIOS_VER_1_0_1_B200 0x010001c8
00089 # define PANTHEIOS_VER_1_0_1_B201 0x010001c9
00090 # define PANTHEIOS_VER_1_0_1_B202 0x010001ca
00091 # define PANTHEIOS_VER_1_0_1_B203 0x010001cb
00092 # define PANTHEIOS_VER_1_0_1_B204 0x010001cc
00093 # define PANTHEIOS_VER_1_0_1_B205 0x010001cd
00094 # define PANTHEIOS_VER_1_0_1_B206 0x010001ce
00095 # define PANTHEIOS_VER_1_0_1_B207 0x010001cf
00096 # define PANTHEIOS_VER_1_0_1_B208 0x010001d0
00097 # define PANTHEIOS_VER_1_0_1 0x010001ff
00098 #endif
00099
00100 #define PANTHEIOS_VER_MAJOR 1
00101 #define PANTHEIOS_VER_MINOR 0
00102 #define PANTHEIOS_VER_REVISION 1
00103
00104 #define PANTHEIOS_VER PANTHEIOS_VER_1_0_1_B208
00105
00106
00107
00108
00109
00110
00111
00112
00113 #ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT
00114 # include <stlsoft/stlsoft.h>
00115 #endif
00116
00117 #if !defined(_STLSOFT_VER) || \
00118 _STLSOFT_VER < 0x010969ff
00119 # error This version Pantheios requires STLSoft 1.9.105, or later. (www.stlsoft.org)
00120 #endif
00121
00122 #ifndef PANTHEIOS_INCL_H_STDARG
00123 # define PANTHEIOS_INCL_H_STDARG
00124 # include <stdarg.h>
00125 #endif
00126 #ifndef PANTHEIOS_INCL_H_STDDEF
00127 # define PANTHEIOS_INCL_H_STDDEF
00128 # include <stddef.h>
00129 #endif
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148 #ifndef PANTHEIOS_USE_WIDE_STRINGS
00149 # if defined(_WIN32) && \
00150 defined(UNICODE) && \
00151 defined(_UNICODE)
00152 # define PANTHEIOS_USE_WIDE_STRINGS
00153 # endif
00154 #endif
00155
00156 #ifdef PANTHEIOS_NO_USE_WIDE_STRINGS
00157 # ifdef PANTHEIOS_USE_WIDE_STRINGS
00158 # undef PANTHEIOS_USE_WIDE_STRINGS
00159 # endif
00160 #endif
00161
00162
00163
00164
00165
00166 #ifdef PANTHEIOS_USE_WIDE_STRINGS
00167 # ifndef _WCHAR_T_DEFINED
00168 # include <wchar.h>
00169 # endif
00170 #endif
00171
00172 #include <pantheios/internal/string_encoding.h>
00173
00174
00175
00176
00177
00187 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00188 # define PANTHEIOS_STRINGIZE_(x) #x
00189 #endif
00190 #define PANTHEIOS_STRINGIZE(x) PANTHEIOS_STRINGIZE_(x)
00191
00204 #define PANTHEIOS_MAKE_EXTENDED_SEVERITY(sev, xi28) \
00205 \
00206 (((sev) & 0x0f) | (((xi28) << 4) & ~0x0f))
00207
00265 #if !defined(PANTHEIOS_DECLSPEC)
00266 # define PANTHEIOS_DECLSPEC
00267 #endif
00268
00269 #if defined(__cplusplus) || \
00270 defined(PANTHEIOS_DOCUMENTATION_SKIP_SECTION)
00271 # define PANTHEIOS_EXTERN_C extern "C"
00272 #else
00273 # define PANTHEIOS_EXTERN_C extern
00274 #endif
00275
00276 #if !defined(PANTHEIOS_CALLCONV)
00277 # define PANTHEIOS_CALLCONV
00278 #endif
00279
00280 #define PANTHEIOS_CALL(rt) PANTHEIOS_DECLSPEC PANTHEIOS_EXTERN_C rt PANTHEIOS_CALLCONV
00281
00282 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00283 # define PANTHEIOS_CPP_CALL(rt) PANTHEIOS_DECLSPEC extern "C++" rt PANTHEIOS_CALLCONV
00284 #endif
00285
00286 #if defined(STLSOFT_COMPILER_IS_MSVC) && \
00287 ( _MSC_VER >= 1500 || \
00288 ( _MSC_VER >= 1400 && \
00289 defined(_MSC_FULL_VER) && \
00290 _MSC_FULL_VER >= 140050320))
00291 #define PANTHEIOS_DECLARE_DEPRECATION(symtype, oldfn, newfn) __declspec(deprecated("The " symtype " " PANTHEIOS_STRINGIZE(oldfn) " is deprecated and will be removed from a future version of Pantheios; use " PANTHEIOS_STRINGIZE(newfn) " instead"))
00292 #define PANTHEIOS_CALL_DEPRECATED(rt, oldfn, newfn) PANTHEIOS_DECLARE_DEPRECATION("function", oldfn, newfn) PANTHEIOS_DECLSPEC PANTHEIOS_EXTERN_C rt PANTHEIOS_CALLCONV
00293 #else
00294 #define PANTHEIOS_DECLARE_DEPRECATION(symtype, oldfn, newfn)
00295 #define PANTHEIOS_CALL_DEPRECATED(rt, oldfn, newfn) PANTHEIOS_CALL(rt)
00296 #endif
00297
00298
00299
00300
00301
00302 #if defined(STLSOFT_CF_NAMESPACE_SUPPORT)
00303 # define PANTHEIOS_CF_NAMESPACE_SUPPORT
00304 #else
00305 # ifdef PANTHEIOS_CF_NAMESPACE_SUPPORT
00306 # undef PANTHEIOS_CF_NAMESPACE_SUPPORT
00307 # endif
00308 #endif
00309
00310 #if !defined(PANTHEIOS_CF_NAMESPACE_SUPPORT) && \
00311 !defined(PANTHEIOS_DOCUMENTATION_SKIP_SECTION) && \
00312 !defined(PANTHEIOS_NO_NAMESPACE)
00313 # define PANTHEIOS_NO_NAMESPACE
00314 #endif
00315
00316 #if !defined(PANTHEIOS_NO_NAMESPACE)
00317
00322 namespace pantheios
00323 {
00324
00329 namespace util
00330 {
00331 }
00332
00337 namespace core
00338 {
00339 }
00340
00341 # define PANTHEIOS_NS_QUAL(x) ::pantheios::x
00342 # define PANTHEIOS_SUBNS_QUAL(sns, x) ::pantheios::sns::x
00343
00344 #else
00345
00346 # define PANTHEIOS_NS_QUAL(x) x
00347 # define PANTHEIOS_SUBNS_QUAL(sns, x) x
00348
00349 #endif
00350
00363
00364
00365
00366
00367
00368
00370 typedef stlsoft_ns_qual(ss_uint8_t) pan_uint8_t;
00372 typedef stlsoft_ns_qual(ss_uint16_t) pan_uint16_t;
00374 typedef stlsoft_ns_qual(ss_uint32_t) pan_uint32_t;
00376 typedef stlsoft_ns_qual(ss_uint64_t) pan_uint64_t;
00377
00379 typedef stlsoft_ns_qual(ss_sint8_t) pan_sint8_t;
00381 typedef stlsoft_ns_qual(ss_sint16_t) pan_sint16_t;
00383 typedef stlsoft_ns_qual(ss_sint32_t) pan_sint32_t;
00385 typedef stlsoft_ns_qual(ss_sint64_t) pan_sint64_t;
00386
00387
00394 #ifdef PANTHEIOS_USE_WIDE_STRINGS
00395 typedef wchar_t pan_char_t;
00396 #else
00397 typedef char pan_char_t;
00398 #endif
00399
00407 #define PAN_CHAR_T PANTHEIOS_NS_QUAL(pan_char_t)
00408
00420 struct pan_slice_t
00421 {
00422 size_t len;
00423 pan_char_t const* ptr;
00425 #ifdef __cplusplus
00426
00427 pan_slice_t();
00429 pan_slice_t(pan_char_t const* p, size_t l);
00431 pan_slice_t(pan_slice_t const& rhs);
00433 pan_slice_t& operator =(pan_slice_t const& rhs);
00434
00435 # ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00436
00437 pan_slice_t(int len, pan_char_t const* p);
00438 # endif
00439
00440 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00441
00446 static size_t get_lazy_length(size_t fromLen, size_t toLen);
00447 #endif
00448
00449 private:
00450 static size_t calc_length_n_(pan_char_t const* s, size_t len);
00451
00452 #endif
00453 };
00454 #if !defined(__cplusplus)
00455 typedef struct pan_slice_t pan_slice_t;
00456 #endif
00457
00458
00459 #ifndef PANTHEIOS_NO_STOCK_LEVELS
00460
00475 enum pan_severity_t
00476 {
00477 SEV_EMERGENCY = 0
00478 , SEV_ALERT = 1
00479 , SEV_CRITICAL = 2
00480 , SEV_ERROR = 3
00481 , SEV_WARNING = 4
00482 , SEV_NOTICE = 5
00483 , SEV_INFORMATIONAL = 6
00484 , SEV_DEBUG = 7
00486 # if defined(PANTHEIOS_NO_NAMESPACE)
00487 , PANTHEIOS_SEV_EMERGENCY = SEV_EMERGENCY
00488 , PANTHEIOS_SEV_ALERT = SEV_ALERT
00489 , PANTHEIOS_SEV_CRITICAL = SEV_CRITICAL
00490 , PANTHEIOS_SEV_ERROR = SEV_ERROR
00491 , PANTHEIOS_SEV_WARNING = SEV_WARNING
00492 , PANTHEIOS_SEV_NOTICE = SEV_NOTICE
00493 , PANTHEIOS_SEV_INFORMATIONAL = SEV_INFORMATIONAL
00494 , PANTHEIOS_SEV_DEBUG = SEV_DEBUG
00495 # endif
00496
00497 };
00498 # if !defined(__cplusplus)
00499 typedef enum pan_severity_t pan_severity_t;
00500 # endif
00501 #endif
00502
00509 typedef stlsoft_ns_qual(ss_sint32_t) pan_sev_t;
00510
00511 #if defined(__cplusplus) && \
00512 !defined(PANTHEIOS_NO_STOCK_LEVELS) && \
00513 !defined(PANTHEIOS_DOCUMENTATION_SKIP_SECTION)
00514 # define PANTHEIOS_INCLUDING_STOCKLEVELS
00515 # include "./internal/stock_levels.hpp"
00516 # undef PANTHEIOS_INCLUDING_STOCKLEVELS
00517
00518 #endif
00519
00520
00521
00522
00523
00540 PANTHEIOS_CALL(pan_uint32_t) pantheios_getVersion(void);
00541
00563 PANTHEIOS_CALL(int) pantheios_init(void);
00564
00584 PANTHEIOS_CALL(void) pantheios_uninit(void);
00585
00602 PANTHEIOS_CALL(int) pantheios_isSeverityLogged(pan_sev_t severity);
00603
00614 PANTHEIOS_CALL(pan_char_t const*) pantheios_getStockSeverityString(pan_sev_t severity);
00615 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00616 PANTHEIOS_CALL_DEPRECATED(pan_char_t const*, pantheios_getSeverityString, pantheios_getStockSeverityString) pantheios_getSeverityString(pan_sev_t severity);
00617 #endif
00618
00628 PANTHEIOS_CALL(size_t) pantheios_getStockSeverityStringLength(pan_sev_t severity);
00629 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00630 PANTHEIOS_CALL_DEPRECATED(size_t, pantheios_getSeverityStringLength, pantheios_getStockSeverityStringLength) pantheios_getSeverityStringLength(pan_sev_t severity);
00631 #endif
00632
00642 PANTHEIOS_CALL(char const*) pantheios_getInitCodeString(int code);
00643 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00644 PANTHEIOS_CALL_DEPRECATED(char const*, pantheios_getInitErrorString, pantheios_getInitCodeString) pantheios_getInitErrorString(int code);
00645 #endif
00646
00654 PANTHEIOS_CALL(size_t) pantheios_getInitCodeStringLength(int code);
00655 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00656 PANTHEIOS_CALL_DEPRECATED(size_t, pantheios_getInitErrorStringLength, pantheios_getInitCodeStringLength) pantheios_getInitErrorStringLength(int code);
00657 #endif
00658
00659 #if !defined(PANTHEIOS_NO_NAMESPACE)
00660 namespace core
00661 {
00662 #endif
00663
00677 PANTHEIOS_CALL(int) pantheios_log_n(
00678 pan_sev_t severity
00679 , size_t numSlices
00680 #ifdef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00681 , pantheios::pan_slice_t const* slices
00682 #else
00683 , pan_slice_t const* slices
00684 #endif
00685 );
00686
00687 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00688 # define PANTHEIOS_INCLUDING_C_API_FUNCTIONS
00689 #endif
00690 #include "./internal/generated/log_functions.h"
00691 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00692 # undef PANTHEIOS_INCLUDING_C_API_FUNCTIONS
00693 #endif
00694
00695 #if !defined(PANTHEIOS_NO_NAMESPACE)
00696 }
00697 #endif
00698
00711 PANTHEIOS_CALL(int) pantheios_logprintf(
00712 pan_sev_t severity
00713 , pan_char_t const* format
00714 , ...
00715 )
00716 #if defined(STLSOFT_COMPILER_IS_GCC)
00717 __attribute__((format(printf,2,3)))
00718 #endif
00719 ;
00720
00737 PANTHEIOS_CALL(int) pantheios_logvprintf(
00738 pan_sev_t severity
00739 , pan_char_t const* format
00740 , va_list args
00741 );
00742
00743
00744
00745
00746
00747 #if !defined(PANTHEIOS_NO_NAMESPACE)
00748 namespace util
00749 {
00750 #endif
00751
00779 PANTHEIOS_CALL(void) pantheios_onBailOut4(
00780 int severity
00781 , char const* message
00782 , char const* processId
00783 , char const* qualifier
00784 );
00785
00813 PANTHEIOS_CALL(void) pantheios_onBailOut3(
00814 int severity
00815 , char const* message
00816 , char const* processId
00817 );
00818
00819 # ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00820
00821 PANTHEIOS_CALL(size_t) pantheios_util_strnlen(pan_char_t const* s, size_t len);
00822 PANTHEIOS_CALL_DEPRECATED(size_t, pantheios_strnlen, pantheios_util_strnlen) pantheios_strnlen(pan_char_t const* s, size_t len);
00823
00824 # endif
00825
00826 #if !defined(PANTHEIOS_NO_NAMESPACE)
00827 }
00828 #endif
00829
00830
00831
00832
00833
00834 #if !defined(PANTHEIOS_NO_NAMESPACE)
00835 namespace core
00836 {
00837 #endif
00838
00839 # ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00840 PANTHEIOS_CALL(int) pantheios_isInitialising(void);
00841 PANTHEIOS_CALL(int) pantheios_isInitialised(void);
00842 PANTHEIOS_CALL(void) pantheios_exitProcess(int code);
00843 PANTHEIOS_CALL_DEPRECATED(void, pantheios_exit_process, pantheios_exitProcess) pantheios_exit_process(int code);
00844
00845
00846
00847
00848
00849
00850
00851
00852 PANTHEIOS_CALL(void*) pantheios_malloc(size_t cb);
00853
00854
00855 PANTHEIOS_CALL(void*) pantheios_inserterAllocate(size_t cb);
00856 PANTHEIOS_CALL(void) pantheios_inserterDeallocate(void* pv);
00857
00858
00859
00860
00861
00862 PANTHEIOS_CALL(pan_char_t const*) pantheios_getPad(size_t minimumWidth, size_t* actualWidth);
00863 # endif
00864
00865 #if !defined(PANTHEIOS_NO_NAMESPACE)
00866 }
00867 #endif
00868
00869
00870
00871
00872
00873 #if !defined(PANTHEIOS_NO_NAMESPACE)
00874 namespace core
00875 {
00876 #endif
00877
00895 PANTHEIOS_CALL(int) pantheios_getNextBackEndId(void);
00896
00897 #if !defined(PANTHEIOS_NO_NAMESPACE)
00898 }
00899 #endif
00900
00914 PANTHEIOS_CALL(void) pantheios_logputs(
00915 pan_sev_t severity
00916 , pan_char_t const* message
00917 );
00918
00926 PANTHEIOS_CALL_DEPRECATED(void, pantheios_puts, pantheios_logputs) pantheios_puts(pan_sev_t severity, pan_char_t const* message);
00927
00928 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00929 PANTHEIOS_CALL(void) pantheios_logassertfail(
00930 pan_sev_t severity
00931 , char const* fileLine
00932 , char const* message
00933 );
00934 #endif
00935
00936
00937
00938
00939
00940 #if 0
00941
00958 PANTHEIOS_CALL(int) pantheios_backEndMap_lookup(int backEndId, void** ptoken);
00959
00972 PANTHEIOS_CALL(int) pantheios_backEndMap_add(int backEndId, void* token);
00973
00985 PANTHEIOS_CALL(int) pantheios_backEndMap_remove(int backEndId);
00986 #endif
00987
00988
00989
00990
00991
00992 #if defined(PANTHEIOS_DOCUMENTATION_SKIP_SECTION) || \
00993 !defined(PANTHEIOS_APPL_PARAMS_LIMIT)
00994
01000 # define PANTHEIOS_APPL_PARAMS_LIMIT PANTHEIOS_APPL_PARAMS_LIMIT_MAX_GENERATED
01001 #endif
01002
01003
01004 #if PANTHEIOS_APPL_PARAMS_LIMIT < 0 || \
01005 PANTHEIOS_APPL_PARAMS_LIMIT > PANTHEIOS_APPL_PARAMS_LIMIT_MAX_GENERATED
01006 # error PANTHEIOS_APPL_PARAMS_LIMIT Must be defined to be a number between 1 and PANTHEIOS_APPL_PARAMS_LIMIT_MAX_GENERATED
01007 #endif
01008
01009
01010
01011
01012
01013 #if !defined(PANTHEIOS_NO_NAMESPACE)
01014
01016 typedef pan_uint8_t uint8_t;
01018 typedef pan_uint16_t uint16_t;
01020 typedef pan_uint32_t uint32_t;
01022 typedef pan_uint64_t uint64_t;
01023
01025 typedef pan_sint8_t sint8_t;
01027 typedef pan_sint16_t sint16_t;
01029 typedef pan_sint32_t sint32_t;
01031 typedef pan_sint64_t sint64_t;
01032
01033
01034
01035
01036
01037 namespace util
01038 {
01039
01040 # ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
01041
01042 inline void onBailOut(int severity, char const* message, char const* processId)
01043 {
01044 pantheios_onBailOut3(severity, message, processId);
01045 }
01046
01047 inline void onBailOut(int severity, char const* message, char const* processId, char const* qualifier)
01048 {
01049 pantheios_onBailOut4(severity, message, processId, qualifier);
01050 }
01051
01052 inline size_t strnlen(pan_char_t const* s, size_t len)
01053 {
01054 return pantheios_util_strnlen(s, len);
01055 }
01056
01057 # endif
01058
01059 }
01060
01061
01062
01063
01064
01065 # ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
01066
01067 inline int init()
01068 {
01069 return pantheios_init();
01070 }
01071
01072 inline void uninit()
01073 {
01074 pantheios_uninit();
01075 }
01076
01077 # endif
01078
01079 namespace core
01080 {
01081
01082 # ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
01083
01084 inline int isInitialising()
01085 {
01086 return pantheios_isInitialising();
01087 }
01088
01089 inline int isInitialised()
01090 {
01091 return pantheios_isInitialised();
01092 }
01093
01094 inline void exitProcess(int code)
01095 {
01096 pantheios_exitProcess(code);
01097 }
01098
01099 inline PANTHEIOS_DECLARE_DEPRECATION("function", exit_process, exitProcess) void exit_process(int code)
01100 {
01101 exitProcess(code);
01102 }
01103
01104 inline void* malloc(size_t cb)
01105 {
01106 return pantheios_malloc(cb);
01107 }
01108
01109 # endif
01110
01111 }
01112
01117 inline int isSeverityLogged(pan_sev_t severity)
01118 {
01119 return pantheios_isSeverityLogged(severity);
01120 }
01121
01126 inline pan_char_t const* getStockSeverityString(pan_sev_t severity)
01127 {
01128 return pantheios_getStockSeverityString(severity);
01129 }
01130
01131 # ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
01132
01133 inline PANTHEIOS_DECLARE_DEPRECATION("function", getSeverityString, getStockSeverityString) pan_char_t const* getSeverityString(pan_sev_t severity)
01134 {
01135 return getStockSeverityString(severity);
01136 }
01137
01138 # endif
01139
01144 inline size_t getStockSeverityStringLength(pan_sev_t severity)
01145 {
01146 return pantheios_getStockSeverityStringLength(severity);
01147 }
01148
01149 # ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
01150
01151 inline PANTHEIOS_DECLARE_DEPRECATION("function", getSeverityStringLength, getStockSeverityStringLength) size_t getSeverityStringLength(pan_sev_t severity)
01152 {
01153 return getStockSeverityStringLength(severity);
01154 }
01155
01156 # endif
01157
01162 inline char const* getInitCodeString(int code)
01163 {
01164 return pantheios_getInitCodeString(code);
01165 }
01166
01167 # ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
01168
01169 inline PANTHEIOS_DECLARE_DEPRECATION("function", getInitErrorString, getInitCodeString) char const* getInitErrorString(int code)
01170 {
01171 return getInitCodeString(code);
01172 }
01173
01174 # endif
01175
01180 inline size_t getInitCodeStringLength(int code)
01181 {
01182 return pantheios_getInitCodeStringLength(code);
01183 }
01184
01185 # ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
01186
01187 inline PANTHEIOS_DECLARE_DEPRECATION("function", getInitErrorStringLength, getInitCodeStringLength) size_t getInitErrorStringLength(int code)
01188 {
01189 return getStockSeverityStringLength(code);
01190 }
01191
01192 # endif
01193
01194 namespace core
01195 {
01196
01202 inline int getNextBackEndId()
01203 {
01204 return pantheios_getNextBackEndId();
01205 }
01206
01207 }
01208
01213 inline void logputs(
01214 pan_sev_t severity
01215 , pan_char_t const* message
01216 )
01217 {
01218 pantheios_logputs(severity, message);
01219 }
01220
01228 inline PANTHEIOS_DECLARE_DEPRECATION("function", puts, logputs) void puts(pan_sev_t severity, pan_char_t const* message)
01229 {
01230 pantheios_logputs(severity, message);
01231 }
01232
01238 #if !defined(PANTHEIOS_DOCUMENTATION_SKIP_SECTION) && \
01239 defined(STLSOFT_COMPILER_IS_GCC)
01240 int logprintf(
01241 pan_sev_t severity
01242 , pan_char_t const* format
01243 , ...
01244 )
01245 __attribute__((format(printf,2,3)))
01246 ;
01247 #endif
01248
01249 inline int logprintf(
01250 pan_sev_t severity
01251 , pan_char_t const* format
01252 , ...
01253 )
01254 {
01255 va_list args;
01256 int ret;
01257
01258 va_start(args, format);
01259
01260 ret = pantheios_logvprintf(severity, format, args);
01261
01262 va_end(args);
01263
01264 return ret;
01265 }
01266
01267
01272 inline int logvprintf(
01273 pan_sev_t severity
01274 , pan_char_t const* format
01275 , va_list args
01276 )
01277 {
01278 return pantheios_logvprintf(severity, format, args);
01279 }
01280
01281 #endif
01282
01283
01284
01285
01286
01287 #ifdef __cplusplus
01288
01289 # if !defined(PANTHEIOS_NO_NAMESPACE)
01290 namespace shims
01291 {
01292 # endif
01293
01295 # ifdef PANTHEIOS_USE_WIDE_STRINGS
01296 inline wchar_t const* c_str_ptr_w(pan_slice_t const& s)
01297 {
01298 return (0 == s.len) ? L"" : s.ptr;
01299 }
01300 # else
01301 inline char const* c_str_ptr_a(pan_slice_t const& s)
01302 {
01303 return (0 == s.len) ? "" : s.ptr;
01304 }
01305 # endif
01306
01307 inline pan_char_t const* c_str_ptr(pan_slice_t const& s)
01308 {
01309 # ifdef PANTHEIOS_USE_WIDE_STRINGS
01310 return c_str_ptr_w(s);
01311 # else
01312 return c_str_ptr_a(s);
01313 # endif
01314 }
01315
01317 # ifdef PANTHEIOS_USE_WIDE_STRINGS
01318 inline wchar_t const* c_str_ptr_null_w(pan_slice_t const& s)
01319 {
01320 return (0 != s.len) ? s.ptr : NULL;
01321 }
01322 # else
01323 inline char const* c_str_ptr_null_a(pan_slice_t const& s)
01324 {
01325 return (0 != s.len) ? s.ptr : NULL;
01326 }
01327 # endif
01328
01329 inline pan_char_t const* c_str_ptr_null(pan_slice_t const& s)
01330 {
01331 # ifdef PANTHEIOS_USE_WIDE_STRINGS
01332 return c_str_ptr_null_w(s);
01333 # else
01334 return c_str_ptr_null_a(s);
01335 # endif
01336 }
01337
01339 # ifdef PANTHEIOS_USE_WIDE_STRINGS
01340 inline wchar_t const* c_str_data_w(pan_slice_t const& s)
01341 {
01342 return c_str_ptr(s);
01343 }
01344 # else
01345 inline char const* c_str_data_a(pan_slice_t const& s)
01346 {
01347 return c_str_ptr(s);
01348 }
01349 # endif
01350
01351 inline pan_char_t const* c_str_data(pan_slice_t const& s)
01352 {
01353 # ifdef PANTHEIOS_USE_WIDE_STRINGS
01354 return c_str_data_w(s);
01355 # else
01356 return c_str_data_a(s);
01357 # endif
01358 }
01359
01361 # ifdef PANTHEIOS_USE_WIDE_STRINGS
01362 inline size_t c_str_len_w(pan_slice_t const& s)
01363 {
01364 return s.len;
01365 }
01366 # else
01367 inline size_t c_str_len_a(pan_slice_t const& s)
01368 {
01369 return s.len;
01370 }
01371 # endif
01372
01373 inline size_t c_str_len(pan_slice_t const& s)
01374 {
01375 # ifdef PANTHEIOS_USE_WIDE_STRINGS
01376 return c_str_len_w(s);
01377 # else
01378 return c_str_len_a(s);
01379 # endif
01380 }
01381
01382
01383
01385 # ifdef PANTHEIOS_USE_WIDE_STRINGS
01386 inline wchar_t const* c_str_ptr_w(pan_slice_t const* s)
01387 {
01388 return (NULL != s) ? c_str_ptr_w(*s) : L"";
01389 }
01390 # else
01391 inline char const* c_str_ptr_a(pan_slice_t const* s)
01392 {
01393 return (NULL != s) ? c_str_ptr_a(*s) : "";
01394 }
01395 # endif
01396
01397 inline pan_char_t const* c_str_ptr(pan_slice_t const* s)
01398 {
01399 # ifdef PANTHEIOS_USE_WIDE_STRINGS
01400 return c_str_ptr_w(s);
01401 # else
01402 return c_str_ptr_a(s);
01403 # endif
01404 }
01405
01407 # ifdef PANTHEIOS_USE_WIDE_STRINGS
01408 inline wchar_t const* c_str_ptr_null_w(pan_slice_t const* s)
01409 {
01410 return (NULL != s && (0 != s->len)) ? s->ptr : NULL;
01411 }
01412 # else
01413 inline char const* c_str_ptr_null_a(pan_slice_t const* s)
01414 {
01415 return (NULL != s && (0 != s->len)) ? s->ptr : NULL;
01416 }
01417 # endif
01418
01419 inline pan_char_t const* c_str_ptr_null(pan_slice_t const* s)
01420 {
01421 # ifdef PANTHEIOS_USE_WIDE_STRINGS
01422 return c_str_ptr_null_w(s);
01423 # else
01424 return c_str_ptr_null_a(s);
01425 # endif
01426 }
01427
01429 # ifdef PANTHEIOS_USE_WIDE_STRINGS
01430 inline wchar_t const* c_str_data_w(pan_slice_t const* s)
01431 {
01432 return c_str_ptr(s);
01433 }
01434 # else
01435 inline char const* c_str_data_a(pan_slice_t const* s)
01436 {
01437 return c_str_ptr(s);
01438 }
01439 # endif
01440
01441 inline pan_char_t const* c_str_data(pan_slice_t const* s)
01442 {
01443 # ifdef PANTHEIOS_USE_WIDE_STRINGS
01444 return c_str_data_w(s);
01445 # else
01446 return c_str_data_a(s);
01447 # endif
01448 }
01449
01451 # ifdef PANTHEIOS_USE_WIDE_STRINGS
01452 inline size_t c_str_len_w(pan_slice_t const* s)
01453 {
01454 return (NULL != s) ? s->len : 0;
01455 }
01456 # else
01457 inline size_t c_str_len_a(pan_slice_t const* s)
01458 {
01459 return (NULL != s) ? s->len : 0;
01460 }
01461 # endif
01462
01463 inline size_t c_str_len(pan_slice_t const* s)
01464 {
01465 # ifdef PANTHEIOS_USE_WIDE_STRINGS
01466 return c_str_len_w(s);
01467 # else
01468 return c_str_len_a(s);
01469 # endif
01470 }
01471
01472
01473
01474 # ifndef PANTHEIOS_NO_STOCK_LEVELS
01475
01476 # ifdef PANTHEIOS_USE_WIDE_STRINGS
01477 inline wchar_t const* c_str_data_w(pan_severity_t severity)
01478 {
01479 return pantheios_getStockSeverityString(severity);
01480 }
01481 # else
01482 inline char const* c_str_data_a(pan_severity_t severity)
01483 {
01484 return pantheios_getStockSeverityString(severity);
01485 }
01486 # endif
01487
01488 inline pan_char_t const* c_str_data(pan_severity_t severity)
01489 {
01490 return pantheios_getStockSeverityString(severity);
01491 }
01492
01494 # ifdef PANTHEIOS_USE_WIDE_STRINGS
01495 inline size_t c_str_len_w(pan_severity_t severity)
01496 {
01497 return pantheios_getStockSeverityStringLength(severity);
01498 }
01499 # else
01500 inline size_t c_str_len_a(pan_severity_t severity)
01501 {
01502 return pantheios_getStockSeverityStringLength(severity);
01503 }
01504 # endif
01505
01506 inline size_t c_str_len(pan_severity_t severity)
01507 {
01508 return pantheios_getStockSeverityStringLength(severity);
01509 }
01510
01512 # ifdef PANTHEIOS_USE_WIDE_STRINGS
01513 inline wchar_t const* c_str_ptr_w(pan_severity_t severity)
01514 {
01515 return pantheios_getStockSeverityString(severity);
01516 }
01517 # else
01518 inline char const* c_str_ptr_a(pan_severity_t severity)
01519 {
01520 return pantheios_getStockSeverityString(severity);
01521 }
01522 # endif
01523
01524 inline pan_char_t const* c_str_ptr(pan_severity_t severity)
01525 {
01526 return pantheios_getStockSeverityString(severity);
01527 }
01528
01530 # ifdef PANTHEIOS_USE_WIDE_STRINGS
01531 inline wchar_t const* c_str_ptr_null_w(pan_severity_t severity)
01532 {
01533 wchar_t const* s = pantheios_getStockSeverityString(severity);
01534
01535 return ('\0' != *s) ? s : NULL;
01536 }
01537 # else
01538 inline char const* c_str_ptr_null_a(pan_severity_t severity)
01539 {
01540 char const* s = pantheios_getStockSeverityString(severity);
01541
01542 return ('\0' != *s) ? s : NULL;
01543 }
01544 # endif
01545
01546 inline pan_char_t const* c_str_ptr_null(pan_severity_t severity)
01547 {
01548 pan_char_t const* s = pantheios_getStockSeverityString(severity);
01549
01550 return ('\0' != *s) ? s : NULL;
01551 }
01552 # endif
01553
01554 # if !defined(PANTHEIOS_NO_NAMESPACE)
01555 }
01556 # endif
01557
01558 #endif
01559
01560
01561
01562
01563
01564 #ifdef __cplusplus
01565 # ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
01566 inline size_t pan_slice_t::calc_length_n_(pan_char_t const* s, size_t len)
01567 {
01568 #if !defined(PANTHEIOS_NO_NAMESPACE)
01569 return pantheios::util::strnlen(s, len);
01570 #else
01571 return pantheios_util_strnlen(s, len);
01572 #endif
01573 }
01574
01575 inline pan_slice_t::pan_slice_t()
01576 : len(0)
01577 , ptr(NULL)
01578 {}
01579 inline pan_slice_t::pan_slice_t(pan_char_t const* p, size_t l)
01580 : len(l)
01581 , ptr(p)
01582 {
01583 const size_t topBit = size_t(0x01) << (sizeof(size_t) * 8 - 1);
01584
01585 if(topBit & len)
01586 {
01587 this->len = calc_length_n_(p, len);
01588 }
01589 }
01590 inline pan_slice_t::pan_slice_t(pan_slice_t const& rhs)
01591 : len(rhs.len)
01592 , ptr(rhs.ptr)
01593 {}
01594 inline pan_slice_t& pan_slice_t::operator =(pan_slice_t const& rhs)
01595 {
01596 len = rhs.len;
01597 ptr = rhs.ptr;
01598
01599 return *this;
01600 }
01601
01602 inline pan_slice_t::pan_slice_t(int len, pan_char_t const* p)
01603 : len(calc_length_n_(p, static_cast<size_t>(len)))
01604 , ptr(p)
01605 {}
01606 # endif
01607 #endif
01608
01609
01610
01611
01612
01613 #if !defined(PANTHEIOS_NO_NAMESPACE)
01614 }
01615
01616
01617 # ifndef PANTHEIOS_NO_STOCK_LEVELS
01618
01619
01620
01621
01622
01663 # define PANTHEIOS_SEV_EMERGENCY ::pantheios::SEV_EMERGENCY
01664 # define PANTHEIOS_SEV_ALERT ::pantheios::SEV_ALERT
01665 # define PANTHEIOS_SEV_CRITICAL ::pantheios::SEV_CRITICAL
01666 # define PANTHEIOS_SEV_ERROR ::pantheios::SEV_ERROR
01667 # define PANTHEIOS_SEV_WARNING ::pantheios::SEV_WARNING
01668 # define PANTHEIOS_SEV_NOTICE ::pantheios::SEV_NOTICE
01669 # define PANTHEIOS_SEV_INFORMATIONAL ::pantheios::SEV_INFORMATIONAL
01670 # define PANTHEIOS_SEV_DEBUG ::pantheios::SEV_DEBUG
01671 # endif
01672
01673
01674 #ifdef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
01675
01687 #endif
01688 namespace stlsoft
01689 {
01690
01691 #ifdef PANTHEIOS_USE_WIDE_STRINGS
01692 using ::pantheios::shims::c_str_data_w;
01693 using ::pantheios::shims::c_str_len_w;
01694 using ::pantheios::shims::c_str_ptr_w;
01695 using ::pantheios::shims::c_str_ptr_null_w;
01696 #else
01697 using ::pantheios::shims::c_str_data_a;
01698 using ::pantheios::shims::c_str_len_a;
01699 using ::pantheios::shims::c_str_ptr_a;
01700 using ::pantheios::shims::c_str_ptr_null_a;
01701 #endif
01702 using ::pantheios::shims::c_str_data;
01703 using ::pantheios::shims::c_str_len;
01704 using ::pantheios::shims::c_str_ptr;
01705 using ::pantheios::shims::c_str_ptr_null;
01706
01707 }
01708
01709 #else
01710
01711 # ifdef __cplusplus
01712 namespace stlsoft
01713 {
01714
01715 #ifdef PANTHEIOS_USE_WIDE_STRINGS
01716 using ::c_str_data_w;
01717 using ::c_str_len_w;
01718 using ::c_str_ptr_w;
01719 using ::c_str_ptr_null_w;
01720 #else
01721 using ::c_str_data_a;
01722 using ::c_str_len_a;
01723 using ::c_str_ptr_a;
01724 using ::c_str_ptr_null_a;
01725 #endif
01726 using ::c_str_data;
01727 using ::c_str_len;
01728 using ::c_str_ptr;
01729 using ::c_str_ptr_null;
01730
01731 }
01732 # endif
01733
01734 #endif
01735
01736
01737
01738
01739
01740 #ifdef STLSOFT_PPF_pragma_once_SUPPORT
01741 # pragma once
01742 #endif
01743
01744
01745
01746 #endif
01747
01748