XnDump.h
Go to the documentation of this file.
/****************************************************************************
* *
* OpenNI 1.x Alpha *
* Copyright (C) 2011 PrimeSense Ltd. *
* *
* This file is part of OpenNI. *
* *
* OpenNI is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as published *
* by the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* OpenNI is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with OpenNI. If not, see <http://www.gnu.org/licenses/>. *
* *
****************************************************************************/
#ifndef __XN_DUMP_H__
#define __XN_DUMP_H__
//---------------------------------------------------------------------------
// Includes
//---------------------------------------------------------------------------
#include "XnPlatform.h"
#include "XnStatus.h"
//---------------------------------------------------------------------------
// Types
//---------------------------------------------------------------------------
struct XnDumpFile;
typedef struct XnDumpFile XnDumpFile;
//---------------------------------------------------------------------------
// Functions
//---------------------------------------------------------------------------
XN_C_API XnStatus XN_C_DECL xnDumpSetMaskState(const XnChar* strMask, XnBool bEnabled);
XN_C_API XnBool XN_C_DECL xnLogIsDumpMaskEnabled(const XnChar* strDumpMask);
XN_C_API XnDumpFile* XN_C_DECL xnDumpFileOpen(const XnChar* strDumpName, const XnChar* strNameFormat, ...);
XN_C_API XnDumpFile* XN_C_DECL xnDumpFileOpenEx(const XnChar* strDumpName, XnBool bForce, XnBool bSessionDump, const XnChar* strNameFormat, ...);
XN_C_API void XN_C_DECL _xnDumpFileWriteBuffer(XnDumpFile* pFile, const void* pBuffer, XnUInt32 nBufferSize);
XN_C_API void XN_C_DECL _xnDumpFileWriteString(XnDumpFile* pFile, const XnChar* strFormat, ...);
XN_C_API void XN_C_DECL _xnDumpFileClose(XnDumpFile* pFile);
#define xnDumpFileWriteBuffer(pFile, pBuffer, nBufferSize) \
if ((pFile) != NULL) \
{ \
_xnDumpFileWriteBuffer(pFile, pBuffer, nBufferSize); \
} \
#define xnDumpFileClose(pFile) \
if ((pFile) != NULL) \
{ \
_xnDumpFileClose(pFile); \
pFile = NULL; \
} \
#if XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_WIN32_VAARGS_STYLE
#define xnDumpFileWriteString(pFile, strFormat, ...) \
if ((pFile) != NULL) \
{ \
_xnDumpFileWriteString(pFile, strFormat, __VA_ARGS__); \
}
#elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_GCC_VAARGS_STYLE
#define xnDumpFileWriteString(pFile, strFormat, ...) \
if ((pFile) != NULL) \
{ \
_xnDumpFileWriteString(pFile, strFormat, ##__VA_ARGS__);\
}
#elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_ARC_VAARGS_STYLE
#define xnDumpFileWriteString(pFile, strFormat, ...) \
if ((pFile) != NULL) \
{ \
_xnDumpFileWriteString(pFile, strFormat); \
}
#elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_NO_VAARGS
#define xnDumpFileWriteString(pFile, strFormat, arg) \
if ((pFile) != NULL) \
{ \
_xnDumpFileWriteString(pFile, strFormat,arg); \
}
#else
#error Xiron Log - Unknown VAARGS type!
#endif
//---------------------------------------------------------------------------
// Backwards Compatibility Stuff
//---------------------------------------------------------------------------
#ifndef __XN_NO_BC__
#include "XnOS.h"
typedef struct XnDump
{
XN_FILE_HANDLE hFile;
} XnDump;
const XnDump XN_DUMP_CLOSED = { XN_INVALID_FILE_HANDLE };
XN_C_API void XN_API_DEPRECATED("Use xnDumpFileX methods instead") XN_C_DECL xnDumpInit(XnDump* pDump, const XnChar* csDumpMask, const XnChar* csHeader, const XnChar* csFileNameFormat, ...);
XN_C_API void XN_API_DEPRECATED("Use xnDumpFileX methods instead") XN_C_DECL xnDumpForceInit(XnDump* pDump, const XnChar* csHeader, const XnChar* csFileNameFormat, ...);
XN_C_API void XN_API_DEPRECATED("Use xnDumpFileX methods instead") XN_C_DECL xnDumpClose(XnDump* pDump);
XN_C_API void XN_API_DEPRECATED("Use xnDumpFileX methods instead") XN_C_DECL xnDumpWriteBufferImpl(XnDump dump, const void* pBuffer, XnUInt32 nBufferSize);
XN_C_API void XN_API_DEPRECATED("Use xnDumpFileX methods instead") XN_C_DECL xnDumpWriteStringImpl(XnDump dump, const XnChar* csFormat, ...);
XN_C_API void XN_API_DEPRECATED("Use xnDumpFileX methods instead") XN_C_DECL xnDumpFlush(XnDump dump);
#define xnDumpWriteBuffer(dump, pBuffer, nBufferSize) \
if (dump.hFile != XN_INVALID_FILE_HANDLE) \
{ \
xnDumpWriteBufferImpl(dump, pBuffer, nBufferSize); \
}
#if XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_WIN32_VAARGS_STYLE
#define xnDumpWriteString(dump, csFormat, ...) \
if ((dump).hFile != XN_INVALID_FILE_HANDLE) { \
xnDumpWriteStringImpl((dump), csFormat, __VA_ARGS__); \
}
#elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_GCC_VAARGS_STYLE
#define xnDumpWriteString(dump, csFormat, ...) \
if ((dump).hFile != XN_INVALID_FILE_HANDLE) { \
xnDumpWriteStringImpl((dump), csFormat, ##__VA_ARGS__); \
}
#elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_ARC_VAARGS_STYLE
#define xnDumpWriteString(dump, csFormat...) \
if ((dump).hFile != XN_INVALID_FILE_HANDLE) { \
xnDumpWriteStringImpl((dump), csFormat); \
}
#elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_NO_VAARGS
#define xnDumpWriteString(dump, csFormat, arg) \
if ((dump).hFile != XN_INVALID_FILE_HANDLE) { \
xnDumpWriteStringImpl((dump), csFormat, arg); \
}
#else
#error Xiron Log - Unknown VAARGS type!
#endif
#endif // #ifndef __XN_NO_BC__
#endif // __XN_DUMP_H__
xnDumpFileOpen
XN_C_API XnDumpFile *XN_C_DECL xnDumpFileOpen(const XnChar *strDumpName, const XnChar *strNameFormat,...)
xnDumpFileOpenEx
XN_C_API XnDumpFile *XN_C_DECL xnDumpFileOpenEx(const XnChar *strDumpName, XnBool bForce, XnBool bSessionDump, const XnChar *strNameFormat,...)
XnDumpFile
struct XnDumpFile XnDumpFile
Definition XnDump.h:35
xnDumpSetMaskState
XN_C_API XnStatus XN_C_DECL xnDumpSetMaskState(const XnChar *strMask, XnBool bEnabled)
xnLogIsDumpMaskEnabled
XN_C_API XnBool XN_C_DECL xnLogIsDumpMaskEnabled(const XnChar *strDumpMask)
XnOS.h
XnPlatform.h
XN_C_API
#define XN_C_API
Definition XnPlatform.h:132
XnStatus.h
XnStatus
XnUInt32 XnStatus
Definition XnStatus.h:34