Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __XN_DUMP_H__
00023 #define __XN_DUMP_H__
00024
00025
00026
00027
00028 #include "XnOS.h"
00029
00030
00031
00032
00033 typedef struct XnDump
00034 {
00035 XN_FILE_HANDLE hFile;
00036 } XnDump;
00037
00038 const XnDump XN_DUMP_CLOSED = { XN_INVALID_FILE_HANDLE };
00039
00040
00041
00042
00043
00050 XN_C_API XnStatus XN_C_DECL xnDumpSetMaskState(const XnChar* csMask, XnBool bEnabled);
00051
00057 XN_C_API XnBool XN_C_DECL xnLogIsDumpMaskEnabled(const XnChar* csDumpMask);
00058
00071 XN_C_API void XN_C_DECL xnDumpInit(XnDump* pDump, const XnChar* csDumpMask, const XnChar* csHeader, const XnChar* csFileNameFormat, ...);
00072
00084 XN_C_API void XN_C_DECL xnDumpForceInit(XnDump* pDump, const XnChar* csHeader, const XnChar* csFileNameFormat, ...);
00085
00092 XN_C_API void XN_C_DECL xnDumpClose(XnDump* pDump);
00093
00101 XN_C_API void XN_C_DECL xnDumpWriteBufferImpl(XnDump dump, const void* pBuffer, XnUInt32 nBufferSize);
00102
00103 inline void xnDumpWriteBuffer(XnDump dump, const void* pBuffer, XnUInt32 nBufferSize)
00104 {
00105 if (dump.hFile != XN_INVALID_FILE_HANDLE)
00106 {
00107 xnDumpWriteBufferImpl(dump, pBuffer, nBufferSize);
00108 }
00109 }
00110
00118 XN_C_API void XN_C_DECL xnDumpWriteStringImpl(XnDump dump, const XnChar* csFormat, ...);
00119
00125 XN_C_API void XN_C_DECL xnDumpFlush(XnDump dump);
00126
00127 #if XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_WIN32_VAARGS_STYLE
00128 #define xnDumpWriteString(dump, csFormat, ...) \
00129 if ((dump).hFile != XN_INVALID_FILE_HANDLE) { \
00130 xnDumpWriteStringImpl((dump), csFormat, __VA_ARGS__); \
00131 }
00132 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_GCC_VAARGS_STYLE
00133 #define xnDumpWriteString(dump, csFormat, ...) \
00134 if ((dump).hFile != XN_INVALID_FILE_HANDLE) { \
00135 xnDumpWriteStringImpl((dump), csFormat, ##__VA_ARGS__); \
00136 }
00137 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_ARC_VAARGS_STYLE
00138 #define xnDumpWriteString(dump, csFormat...) \
00139 if ((dump).hFile != XN_INVALID_FILE_HANDLE) { \
00140 xnDumpWriteStringImpl((dump), csFormat); \
00141 }
00142 #elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_NO_VAARGS
00143 #define xnDumpWriteString(dump, csFormat, arg) \
00144 if ((dump).hFile != XN_INVALID_FILE_HANDLE) { \
00145 xnDumpWriteStringImpl((dump), csFormat, arg); \
00146 }
00147 #else
00148 #error Xiron Log - Unknown VAARGS type!
00149 #endif
00150
00151 #endif // __XN_DUMP_H__