Skip to content

Commit

Permalink
Fixed compilation problems
Browse files Browse the repository at this point in the history
  • Loading branch information
OpenNI committed Oct 16, 2011
1 parent 07d8ce3 commit 41646a5
Show file tree
Hide file tree
Showing 24 changed files with 142 additions and 637 deletions.
Binary file modified Documentation/OpenNI.chm
Binary file not shown.
11 changes: 0 additions & 11 deletions Include/XnCppWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -5256,8 +5256,6 @@ namespace xn
inline ScriptNode(XnNodeHandle hNode = NULL) : ProductionNode(hNode) {}
inline ScriptNode(const NodeWrapper& other) : ProductionNode(other) {}

inline XnStatus Create(Context& context, const XnChar* strFormat);

inline const XnChar* GetSupportedFormat()
{
return xnScriptNodeGetSupportedFormat(GetHandle());
Expand Down Expand Up @@ -6321,15 +6319,6 @@ namespace xn
return xnScriptNodeRun(GetHandle(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
}

inline XnStatus ScriptNode::Create(Context& context, const XnChar* strFormat)
{
XnNodeHandle hNode;
XnStatus nRetVal = xnCreateScriptNode(context.GetUnderlyingObject(), strFormat, &hNode);
XN_IS_STATUS_OK(nRetVal);
TakeOwnership(hNode);
return (XN_STATUS_OK);
}

//---------------------------------------------------------------------------
// Global Helper Functions
//---------------------------------------------------------------------------
Expand Down
167 changes: 55 additions & 112 deletions Include/XnDump.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,17 @@
//---------------------------------------------------------------------------
// Includes
//---------------------------------------------------------------------------
#include "XnPlatform.h"
#include "XnStatus.h"
#include "XnOS.h"

//---------------------------------------------------------------------------
// Types
//---------------------------------------------------------------------------
typedef struct XnDumpFileHandle
typedef struct XnDump
{
void* pInternal;
} XnDumpFileHandle;
XN_FILE_HANDLE hFile;
} XnDump;

const XnDumpFileHandle XN_DUMP_INVALID_FILE_HANDLE = { NULL };
const XnDump XN_DUMP_CLOSED = { XN_INVALID_FILE_HANDLE };

//---------------------------------------------------------------------------
// Functions
Expand All @@ -45,138 +44,84 @@ const XnDumpFileHandle XN_DUMP_INVALID_FILE_HANDLE = { NULL };
/**
* Configures if a specific dump mask is enabled.
*
* @param strMask [in] The mask to set.
* @param bEnabled [in] TRUE to enable this dump, FALSE otherwise.
* @param csMask [in] The mask to set.
* @param bEnabled [in] TRUE to enable this mask, FALSE otherwise.
*/
XN_C_API XnStatus XN_C_DECL xnDumpSetMaskState(const XnChar* strMask, XnBool bEnabled);
XN_C_API XnStatus XN_C_DECL xnDumpSetMaskState(const XnChar* csMask, XnBool bEnabled);

/**
* This function checks if a dump mask is enabled
*
* @param strDumpMask [in] The mask that should be checked.
*/
XN_C_API XnBool XN_C_DECL xnLogIsDumpMaskEnabled(const XnChar* strDumpMask);

/**
* Opens a file for writing dump.
*
* @param strDumpName [in] Name of the dump mask this file belongs to.
* @param strNameFormat [in] A format string for the name of the file.
*
* @returns a file handle for writing data. The file should be closed using @ref _xnDumpFileClose().
* @param csDumpMask [in] The mask that should be checked.
*/
XN_C_API XnDumpFileHandle XN_C_DECL xnDumpFileOpen(const XnChar* strDumpName, const XnChar* strNameFormat, ...);
XN_C_API XnBool XN_C_DECL xnLogIsDumpMaskEnabled(const XnChar* csDumpMask);

/**
* Opens a file for writing dump using some advanced options.
*
* You would usually prefer to use @ref xnDumpFileOpen().
* This function creates an XnDump object through which dumps can be written. Dump will only be
* created if the mask is enabled.
*
* @param strDumpName [in] Name of the dump mask this file belongs to.
* @param bForce [in] When TRUE, file will be created even if dump is currently off.
* @param bSessionDump [in] When TRUE, file will be created with current session timestamp as a prefix to its name.
* @param strNameFormat [in] A format string for the name of the file.
*
* @returns a file handle for writing data. The file should be closed using @ref _xnDumpFileClose().
* @param pDump [in] A handle to the dump.
* @param csDumpMask [in] The mask under which this dump should be written.
* @param csHeader [in] A header line to be written to the file. When this param is NULL, file will
* be opened as a binary file. When param is not NULL, the string will be written
* to the file once it is open.
* @param csFileNameFormat [in] Format of the name to give the file.
* @param ... [in] Arguments for the file name format string.
*/
XN_C_API XnDumpFileHandle XN_C_DECL xnDumpFileOpenEx(const XnChar* strDumpName, XnBool bForce, XnBool bSessionDump, const XnChar* strNameFormat, ...);
XN_C_API void XN_C_DECL xnDumpInit(XnDump* pDump, const XnChar* csDumpMask, const XnChar* csHeader, const XnChar* csFileNameFormat, ...);

/**
* Writes a buffer to a dump file.
* This function creates an XnDump object through which dumps can be written. This dump will be created
* anyway, and does not depend on log configuration.
*
* @param hFile [in] Dump file to write to. A handle retrieved from @ref xnDumpFileOpen.
* @param pBuffer [in] Data to be written to file.
* @param nBufferSize [in] Size of the buffer.
* @param pDump [in] A handle to the dump.
* @param csHeader [in] A header line to be written to the file. When this param is NULL, file will
* be opened as a binary file. When param is not NULL, the string will be written
* to the file once it is open.
* @param csFileNameFormat [in] Format of the name to give the file.
* @param ... [in] Arguments for the file name format string.
*/
XN_C_API void XN_C_DECL _xnDumpFileWriteBuffer(XnDumpFileHandle hFile, const XnUInt8* pBuffer, XnUInt32 nBufferSize);
XN_C_API void XN_C_DECL xnDumpForceInit(XnDump* pDump, const XnChar* csHeader, const XnChar* csFileNameFormat, ...);

/**
* Writes a formatted string to a dump file.
*
* @param hFile [in] Dump file to write to. A handle retrieved from @ref xnDumpFileOpen.
* @param strFormat [in] Format string.
* This function closes a dump file (use it once file is no longer needed).
* You can later use xnDumpWriteString and xnDumpWriteBuffer to write to this file.
*
* NOTE: the total length of the string must not exceed 8 KB. If it does, it will be truncated.
* @param pDump [in] A pointer to an XnDump struct returned from a call to xnDumpInit.
*/
XN_C_API void XN_C_DECL _xnDumpFileWriteString(XnDumpFileHandle hFile, const XnChar* strFormat, ...);
XN_C_API void XN_C_DECL xnDumpClose(XnDump* pDump);

/**
* Closes a dump file.
*
* @param hFile [in/out] Dump file to close. A handle retrieved from @ref xnDumpFileOpen.
* Writes a buffer to the dump.
*
* @param dump [in] The dump to write to.
* @param pBuffer [in] A pointer to the buffer to write.
* @param nBufferSize [in] The number of bytes to write from the buffer.
*/
XN_C_API void XN_C_DECL _xnDumpFileClose(XnDumpFileHandle* phFile);

#define xnDumpFileWriteBuffer(hFile, pBuffer, nBufferSize) \
if (hFile.pInternal != NULL) \
{ \
_xnDumpFileWriteBuffer(hFile, pBuffer, nBufferSize); \
}

#define xnDumpFileClose(hFile) \
if (hFile.pInternal != NULL) \
{ \
_xnDumpFileClose(hFile); \
}

#if XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_WIN32_VAARGS_STYLE
#define xnDumpFileWriteString(hFile, strFormat, ...) \
if (hFile.pInternal != NULL) \
{ \
_xnDumpFileWriteString(hFile, strFormat, __VA_ARGS__); \
}
#elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_GCC_VAARGS_STYLE
#define xnDumpFileWriteString(hFile, strFormat, ...) \
if (hFile.pInternal != NULL) \
{ \
_xnDumpFileWriteString(hFile, strFormat, ##__VA_ARGS__); \
}
#elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_ARC_VAARGS_STYLE
#define xnDumpFileWriteString(hFile, strFormat, ...) \
if (hFile.pInternal != NULL) \
{ \
_xnDumpFileWriteString(hFile, strFormat); \
}
#elif XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_NO_VAARGS
#define xnDumpFileWriteString(hFile, strFormat, arg) \
if (hFile.pInternal != NULL) \
{ \
_xnDumpFileWriteString(hFile, 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);
XN_C_API void XN_C_DECL xnDumpWriteBufferImpl(XnDump dump, const void* pBuffer, XnUInt32 nBufferSize);

#define xnDumpWriteBuffer(dump, pBuffer, nBufferSize) \
if (dump.hFile != XN_INVALID_FILE_HANDLE) \
{ \
xnDumpWriteBufferImpl(dump, pBuffer, nBufferSize); \
}

/**
* Writes a formatted string to the dump.
*
* @param dump [in] The dump to write to.
* @param csFormat [in] A format string.
* @param ... [in] Arguments to the format string.
*/
XN_C_API void XN_C_DECL xnDumpWriteStringImpl(XnDump dump, const XnChar* csFormat, ...);

/**
* Flushes a dump to the disk.
*
* @param dump [in] The dump to flush.
*/
XN_C_API void XN_C_DECL xnDumpFlush(XnDump dump);

#if XN_PLATFORM_VAARGS_TYPE == XN_PLATFORM_USE_WIN32_VAARGS_STYLE
#define xnDumpWriteString(dump, csFormat, ...) \
if ((dump).hFile != XN_INVALID_FILE_HANDLE) { \
Expand All @@ -201,6 +146,4 @@ XN_C_API void XN_API_DEPRECATED("Use xnDumpFileX methods instead") XN_C_DECL xnD
#error Xiron Log - Unknown VAARGS type!
#endif

#endif // #ifndef __XN_NO_BC__

#endif // __XN_DUMP_H__
127 changes: 0 additions & 127 deletions Include/XnDumpWriters.h

This file was deleted.

2 changes: 0 additions & 2 deletions Include/XnLog.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,6 @@ XN_C_API void XN_C_DECL xnLogWriteBinaryData(const XnChar* csLogMask, XnLogSever
*/
XN_C_API XnStatus XN_C_DECL xnLogCreateFile(const XnChar* csFileName, XN_FILE_HANDLE* phFile);

XN_C_API XnStatus XN_C_DECL xnLogCreateFileEx(const XnChar* csFileName, XnBool bSessionBased, XN_FILE_HANDLE* phFile);

#define XN_MASK_RETVAL_CHECKS "RetValChecks"

/** Validates return value and writes log message with appropriate status string **/
Expand Down
2 changes: 1 addition & 1 deletion Include/XnLogWriterBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
//---------------------------------------------------------------------------
// Types
//---------------------------------------------------------------------------
class XnLogWriterBase
class XnLogWriterBase : XnLogWriter
{
public:
XnLogWriterBase() : m_bRegistered(FALSE)
Expand Down
Loading

0 comments on commit 41646a5

Please sign in to comment.