XnOS.h File Reference
`#include "XnPlatform.h"`
`#include "XnMacros.h"`
`#include "XnStatusCodes.h"`
`#include "XnOSStrings.h"`
`#include "XnOSMemory.h"`
`#include "Win32/XnOSWin32.h"`

Go to the source code of this file.

## Classes

struct | xnOSInfo

## Macros

#define | XN_MASK_OS "xnOS"
#define | XN_MAX_OS_NAME_LENGTH 255
#define | XN_OS_FILE_READ 0x01
#define | XN_OS_FILE_WRITE 0x02
#define | XN_OS_FILE_CREATE_NEW_ONLY 0x04
#define | XN_OS_FILE_TRUNCATE 0x08
#define | XN_OS_FILE_APPEND 0x10
#define | XN_OS_FILE_AUTO_FLUSH 0x20
#define | XN_OS_NETWORK_LOCAL_HOST "127.0.0.1"
#define | XN_VALIDATE_INPUT_PTR(x)
#define | XN_VALIDATE_OUTPUT_PTR(x)
#define | XN_VALIDATE_ALLOC_PTR(x)
#define | XN_VALIDATE_ALLOC(x, y)
#define | XN_VALIDATE_CALLOC(x, y, z)
#define | XN_VALIDATE_ALIGNED_ALLOC(x, y, w)
#define | XN_VALIDATE_ALIGNED_CALLOC(x, y, z, w)
#define | XN_FREE_AND_NULL(x)
#define | XN_ALIGNED_FREE_AND_NULL(x)
#define | XN_VALIDATE_NEW(ptr, type, ...)
#define | XN_VALIDATE_NEW_AND_INIT(ptr, type, ...)
#define | XN_VALIDATE_STR_APPEND(w, x, y, z)
#define | XN_VALIDATE_STR_PREFIX(w, x, y, z)
#define | XN_VALIDATE_STR_COPY(w, x, y, z)
#define | XN_VALIDATE_STRN_COPY(v, w, x, y, z)
#define | XN_VALIDATE_READ_INI_STR(u, v, w, x, y, z)
#define | XN_VALIDATE_READ_INI_INT(v, w, x, y, z)
#define | XN_VALIDATE_READ_INI_FLOAT(v, w, x, y, z)
#define | XN_VALIDATE_READ_INI_DOUBLE(v, w, x, y, z)
#define | XN_VALIDATE_LOCK_MUTEX(x, y, z)
#define | XN_VALIDATE_UNLOCK_MUTEX(x, z)
#define | XN_VALIDATE_FILE_EXISTS_RET(x, y, z, w)
#define | XN_VALIDATE_FILE_EXISTS(x, y, z)
#define | XN_NEW(type, ...)
#define | XN_NEW_ARR(type, count)
#define | XN_DELETE(p)
#define | XN_DELETE_ARR(p)
#define | XN_SOCKET_DEFAULT_TIMEOUT 0xFFFEFFFE

## Typedefs

typedef struct xnOSInfo | xnOSInfo
typedef XnBool(* | XnConditionFunc) (void *pConditionData)
typedef enum XnThreadPriority | XnThreadPriority
typedef struct xnOSSocket * | XN_SOCKET_HANDLE
typedef struct XnOSSharedMemory | XnOSSharedMemory
typedef struct XnOSSharedMemory * | XN_SHARED_MEMORY_HANDLE

## Enumerations

enum | XnOSSeekType { XN_OS_SEEK_SET = 0 , XN_OS_SEEK_CUR , XN_OS_SEEK_END }
enum | XnOSSocketType { XN_OS_UDP_SOCKET = 0 , XN_OS_TCP_SOCKET }
enum | XnAllocationType { XN_ALLOCATION_MALLOC , XN_ALLOCATION_MALLOC_ALIGNED , XN_ALLOCATION_CALLOC , XN_ALLOCATION_CALLOC_ALIGNED , XN_ALLOCATION_NEW , XN_ALLOCATION_NEW_ARRAY }
enum | XnThreadPriority { XN_PRIORITY_LOW , XN_PRIORITY_NORMAL , XN_PRIORITY_HIGH , XN_PRIORITY_CRITICAL }

## Functions

XN_C_API XnStatus XN_C_DECL | xnOSInit ()
XN_C_API XnStatus XN_C_DECL | xnOSShutdown ()
XN_C_API XnStatus XN_C_DECL | xnOSGetInfo (xnOSInfo *pOSInfo)
XN_C_API void *XN_C_DECL | xnOSLogMemAlloc (void *pMemBlock, XnAllocationType nAllocType, XnUInt32 nBytes, const XnChar *csFunction, const XnChar *csFile, XnUInt32 nLine, const XnChar *csAdditional)
XN_C_API void XN_C_DECL | xnOSLogMemFree (const void *pMemBlock)
XN_C_API void XN_C_DECL | xnOSWriteMemoryReport (const XnChar *csFileName)
XN_C_API XnStatus XN_C_DECL | xnOSGetFileList (const XnChar *cpSearchPattern, const XnChar *cpPrefixPath, XnChar cpFileList[][XN_FILE_MAX_PATH], const XnUInt32 nMaxFiles, XnUInt32 *pnFoundFiles)
XN_C_API XnStatus XN_C_DECL | xnOSOpenFile (const XnChar *cpFileName, const XnUInt32 nFlags, XN_FILE_HANDLE *pFile)
XN_C_API XnStatus XN_C_DECL | xnOSCloseFile (XN_FILE_HANDLE *pFile)
XN_C_API XnStatus XN_C_DECL | xnOSReadFile (const XN_FILE_HANDLE File, void *pBuffer, XnUInt32 *pnBufferSize)
XN_C_API XnStatus XN_C_DECL | xnOSWriteFile (const XN_FILE_HANDLE File, const void *pBuffer, const XnUInt32 nBufferSize)
XN_C_API XnStatus XN_C_DECL | xnOSSeekFile (const XN_FILE_HANDLE File, const XnOSSeekType SeekType, const XnInt32 nOffset)
XN_C_API XnStatus XN_C_DECL | xnOSSeekFile64 (const XN_FILE_HANDLE File, const XnOSSeekType SeekType, const XnInt64 nOffset)
XN_C_API XnStatus XN_C_DECL | xnOSTellFile (const XN_FILE_HANDLE File, XnUInt32 *nFilePos)
XN_C_API XnStatus XN_C_DECL | xnOSTellFile64 (const XN_FILE_HANDLE File, XnUInt64 *nFilePos)
XN_C_API XnStatus XN_C_DECL | xnOSFlushFile (const XN_FILE_HANDLE File)
XN_C_API XnStatus XN_C_DECL | xnOSDoesFileExist (const XnChar *cpFileName, XnBool *pbResult)
XN_C_API XnStatus XN_C_DECL | xnOSDoesDirecotyExist (const XnChar *cpDirName, XnBool *pbResult)
XN_C_API XnStatus XN_C_DECL | xnOSLoadFile (const XnChar *cpFileName, void *pBuffer, const XnUInt32 nBufferSize)
XN_C_API XnStatus XN_C_DECL | xnOSSaveFile (const XnChar *cpFileName, const void *pBuffer, const XnUInt32 nBufferSize)
XN_C_API XnStatus XN_C_DECL | xnOSAppendFile (const XnChar *cpFileName, const void *pBuffer, const XnUInt32 nBufferSize)
XN_C_API XnStatus XN_C_DECL | xnOSGetFileSize (const XnChar *cpFileName, XnUInt32 *pnFileSize)
XN_C_API XnStatus XN_C_DECL | xnOSGetFileSize64 (const XnChar *cpFileName, XnUInt64 *pnFileSize)
XN_C_API XnStatus XN_C_DECL | xnOSCreateDirectory (const XnChar *cpDirName)
XN_C_API XnStatus XN_C_DECL | xnOSGetDirName (const XnChar *cpFilePath, XnChar *cpDirName, const XnUInt32 nBufferSize)
XN_C_API XnStatus XN_C_DECL | xnOSGetFileName (const XnChar *cpFilePath, XnChar *cpFileName, const XnUInt32 nBufferSize)
XN_C_API XnStatus XN_C_DECL | xnOSGetFullPathName (const XnChar *strFilePath, XnChar *strFullPath, XnUInt32 nBufferSize)
XN_C_API XnStatus XN_C_DECL | xnOSGetCurrentDir (XnChar *cpDirName, const XnUInt32 nBufferSize)
XN_C_API XnStatus XN_C_DECL | xnOSSetCurrentDir (const XnChar *cpDirName)
XN_C_API XnStatus XN_C_DECL | xnOSDeleteFile (const XnChar *cpFileName)
XN_C_API XnStatus XN_C_DECL | xnOSDeleteEmptyDirectory (const XnChar *strDirName)
XN_C_API XnStatus XN_C_DECL | xnOSDeleteDirectoryTree (const XnChar *strDirName)
XN_C_API XnStatus XN_C_DECL | xnOSReadStringFromINI (const XnChar *cpINIFile, const XnChar *cpSection, const XnChar *cpKey, XnChar *cpDest, const XnUInt32 nDestLength)
XN_C_API XnStatus XN_C_DECL | xnOSReadFloatFromINI (const XnChar *cpINIFile, const XnChar *cpSection, const XnChar *cpKey, XnFloat *fDest)
XN_C_API XnStatus XN_C_DECL | xnOSReadDoubleFromINI (const XnChar *cpINIFile, const XnChar *cpSection, const XnChar *cpKey, XnDouble *fDest)
XN_C_API XnStatus XN_C_DECL | xnOSReadIntFromINI (const XnChar *cpINIFile, const XnChar *cpSection, const XnChar *cpKey, XnUInt32 *nDest)
XN_C_API XnStatus XN_C_DECL | xnOSWriteStringToINI (const XnChar *cpINIFile, const XnChar *cpSection, const XnChar *cpKey, const XnChar *cpSrc)
XN_C_API XnStatus XN_C_DECL | xnOSWriteFloatToINI (const XnChar *cpINIFile, const XnChar *cpSection, const XnChar *cpKey, const XnFloat fSrc)
XN_C_API XnStatus XN_C_DECL | xnOSWriteDoubleToINI (const XnChar *cpINIFile, const XnChar *cpSection, const XnChar *cpKey, const XnDouble fSrc)
XN_C_API XnStatus XN_C_DECL | xnOSWriteIntToINI (const XnChar *cpINIFile, const XnChar *cpSection, const XnChar *cpKey, const XnUInt32 nSrc)
XN_C_API XnStatus XN_C_DECL | xnOSLoadLibrary (const XnChar *cpFileName, XN_LIB_HANDLE *pLibHandle)
XN_C_API XnStatus XN_C_DECL | xnOSFreeLibrary (const XN_LIB_HANDLE LibHandle)
XN_C_API XnStatus XN_C_DECL | xnOSGetProcAddress (const XN_LIB_HANDLE LibHandle, const XnChar *cpProcName, XnFarProc *pProcAddr)
XN_C_API XnStatus XN_C_DECL | xnOSGetEpochTime (XnUInt32 *nEpochTime)
XN_C_API XnStatus XN_C_DECL | xnOSGetTimeStamp (XnUInt64 *nTimeStamp)
XN_C_API XnStatus XN_C_DECL | xnOSGetHighResTimeStamp (XnUInt64 *nTimeStamp)
XN_C_API XnStatus XN_C_DECL | xnOSSleep (XnUInt32 nMilliseconds)
XN_C_API XnStatus XN_C_DECL | xnOSStartTimer (XnOSTimer *pTimer)
XN_C_API XnStatus XN_C_DECL | xnOSStartHighResTimer (XnOSTimer *pTimer)
XN_C_API XnStatus XN_C_DECL | xnOSQueryTimer (XnOSTimer Timer, XnUInt64 *pnTimeSinceStart)
XN_C_API XnStatus XN_C_DECL | xnOSStopTimer (XnOSTimer *pTimer)
XN_C_API XnStatus XN_C_DECL | xnOSGetMonoTime (struct timespec *pTime)
XN_C_API XnStatus XN_C_DECL | xnOSGetTimeout (struct timespec *pTime, XnUInt32 nMilliseconds)
XN_C_API XnStatus XN_C_DECL | xnOSGetAbsTimeout (struct timespec *pTime, XnUInt32 nMilliseconds)
XN_C_API XnStatus XN_C_DECL | xnOSCreateThread (XN_THREAD_PROC_PROTO pThreadProc, const XN_THREAD_PARAM pThreadParam, XN_THREAD_HANDLE *pThreadHandle)
XN_C_API XnStatus XN_C_DECL | xnOSTerminateThread (XN_THREAD_HANDLE *pThreadHandle)
XN_C_API XnStatus XN_C_DECL | xnOSCloseThread (XN_THREAD_HANDLE *pThreadHandle)
XN_C_API XnStatus XN_C_DECL | xnOSWaitForThreadExit (XN_THREAD_HANDLE ThreadHandle, XnUInt32 nMilliseconds)
XN_C_API XnStatus XN_C_DECL | xnOSSetThreadPriority (XN_THREAD_HANDLE ThreadHandle, XnThreadPriority nPriority)
XN_C_API XnStatus XN_C_DECL | xnOSGetCurrentThreadID (XN_THREAD_ID *pThreadID)
XN_C_API XnStatus XN_C_DECL | xnOSWaitAndTerminateThread (XN_THREAD_HANDLE *pThreadHandle, XnUInt32 nMilliseconds)
XN_C_API XnStatus XN_C_DECL | xnOSGetCurrentProcessID (XN_PROCESS_ID *pProcID)
XN_C_API XnStatus XN_C_DECL | xnOSCreateProcess (const XnChar *strExecutable, XnUInt32 nArgs, const XnChar **pstrArgs, XN_PROCESS_ID *pProcID)
XN_C_API XnStatus XN_C_DECL | xnOSCreateMutex (XN_MUTEX_HANDLE *pMutexHandle)
XN_C_API XnStatus XN_C_DECL | xnOSCreateNamedMutex (XN_MUTEX_HANDLE *pMutexHandle, const XnChar *cpMutexName)
XN_C_API XnStatus XN_C_DECL | xnOSCreateNamedMutexEx (XN_MUTEX_HANDLE *pMutexHandle, const XnChar *cpMutexName, XnBool bAllowOtherUsers)
XN_C_API XnStatus XN_C_DECL | xnOSCloseMutex (XN_MUTEX_HANDLE *pMutexHandle)
XN_C_API XnStatus XN_C_DECL | xnOSLockMutex (const XN_MUTEX_HANDLE MutexHandle, XnUInt32 nMilliseconds)
XN_C_API XnStatus XN_C_DECL | xnOSUnLockMutex (const XN_MUTEX_HANDLE MutexHandle)
XN_C_API XnStatus XN_C_DECL | xnOSCreateCriticalSection (XN_CRITICAL_SECTION_HANDLE *pCriticalSectionHandle)
XN_C_API XnStatus XN_C_DECL | xnOSCloseCriticalSection (XN_CRITICAL_SECTION_HANDLE *pCriticalSectionHandle)
XN_C_API XnStatus XN_C_DECL | xnOSEnterCriticalSection (XN_CRITICAL_SECTION_HANDLE *pCriticalSectionHandle)
XN_C_API XnStatus XN_C_DECL | xnOSLeaveCriticalSection (XN_CRITICAL_SECTION_HANDLE *pCriticalSectionHandle)
XN_C_API XnStatus XN_C_DECL | xnOSCreateEvent (XN_EVENT_HANDLE *pEventHandle, XnBool bManualReset)
XN_C_API XnStatus XN_C_DECL | xnOSCreateNamedEvent (XN_EVENT_HANDLE *pEventHandle, const XnChar *cpEventName, XnBool bManualReset)
XN_C_API XnStatus XN_C_DECL | xnOSCreateNamedEventEx (XN_EVENT_HANDLE *pEventHandle, const XnChar *cpEventName, XnBool bManualReset, XnBool bAllowOtherUsers)
XN_C_API XnStatus XN_C_DECL | xnOSOpenNamedEvent (XN_EVENT_HANDLE *pEventHandle, const XnChar *cpEventName)
XN_C_API XnStatus XN_C_DECL | xnOSOpenNamedEventEx (XN_EVENT_HANDLE *pEventHandle, const XnChar *cpEventName, XnBool bAllowOtherUsers)
XN_C_API XnStatus XN_C_DECL | xnOSCloseEvent (XN_EVENT_HANDLE *pEventHandle)
XN_C_API XnStatus XN_C_DECL | xnOSSetEvent (const XN_EVENT_HANDLE EventHandle)
XN_C_API XnStatus XN_C_DECL | xnOSResetEvent (const XN_EVENT_HANDLE EventHandle)
XN_C_API XnStatus XN_C_DECL | xnOSWaitEvent (const XN_EVENT_HANDLE EventHandle, XnUInt32 nMilliseconds)
XN_C_API XnBool XN_C_DECL | xnOSIsEventSet (const XN_EVENT_HANDLE EventHandle)
XN_C_API XnStatus XN_C_DECL | xnOSCreateSemaphore (XN_SEMAPHORE_HANDLE *pSemaphoreHandle, XnUInt32 nInitialCount)
XN_C_API XnStatus XN_C_DECL | xnOSLockSemaphore (XN_SEMAPHORE_HANDLE hSemaphore, XnUInt32 nMilliseconds)
XN_C_API XnStatus XN_C_DECL | xnOSUnlockSemaphore (XN_SEMAPHORE_HANDLE hSemaphore)
XN_C_API XnStatus XN_C_DECL | xnOSCloseSemaphore (XN_SEMAPHORE_HANDLE *pSemaphoreHandle)
XN_C_API XnStatus XN_C_DECL | xnOSWaitForCondition (const XN_EVENT_HANDLE EventHandle, XnUInt32 nMilliseconds, XnConditionFunc pConditionFunc, void *pConditionData)
XN_C_API XnStatus XN_C_DECL | xnOSInitNetwork ()
XN_C_API XnStatus XN_C_DECL | xnOSShutdownNetwork ()
XN_C_API XnStatus XN_C_DECL | xnOSCreateSocket (const XnOSSocketType SocketType, const XnChar *cpIPAddress, const XnUInt16 nPort, XN_SOCKET_HANDLE *SocketPtr)
XN_C_API XnStatus XN_C_DECL | xnOSCloseSocket (XN_SOCKET_HANDLE Socket)
XN_C_API XnStatus XN_C_DECL | xnOSBindSocket (XN_SOCKET_HANDLE Socket)
XN_C_API XnStatus XN_C_DECL | xnOSListenSocket (XN_SOCKET_HANDLE Socket)
XN_C_API XnStatus XN_C_DECL | xnOSAcceptSocket (XN_SOCKET_HANDLE ListenSocket, XN_SOCKET_HANDLE *AcceptSocketPtr, XnUInt32 nMillisecsTimeout)
XN_C_API XnStatus XN_C_DECL | xnOSConnectSocket (XN_SOCKET_HANDLE Socket, XnUInt32 nMillisecsTimeout)
XN_C_API XnStatus XN_C_DECL | xnOSSetSocketBufferSize (XN_SOCKET_HANDLE Socket, const XnUInt32 nSocketBufferSize)
XN_C_API XnStatus XN_C_DECL | xnOSSendNetworkBuffer (XN_SOCKET_HANDLE Socket, const XnChar *cpBuffer, const XnUInt32 nBufferSize)
XN_C_API XnStatus XN_C_DECL | xnOSSendToNetworkBuffer (XN_SOCKET_HANDLE Socket, const XnChar *cpBuffer, const XnUInt32 nBufferSize, XN_SOCKET_HANDLE SocketTo)
XN_C_API XnStatus XN_C_DECL | xnOSReceiveNetworkBuffer (XN_SOCKET_HANDLE Socket, XnChar *cpBuffer, XnUInt32 *pnBufferSize, XnUInt32 nMillisecsTimeout)
XN_C_API XnStatus XN_C_DECL | xnOSReceiveFromNetworkBuffer (XN_SOCKET_HANDLE Socket, XnChar *cpBuffer, XnUInt32 *pnBufferSize, XN_SOCKET_HANDLE *SocketFrom)
XN_C_API XnStatus XN_C_DECL | xnOSCreateSharedMemory (const XnChar *strName, XnUInt32 nSize, XnUInt32 nAccessFlags, XN_SHARED_MEMORY_HANDLE *phSharedMem)
XN_C_API XnStatus XN_C_DECL | xnOSCreateSharedMemoryEx (const XnChar *strName, XnUInt32 nSize, XnUInt32 nAccessFlags, XnBool bAllowOtherUsers, XN_SHARED_MEMORY_HANDLE *phSharedMem)
XN_C_API XnStatus XN_C_DECL | xnOSOpenSharedMemory (const XnChar *strName, XnUInt32 nAccessFlags, XN_SHARED_MEMORY_HANDLE *phSharedMem)
XN_C_API XnStatus XN_C_DECL | xnOSOpenSharedMemoryEx (const XnChar *strName, XnUInt32 nAccessFlags, XnBool bAllowOtherUsers, XN_SHARED_MEMORY_HANDLE *phSharedMem)
XN_C_API XnStatus XN_C_DECL | xnOSCloseSharedMemory (XN_SHARED_MEMORY_HANDLE hSharedMem)
XN_C_API XnStatus XN_C_DECL | xnOSSharedMemoryGetAddress (XN_SHARED_MEMORY_HANDLE hSharedMem, void **ppAddress)
XN_C_API XnBool XN_C_DECL | xnOSWasKeyboardHit ()
XN_C_API XnChar XN_C_DECL | xnOSReadCharFromInput ()
XN_C_API XnStatus XN_C_DECL | xnOSGetCurrentCallStack (XnUInt32 nFramesToSkip, XnChar **astrFrames, XnUInt32 nMaxNameLength, XnUInt32 *pnFrames)

## Variables

XnOSTimer | g_xnOSHighResGlobalTimer

## Macro Definition Documentation

## XN_ALIGNED_FREE_AND_NULL

#define XN_ALIGNED_FREE_AND_NULL | ( |  | x | ) |

Value:
if (x != NULL) \
{ \
xnOSFreeAligned(x); \
x = NULL; \
}

Validate that the aligned memory free request succeeded and set X to NULL.

## XN_DELETE

#define XN_DELETE | ( |  | p | ) |

Value:
delete (p)

## XN_DELETE_ARR

#define XN_DELETE_ARR | ( |  | p | ) |

Value:
delete[] (p)

## XN_FREE_AND_NULL

#define XN_FREE_AND_NULL | ( |  | x | ) |

Value:
if (x != NULL) \
{ \
xnOSFree(x); \
x = NULL; \
}

Validate that the memory free request succeeded and set X to NULL.

## XN_MASK_OS

#define XN_MASK_OS "xnOS"

## XN_MAX_OS_NAME_LENGTH

#define XN_MAX_OS_NAME_LENGTH 255

## XN_NEW

#define XN_NEW | ( |  | type,
|  |  | ... )

Value:
new type(__VA_ARGS__)

## XN_NEW_ARR

#define XN_NEW_ARR | ( |  | type,
|  |  | count )

Value:
new type[count]

## XN_OS_FILE_APPEND

#define XN_OS_FILE_APPEND 0x10

File be opened in append mode

## XN_OS_FILE_AUTO_FLUSH

#define XN_OS_FILE_AUTO_FLUSH 0x20

All writes will be immediately written to disk

## XN_OS_FILE_CREATE_NEW_ONLY

#define XN_OS_FILE_CREATE_NEW_ONLY 0x04

Create a new file (but only if it doesn't exist).

## XN_OS_FILE_READ

#define XN_OS_FILE_READ 0x01

Open the file for reading.

## XN_OS_FILE_TRUNCATE

#define XN_OS_FILE_TRUNCATE 0x08

Truncate the file if it already exists.

## XN_OS_FILE_WRITE

#define XN_OS_FILE_WRITE 0x02

Open the file for writing.

## XN_OS_NETWORK_LOCAL_HOST

#define XN_OS_NETWORK_LOCAL_HOST "127.0.0.1"

## XN_SOCKET_DEFAULT_TIMEOUT

#define XN_SOCKET_DEFAULT_TIMEOUT 0xFFFEFFFE

## XN_VALIDATE_ALIGNED_ALLOC

#define XN_VALIDATE_ALIGNED_ALLOC | ( |  | x,
|  |  | y,
|  |  | w )

Value:
x = (y*)xnOSMallocAligned(sizeof(y), w); \
XN_VALIDATE_ALLOC_PTR(x);
xnOSMallocAligned
XN_C_API void *XN_C_DECL xnOSMallocAligned(const XnSizeT nAllocSize, const XnSizeT nAlignment)

Allocate Y aligned bytes into the X pointer and make sure NULL wasn't returned.

## XN_VALIDATE_ALIGNED_CALLOC

#define XN_VALIDATE_ALIGNED_CALLOC | ( |  | x,
|  |  | y,
|  |  | z,
|  |  | w )

Value:
x = (y*)xnOSCallocAligned(z, sizeof(y), w); \
XN_VALIDATE_ALLOC_PTR(x);
xnOSCallocAligned
XN_C_API void *XN_C_DECL xnOSCallocAligned(const XnSizeT nAllocNum, const XnSizeT nAllocSize, const XnSizeT nAlignment)

Allocate Z aligned elements of Y type into the X pointer and make sure NULL wasn't returned.

## XN_VALIDATE_ALLOC

#define XN_VALIDATE_ALLOC | ( |  | x,
|  |  | y )

Value:
x = (y*)xnOSMalloc(sizeof(y)); \
XN_VALIDATE_ALLOC_PTR(x);
xnOSMalloc
XN_C_API void *XN_C_DECL xnOSMalloc(const XnSizeT nAllocSize)

Allocate Y bytes into the X pointer and make sure NULL wasn't returned.

## XN_VALIDATE_ALLOC_PTR

#define XN_VALIDATE_ALLOC_PTR | ( |  | x | ) |

Value:
XN_VALIDATE_PTR(x, XN_STATUS_ALLOC_FAILED)
XN_VALIDATE_PTR
#define XN_VALIDATE_PTR(x, y)
Definition XnMacros.h:98

Validate that a X pointer after a memory allocation call is not NULL.

## XN_VALIDATE_CALLOC

#define XN_VALIDATE_CALLOC | ( |  | x,
|  |  | y,
|  |  | z )

Value:
x = (y*)xnOSCalloc(z, sizeof(y)); \
XN_VALIDATE_ALLOC_PTR(x);
xnOSCalloc
XN_C_API void *XN_C_DECL xnOSCalloc(const XnSizeT nAllocNum, const XnSizeT nAllocSize)

Allocate Z elements of Y type into the X pointer and make sure NULL wasn't returned.

## XN_VALIDATE_FILE_EXISTS

#define XN_VALIDATE_FILE_EXISTS | ( |  | x,
|  |  | y,
|  |  | z )

Value:
XN_VALIDATE_FILE_EXISTS_RET(x,y,z,XN_STATUS_OS_FILE_NOT_FOUND)
XN_VALIDATE_FILE_EXISTS_RET
#define XN_VALIDATE_FILE_EXISTS_RET(x, y, z, w)
Definition XnOS.h:306

## XN_VALIDATE_FILE_EXISTS_RET

#define XN_VALIDATE_FILE_EXISTS_RET | ( |  | x,
|  |  | y,
|  |  | z,
|  |  | w )

Value:
y = xnOSDoesFileExist(x, &z); \
XN_IS_STATUS_OK(y); \
if (z == FALSE) \
{ \
return (w); \
}
xnOSDoesFileExist
XN_C_API XnStatus XN_C_DECL xnOSDoesFileExist(const XnChar *cpFileName, XnBool *pbResult)
FALSE
#define FALSE
Definition XnPlatform.h:100

Returns XN_STATUS_OS_FILE_NOT_FOUND if the file x doesn't exists.

## XN_VALIDATE_INPUT_PTR

#define XN_VALIDATE_INPUT_PTR | ( |  | x | ) |

Value:
XN_VALIDATE_PTR(x, XN_STATUS_NULL_INPUT_PTR)

Validate that the input pointer X is not NULL.

## XN_VALIDATE_LOCK_MUTEX

#define XN_VALIDATE_LOCK_MUTEX | ( |  | x,
|  |  | y,
|  |  | z )

Value:
z = xnOSLockMutex(x, y); \
XN_IS_STATUS_OK(z);
xnOSLockMutex
XN_C_API XnStatus XN_C_DECL xnOSLockMutex(const XN_MUTEX_HANDLE MutexHandle, XnUInt32 nMilliseconds)

Lock the mutex x for a y period of time and check the status via z.

## XN_VALIDATE_NEW

#define XN_VALIDATE_NEW | ( |  | ptr,
|  |  | type,
|  |  | ... )

Value:
{ \
(ptr) = XN_NEW(type, __VA_ARGS__); \
if ((ptr) == NULL) \
{ \
return (XN_STATUS_ALLOC_FAILED); \
} \
}
XN_NEW
#define XN_NEW(type,...)
Definition XnOS.h:326

Creates a new type object and validates that allocation succeeded.

## XN_VALIDATE_NEW_AND_INIT

#define XN_VALIDATE_NEW_AND_INIT | ( |  | ptr,
|  |  | type,
|  |  | ... )

Value:
{ \
XN_VALIDATE_NEW(ptr, type, __VA_ARGS__); \
XnStatus rc = (ptr)->Init(); \
if (rc != XN_STATUS_OK) \
{ \
XN_DELETE(ptr); \
return (rc); \
} \
}
XnStatus
XnUInt32 XnStatus
Definition XnStatus.h:34
XN_STATUS_OK
#define XN_STATUS_OK
Definition XnStatus.h:37

Creates a new type object, validates that allocation succeeded, and initializes the object (type must have an Init function).

## XN_VALIDATE_OUTPUT_PTR

#define XN_VALIDATE_OUTPUT_PTR | ( |  | x | ) |

Value:
XN_VALIDATE_PTR(x, XN_STATUS_NULL_OUTPUT_PTR)

Validate that the output pointer X is not NULL.

## XN_VALIDATE_READ_INI_DOUBLE

#define XN_VALIDATE_READ_INI_DOUBLE | ( |  | v,
|  |  | w,
|  |  | x,
|  |  | y,
|  |  | z )

Value:
z = xnOSReadDoubleFromINI(v, w, x, y); \
XN_IS_STATUS_OK(z);
xnOSReadDoubleFromINI
XN_C_API XnStatus XN_C_DECL xnOSReadDoubleFromINI(const XnChar *cpINIFile, const XnChar *cpSection, const XnChar *cpKey, XnDouble *fDest)

Read a double from the INI file and check the status via z.

## XN_VALIDATE_READ_INI_FLOAT

#define XN_VALIDATE_READ_INI_FLOAT | ( |  | v,
|  |  | w,
|  |  | x,
|  |  | y,
|  |  | z )

Value:
z = xnOSReadFloatFromINI(v, w, x, y); \
XN_IS_STATUS_OK(z);
xnOSReadFloatFromINI
XN_C_API XnStatus XN_C_DECL xnOSReadFloatFromINI(const XnChar *cpINIFile, const XnChar *cpSection, const XnChar *cpKey, XnFloat *fDest)

Read a float from the INI file and check the status via z.

## XN_VALIDATE_READ_INI_INT

#define XN_VALIDATE_READ_INI_INT | ( |  | v,
|  |  | w,
|  |  | x,
|  |  | y,
|  |  | z )

Value:
z = xnOSReadIntFromINI(v, w, x, y); \
XN_IS_STATUS_OK(z);
xnOSReadIntFromINI
XN_C_API XnStatus XN_C_DECL xnOSReadIntFromINI(const XnChar *cpINIFile, const XnChar *cpSection, const XnChar *cpKey, XnUInt32 *nDest)

Read an int from the INI file and check the status via z.

## XN_VALIDATE_READ_INI_STR

#define XN_VALIDATE_READ_INI_STR | ( |  | u,
|  |  | v,
|  |  | w,
|  |  | x,
|  |  | y,
|  |  | z )

Value:
z = xnOSReadStringFromINI(u, v, w, x, y); \
XN_IS_STATUS_OK(z);
xnOSReadStringFromINI
XN_C_API XnStatus XN_C_DECL xnOSReadStringFromINI(const XnChar *cpINIFile, const XnChar *cpSection, const XnChar *cpKey, XnChar *cpDest, const XnUInt32 nDestLength)

Read a string from the INI file and check the status via z.

## XN_VALIDATE_STR_APPEND

#define XN_VALIDATE_STR_APPEND | ( |  | w,
|  |  | x,
|  |  | y,
|  |  | z )

Value:
z = xnOSStrAppend(w, x, y); \
XN_IS_STATUS_OK(z);
xnOSStrAppend
XN_C_API XnStatus XN_C_DECL xnOSStrAppend(XnChar *cpDestString, const XnChar *cpSrcString, const XnUInt32 nDestLength)

Append x into y (with z as the max size) and check the status via z.

## XN_VALIDATE_STR_COPY

#define XN_VALIDATE_STR_COPY | ( |  | w,
|  |  | x,
|  |  | y,
|  |  | z )

Value:
z = xnOSStrCopy(w, x, y); \
XN_IS_STATUS_OK(z);
xnOSStrCopy
XN_C_API XnStatus XN_C_DECL xnOSStrCopy(XnChar *cpDestString, const XnChar *cpSrcString, const XnUInt32 nDestLength)

## XN_VALIDATE_STR_PREFIX

#define XN_VALIDATE_STR_PREFIX | ( |  | w,
|  |  | x,
|  |  | y,
|  |  | z )

Value:
z = xnOSStrPrefix(w, x, y); \
XN_IS_STATUS_OK(z);
xnOSStrPrefix
XN_C_API XnStatus XN_C_DECL xnOSStrPrefix(const XnChar *cpPrefixString, XnChar *cpDestString, const XnUInt32 nDestLength)

Prefix x into y (with z as the max size) and check the status via z.

## XN_VALIDATE_STRN_COPY

#define XN_VALIDATE_STRN_COPY | ( |  | v,
|  |  | w,
|  |  | x,
|  |  | y,
|  |  | z )

Value:
z = xnOSStrNCopy(v, w, x, y); \
XN_IS_STATUS_OK(z);
xnOSStrNCopy
XN_C_API XnStatus XN_C_DECL xnOSStrNCopy(XnChar *cpDestString, const XnChar *cpSrcString, const XnUInt32 nCopyLength, const XnUInt32 nDestLength)

## XN_VALIDATE_UNLOCK_MUTEX

#define XN_VALIDATE_UNLOCK_MUTEX | ( |  | x,
|  |  | z )

Value:
z = xnOSUnLockMutex(x); \
XN_IS_STATUS_OK(z);
xnOSUnLockMutex
XN_C_API XnStatus XN_C_DECL xnOSUnLockMutex(const XN_MUTEX_HANDLE MutexHandle)

UnLock the mutex x and check the status via z.

## Typedef Documentation

## XN_SHARED_MEMORY_HANDLE

typedef struct XnOSSharedMemory * XN_SHARED_MEMORY_HANDLE

## XN_SOCKET_HANDLE

typedef struct xnOSSocket* XN_SOCKET_HANDLE

## XnConditionFunc

typedef XnBool(* XnConditionFunc) (void *pConditionData)

## xnOSInfo

typedef struct xnOSInfo xnOSInfo

## XnOSSharedMemory

typedef struct XnOSSharedMemory XnOSSharedMemory

## XnThreadPriority

typedef enum XnThreadPriority XnThreadPriority

## Enumeration Type Documentation

## XnAllocationType

enum XnAllocationType

Enumerator
XN_ALLOCATION_MALLOC |
XN_ALLOCATION_MALLOC_ALIGNED |
XN_ALLOCATION_CALLOC |
XN_ALLOCATION_CALLOC_ALIGNED |
XN_ALLOCATION_NEW |
XN_ALLOCATION_NEW_ARRAY |

## XnOSSeekType

enum XnOSSeekType

The seek type enum list.

Enumerator
XN_OS_SEEK_SET | Absolute seek from the file beginning.
XN_OS_SEEK_CUR | Relative seek from the current location.
XN_OS_SEEK_END | Absolute seek from the file ending.

## XnOSSocketType

enum XnOSSocketType

The network socket type.

Enumerator
XN_OS_UDP_SOCKET | UDP socket.
XN_OS_TCP_SOCKET | TCP socket.

## XnThreadPriority

enum XnThreadPriority

Enumerator
XN_PRIORITY_LOW |
XN_PRIORITY_NORMAL |
XN_PRIORITY_HIGH |
XN_PRIORITY_CRITICAL |

## Function Documentation

## xnOSAcceptSocket()

XN_C_API XnStatus XN_C_DECL xnOSAcceptSocket | ( | XN_SOCKET_HANDLE | ListenSocket,
|  | XN_SOCKET_HANDLE * | AcceptSocketPtr,
|  | XnUInt32 | nMillisecsTimeout )

## xnOSAppendFile()

XN_C_API XnStatus XN_C_DECL xnOSAppendFile | ( | const XnChar * | cpFileName,
|  | const void * | pBuffer,
|  | const XnUInt32 | nBufferSize )

## xnOSBindSocket()

XN_C_API XnStatus XN_C_DECL xnOSBindSocket | ( | XN_SOCKET_HANDLE | Socket | ) |

## xnOSCloseCriticalSection()

XN_C_API XnStatus XN_C_DECL xnOSCloseCriticalSection | ( | XN_CRITICAL_SECTION_HANDLE * | pCriticalSectionHandle | ) |

## xnOSCloseEvent()

XN_C_API XnStatus XN_C_DECL xnOSCloseEvent | ( | XN_EVENT_HANDLE * | pEventHandle | ) |

## xnOSCloseFile()

XN_C_API XnStatus XN_C_DECL xnOSCloseFile | ( | XN_FILE_HANDLE * | pFile | ) |

## xnOSCloseMutex()

XN_C_API XnStatus XN_C_DECL xnOSCloseMutex | ( | XN_MUTEX_HANDLE * | pMutexHandle | ) |

## xnOSCloseSemaphore()

XN_C_API XnStatus XN_C_DECL xnOSCloseSemaphore | ( | XN_SEMAPHORE_HANDLE * | pSemaphoreHandle | ) |

## xnOSCloseSharedMemory()

XN_C_API XnStatus XN_C_DECL xnOSCloseSharedMemory | ( | XN_SHARED_MEMORY_HANDLE | hSharedMem | ) |

Closes a shared memory block.

Parameters

  hSharedMem | [in] A handle to the block to be closed.

## xnOSCloseSocket()

XN_C_API XnStatus XN_C_DECL xnOSCloseSocket | ( | XN_SOCKET_HANDLE | Socket | ) |

## xnOSCloseThread()

XN_C_API XnStatus XN_C_DECL xnOSCloseThread | ( | XN_THREAD_HANDLE * | pThreadHandle | ) |

## xnOSConnectSocket()

XN_C_API XnStatus XN_C_DECL xnOSConnectSocket | ( | XN_SOCKET_HANDLE | Socket,
|  | XnUInt32 | nMillisecsTimeout )

## xnOSCreateCriticalSection()

XN_C_API XnStatus XN_C_DECL xnOSCreateCriticalSection | ( | XN_CRITICAL_SECTION_HANDLE * | pCriticalSectionHandle | ) |

## xnOSCreateDirectory()

XN_C_API XnStatus XN_C_DECL xnOSCreateDirectory | ( | const XnChar * | cpDirName | ) |

## xnOSCreateEvent()

XN_C_API XnStatus XN_C_DECL xnOSCreateEvent | ( | XN_EVENT_HANDLE * | pEventHandle,
|  | XnBool | bManualReset )

## xnOSCreateMutex()

XN_C_API XnStatus XN_C_DECL xnOSCreateMutex | ( | XN_MUTEX_HANDLE * | pMutexHandle | ) |

## xnOSCreateNamedEvent()

XN_C_API XnStatus XN_C_DECL xnOSCreateNamedEvent | ( | XN_EVENT_HANDLE * | pEventHandle,
|  | const XnChar * | cpEventName,
|  | XnBool | bManualReset )

## xnOSCreateNamedEventEx()

XN_C_API XnStatus XN_C_DECL xnOSCreateNamedEventEx | ( | XN_EVENT_HANDLE * | pEventHandle,
|  | const XnChar * | cpEventName,
|  | XnBool | bManualReset,
|  | XnBool | bAllowOtherUsers )

## xnOSCreateNamedMutex()

XN_C_API XnStatus XN_C_DECL xnOSCreateNamedMutex | ( | XN_MUTEX_HANDLE * | pMutexHandle,
|  | const XnChar * | cpMutexName )

## xnOSCreateNamedMutexEx()

XN_C_API XnStatus XN_C_DECL xnOSCreateNamedMutexEx | ( | XN_MUTEX_HANDLE * | pMutexHandle,
|  | const XnChar * | cpMutexName,
|  | XnBool | bAllowOtherUsers )

## xnOSCreateProcess()

XN_C_API XnStatus XN_C_DECL xnOSCreateProcess | ( | const XnChar * | strExecutable,
|  | XnUInt32 | nArgs,
|  | const XnChar ** | pstrArgs,
|  | XN_PROCESS_ID * | pProcID )

## xnOSCreateSemaphore()

XN_C_API XnStatus XN_C_DECL xnOSCreateSemaphore | ( | XN_SEMAPHORE_HANDLE * | pSemaphoreHandle,
|  | XnUInt32 | nInitialCount )

## xnOSCreateSharedMemory()

XN_C_API XnStatus XN_C_DECL xnOSCreateSharedMemory | ( | const XnChar * | strName,
|  | XnUInt32 | nSize,
|  | XnUInt32 | nAccessFlags,
|  | XN_SHARED_MEMORY_HANDLE * | phSharedMem )

Creates a shared memory block and maps it to the process memory.

Parameters

  strName | [in] A machine-unique name that will be used by other processes to open this block.
  nSize | [in] The size of the buffer.
  nAccessFlags | [in] Creation flags. Can contain XN_OS_FILE_READ, XN_OS_FILE_WRITE or both.
  phSharedMem | [out] A handle to the shared-memory block.

## xnOSCreateSharedMemoryEx()

XN_C_API XnStatus XN_C_DECL xnOSCreateSharedMemoryEx | ( | const XnChar * | strName,
|  | XnUInt32 | nSize,
|  | XnUInt32 | nAccessFlags,
|  | XnBool | bAllowOtherUsers,
|  | XN_SHARED_MEMORY_HANDLE * | phSharedMem )

## xnOSCreateSocket()

XN_C_API XnStatus XN_C_DECL xnOSCreateSocket | ( | const XnOSSocketType | SocketType,
|  | const XnChar * | cpIPAddress,
|  | const XnUInt16 | nPort,
|  | XN_SOCKET_HANDLE * | SocketPtr )

## xnOSCreateThread()

XN_C_API XnStatus XN_C_DECL xnOSCreateThread | ( | XN_THREAD_PROC_PROTO | pThreadProc,
|  | const XN_THREAD_PARAM | pThreadParam,
|  | XN_THREAD_HANDLE * | pThreadHandle )

## xnOSDeleteDirectoryTree()

XN_C_API XnStatus XN_C_DECL xnOSDeleteDirectoryTree | ( | const XnChar * | strDirName | ) |

## xnOSDeleteEmptyDirectory()

XN_C_API XnStatus XN_C_DECL xnOSDeleteEmptyDirectory | ( | const XnChar * | strDirName | ) |

## xnOSDeleteFile()

XN_C_API XnStatus XN_C_DECL xnOSDeleteFile | ( | const XnChar * | cpFileName | ) |

## xnOSDoesDirecotyExist()

XN_C_API XnStatus XN_C_DECL xnOSDoesDirecotyExist | ( | const XnChar * | cpDirName,
|  | XnBool * | pbResult )

## xnOSDoesFileExist()

XN_C_API XnStatus XN_C_DECL xnOSDoesFileExist | ( | const XnChar * | cpFileName,
|  | XnBool * | pbResult )

## xnOSEnterCriticalSection()

XN_C_API XnStatus XN_C_DECL xnOSEnterCriticalSection | ( | XN_CRITICAL_SECTION_HANDLE * | pCriticalSectionHandle | ) |

## xnOSFlushFile()

XN_C_API XnStatus XN_C_DECL xnOSFlushFile | ( | const XN_FILE_HANDLE | File | ) |

## xnOSFreeLibrary()

XN_C_API XnStatus XN_C_DECL xnOSFreeLibrary | ( | const XN_LIB_HANDLE | LibHandle | ) |

## xnOSGetAbsTimeout()

XN_C_API XnStatus XN_C_DECL xnOSGetAbsTimeout | ( | struct timespec * | pTime,
|  | XnUInt32 | nMilliseconds )

## xnOSGetCurrentCallStack()

XN_C_API XnStatus XN_C_DECL xnOSGetCurrentCallStack | ( | XnUInt32 | nFramesToSkip,
|  | XnChar ** | astrFrames,
|  | XnUInt32 | nMaxNameLength,
|  | XnUInt32 * | pnFrames )

## xnOSGetCurrentDir()

XN_C_API XnStatus XN_C_DECL xnOSGetCurrentDir | ( | XnChar * | cpDirName,
|  | const XnUInt32 | nBufferSize )

## xnOSGetCurrentProcessID()

XN_C_API XnStatus XN_C_DECL xnOSGetCurrentProcessID | ( | XN_PROCESS_ID * | pProcID | ) |

## xnOSGetCurrentThreadID()

XN_C_API XnStatus XN_C_DECL xnOSGetCurrentThreadID | ( | XN_THREAD_ID * | pThreadID | ) |

## xnOSGetDirName()

XN_C_API XnStatus XN_C_DECL xnOSGetDirName | ( | const XnChar * | cpFilePath,
|  | XnChar * | cpDirName,
|  | const XnUInt32 | nBufferSize )

## xnOSGetEpochTime()

XN_C_API XnStatus XN_C_DECL xnOSGetEpochTime | ( | XnUInt32 * | nEpochTime | ) |

## xnOSGetFileList()

XN_C_API XnStatus XN_C_DECL xnOSGetFileList | ( | const XnChar * | cpSearchPattern,
|  | const XnChar * | cpPrefixPath,
|  | XnChar | cpFileList[][XN_FILE_MAX_PATH],
|  | const XnUInt32 | nMaxFiles,
|  | XnUInt32 * | pnFoundFiles )

## xnOSGetFileName()

XN_C_API XnStatus XN_C_DECL xnOSGetFileName | ( | const XnChar * | cpFilePath,
|  | XnChar * | cpFileName,
|  | const XnUInt32 | nBufferSize )

## xnOSGetFileSize()

XN_C_API XnStatus XN_C_DECL xnOSGetFileSize | ( | const XnChar * | cpFileName,
|  | XnUInt32 * | pnFileSize )

## xnOSGetFileSize64()

XN_C_API XnStatus XN_C_DECL xnOSGetFileSize64 | ( | const XnChar * | cpFileName,
|  | XnUInt64 * | pnFileSize )

## xnOSGetFullPathName()

XN_C_API XnStatus XN_C_DECL xnOSGetFullPathName | ( | const XnChar * | strFilePath,
|  | XnChar * | strFullPath,
|  | XnUInt32 | nBufferSize )

## xnOSGetHighResTimeStamp()

XN_C_API XnStatus XN_C_DECL xnOSGetHighResTimeStamp | ( | XnUInt64 * | nTimeStamp | ) |

## xnOSGetInfo()

XN_C_API XnStatus XN_C_DECL xnOSGetInfo | ( | xnOSInfo * | pOSInfo | ) |

## xnOSGetMonoTime()

XN_C_API XnStatus XN_C_DECL xnOSGetMonoTime | ( | struct timespec * | pTime | ) |

## xnOSGetProcAddress()

XN_C_API XnStatus XN_C_DECL xnOSGetProcAddress | ( | const XN_LIB_HANDLE | LibHandle,
|  | const XnChar * | cpProcName,
|  | XnFarProc * | pProcAddr )

## xnOSGetTimeout()

XN_C_API XnStatus XN_C_DECL xnOSGetTimeout | ( | struct timespec * | pTime,
|  | XnUInt32 | nMilliseconds )

## xnOSGetTimeStamp()

XN_C_API XnStatus XN_C_DECL xnOSGetTimeStamp | ( | XnUInt64 * | nTimeStamp | ) |

## xnOSInit()

XN_C_API XnStatus XN_C_DECL xnOSInit | ( |  | ) |

## xnOSInitNetwork()

XN_C_API XnStatus XN_C_DECL xnOSInitNetwork | ( |  | ) |

## xnOSIsEventSet()

XN_C_API XnBool XN_C_DECL xnOSIsEventSet | ( | const XN_EVENT_HANDLE | EventHandle | ) |

## xnOSLeaveCriticalSection()

XN_C_API XnStatus XN_C_DECL xnOSLeaveCriticalSection | ( | XN_CRITICAL_SECTION_HANDLE * | pCriticalSectionHandle | ) |

## xnOSListenSocket()

XN_C_API XnStatus XN_C_DECL xnOSListenSocket | ( | XN_SOCKET_HANDLE | Socket | ) |

## xnOSLoadFile()

XN_C_API XnStatus XN_C_DECL xnOSLoadFile | ( | const XnChar * | cpFileName,
|  | void * | pBuffer,
|  | const XnUInt32 | nBufferSize )

## xnOSLoadLibrary()

XN_C_API XnStatus XN_C_DECL xnOSLoadLibrary | ( | const XnChar * | cpFileName,
|  | XN_LIB_HANDLE * | pLibHandle )

## xnOSLockMutex()

XN_C_API XnStatus XN_C_DECL xnOSLockMutex | ( | const XN_MUTEX_HANDLE | MutexHandle,
|  | XnUInt32 | nMilliseconds )

## xnOSLockSemaphore()

XN_C_API XnStatus XN_C_DECL xnOSLockSemaphore | ( | XN_SEMAPHORE_HANDLE | hSemaphore,
|  | XnUInt32 | nMilliseconds )

## xnOSLogMemAlloc()

XN_C_API void *XN_C_DECL xnOSLogMemAlloc | ( | void * | pMemBlock,
|  | XnAllocationType | nAllocType,
|  | XnUInt32 | nBytes,
|  | const XnChar * | csFunction,
|  | const XnChar * | csFile,
|  | XnUInt32 | nLine,
|  | const XnChar * | csAdditional )

Memory Profiling - Logs an allocation of memory.

## xnOSLogMemFree()

XN_C_API void XN_C_DECL xnOSLogMemFree | ( | const void * | pMemBlock | ) |

Memory Profiling - Logs freeing of memory.

## xnOSOpenFile()

XN_C_API XnStatus XN_C_DECL xnOSOpenFile | ( | const XnChar * | cpFileName,
|  | const XnUInt32 | nFlags,
|  | XN_FILE_HANDLE * | pFile )

## xnOSOpenNamedEvent()

XN_C_API XnStatus XN_C_DECL xnOSOpenNamedEvent | ( | XN_EVENT_HANDLE * | pEventHandle,
|  | const XnChar * | cpEventName )

## xnOSOpenNamedEventEx()

XN_C_API XnStatus XN_C_DECL xnOSOpenNamedEventEx | ( | XN_EVENT_HANDLE * | pEventHandle,
|  | const XnChar * | cpEventName,
|  | XnBool | bAllowOtherUsers )

## xnOSOpenSharedMemory()

XN_C_API XnStatus XN_C_DECL xnOSOpenSharedMemory | ( | const XnChar * | strName,
|  | XnUInt32 | nAccessFlags,
|  | XN_SHARED_MEMORY_HANDLE * | phSharedMem )

Opens a shared memory block, and returns the address in which it was mapped to the process' memory.

Parameters

  strName | [in] A machine-unique name that will be used by other processes to open this block.
  nAccessFlags | [in] Creation flags. Must contain XN_OS_FILE_READ, and optionally XN_OS_FILE_WRITE.
  phSharedMem | [out] A handle to the shared-memory block.

## xnOSOpenSharedMemoryEx()

XN_C_API XnStatus XN_C_DECL xnOSOpenSharedMemoryEx | ( | const XnChar * | strName,
|  | XnUInt32 | nAccessFlags,
|  | XnBool | bAllowOtherUsers,
|  | XN_SHARED_MEMORY_HANDLE * | phSharedMem )

## xnOSQueryTimer()

XN_C_API XnStatus XN_C_DECL xnOSQueryTimer | ( | XnOSTimer | Timer,
|  | XnUInt64 * | pnTimeSinceStart )

## xnOSReadCharFromInput()

XN_C_API XnChar XN_C_DECL xnOSReadCharFromInput | ( |  | ) |

## xnOSReadDoubleFromINI()

XN_C_API XnStatus XN_C_DECL xnOSReadDoubleFromINI | ( | const XnChar * | cpINIFile,
|  | const XnChar * | cpSection,
|  | const XnChar * | cpKey,
|  | XnDouble * | fDest )

## xnOSReadFile()

XN_C_API XnStatus XN_C_DECL xnOSReadFile | ( | const XN_FILE_HANDLE | File,
|  | void * | pBuffer,
|  | XnUInt32 * | pnBufferSize )

## xnOSReadFloatFromINI()

XN_C_API XnStatus XN_C_DECL xnOSReadFloatFromINI | ( | const XnChar * | cpINIFile,
|  | const XnChar * | cpSection,
|  | const XnChar * | cpKey,
|  | XnFloat * | fDest )

## xnOSReadIntFromINI()

XN_C_API XnStatus XN_C_DECL xnOSReadIntFromINI | ( | const XnChar * | cpINIFile,
|  | const XnChar * | cpSection,
|  | const XnChar * | cpKey,
|  | XnUInt32 * | nDest )

## xnOSReadStringFromINI()

XN_C_API XnStatus XN_C_DECL xnOSReadStringFromINI | ( | const XnChar * | cpINIFile,
|  | const XnChar * | cpSection,
|  | const XnChar * | cpKey,
|  | XnChar * | cpDest,
|  | const XnUInt32 | nDestLength )

## xnOSReceiveFromNetworkBuffer()

XN_C_API XnStatus XN_C_DECL xnOSReceiveFromNetworkBuffer | ( | XN_SOCKET_HANDLE | Socket,
|  | XnChar * | cpBuffer,
|  | XnUInt32 * | pnBufferSize,
|  | XN_SOCKET_HANDLE * | SocketFrom )

## xnOSReceiveNetworkBuffer()

XN_C_API XnStatus XN_C_DECL xnOSReceiveNetworkBuffer | ( | XN_SOCKET_HANDLE | Socket,
|  | XnChar * | cpBuffer,
|  | XnUInt32 * | pnBufferSize,
|  | XnUInt32 | nMillisecsTimeout )

## xnOSResetEvent()

XN_C_API XnStatus XN_C_DECL xnOSResetEvent | ( | const XN_EVENT_HANDLE | EventHandle | ) |

## xnOSSaveFile()

XN_C_API XnStatus XN_C_DECL xnOSSaveFile | ( | const XnChar * | cpFileName,
|  | const void * | pBuffer,
|  | const XnUInt32 | nBufferSize )

## xnOSSeekFile()

XN_C_API XnStatus XN_C_DECL xnOSSeekFile | ( | const XN_FILE_HANDLE | File,
|  | const XnOSSeekType | SeekType,
|  | const XnInt32 | nOffset )

## xnOSSeekFile64()

XN_C_API XnStatus XN_C_DECL xnOSSeekFile64 | ( | const XN_FILE_HANDLE | File,
|  | const XnOSSeekType | SeekType,
|  | const XnInt64 | nOffset )

## xnOSSendNetworkBuffer()

XN_C_API XnStatus XN_C_DECL xnOSSendNetworkBuffer | ( | XN_SOCKET_HANDLE | Socket,
|  | const XnChar * | cpBuffer,
|  | const XnUInt32 | nBufferSize )

## xnOSSendToNetworkBuffer()

XN_C_API XnStatus XN_C_DECL xnOSSendToNetworkBuffer | ( | XN_SOCKET_HANDLE | Socket,
|  | const XnChar * | cpBuffer,
|  | const XnUInt32 | nBufferSize,
|  | XN_SOCKET_HANDLE | SocketTo )

## xnOSSetCurrentDir()

XN_C_API XnStatus XN_C_DECL xnOSSetCurrentDir | ( | const XnChar * | cpDirName | ) |

## xnOSSetEvent()

XN_C_API XnStatus XN_C_DECL xnOSSetEvent | ( | const XN_EVENT_HANDLE | EventHandle | ) |

## xnOSSetSocketBufferSize()

XN_C_API XnStatus XN_C_DECL xnOSSetSocketBufferSize | ( | XN_SOCKET_HANDLE | Socket,
|  | const XnUInt32 | nSocketBufferSize )

## xnOSSetThreadPriority()

XN_C_API XnStatus XN_C_DECL xnOSSetThreadPriority | ( | XN_THREAD_HANDLE | ThreadHandle,
|  | XnThreadPriority | nPriority )

## xnOSSharedMemoryGetAddress()

XN_C_API XnStatus XN_C_DECL xnOSSharedMemoryGetAddress | ( | XN_SHARED_MEMORY_HANDLE | hSharedMem,
|  | void ** | ppAddress )

Gets the address in which the shared-memory block is mapped in this process.

Parameters

  hSharedMem | [in] A handle to the shared memory block.
  ppAddress | [out] The address.

## xnOSShutdown()

XN_C_API XnStatus XN_C_DECL xnOSShutdown | ( |  | ) |

## xnOSShutdownNetwork()

XN_C_API XnStatus XN_C_DECL xnOSShutdownNetwork | ( |  | ) |

## xnOSSleep()

XN_C_API XnStatus XN_C_DECL xnOSSleep | ( | XnUInt32 | nMilliseconds | ) |

## xnOSStartHighResTimer()

XN_C_API XnStatus XN_C_DECL xnOSStartHighResTimer | ( | XnOSTimer * | pTimer | ) |

## xnOSStartTimer()

XN_C_API XnStatus XN_C_DECL xnOSStartTimer | ( | XnOSTimer * | pTimer | ) |

## xnOSStopTimer()

XN_C_API XnStatus XN_C_DECL xnOSStopTimer | ( | XnOSTimer * | pTimer | ) |

## xnOSTellFile()

XN_C_API XnStatus XN_C_DECL xnOSTellFile | ( | const XN_FILE_HANDLE | File,
|  | XnUInt32 * | nFilePos )

## xnOSTellFile64()

XN_C_API XnStatus XN_C_DECL xnOSTellFile64 | ( | const XN_FILE_HANDLE | File,
|  | XnUInt64 * | nFilePos )

## xnOSTerminateThread()

XN_C_API XnStatus XN_C_DECL xnOSTerminateThread | ( | XN_THREAD_HANDLE * | pThreadHandle | ) |

## xnOSUnLockMutex()

XN_C_API XnStatus XN_C_DECL xnOSUnLockMutex | ( | const XN_MUTEX_HANDLE | MutexHandle | ) |

## xnOSUnlockSemaphore()

XN_C_API XnStatus XN_C_DECL xnOSUnlockSemaphore | ( | XN_SEMAPHORE_HANDLE | hSemaphore | ) |

## xnOSWaitAndTerminateThread()

XN_C_API XnStatus XN_C_DECL xnOSWaitAndTerminateThread | ( | XN_THREAD_HANDLE * | pThreadHandle,
|  | XnUInt32 | nMilliseconds )

## xnOSWaitEvent()

XN_C_API XnStatus XN_C_DECL xnOSWaitEvent | ( | const XN_EVENT_HANDLE | EventHandle,
|  | XnUInt32 | nMilliseconds )

## xnOSWaitForCondition()

XN_C_API XnStatus XN_C_DECL xnOSWaitForCondition | ( | const XN_EVENT_HANDLE | EventHandle,
|  | XnUInt32 | nMilliseconds,
|  | XnConditionFunc | pConditionFunc,
|  | void * | pConditionData )

Waits for a condition to be met. The condition is evaluated every time an event is set.

Parameters

  EventHandle | [in] The Event handle.
  nMilliseconds | [in] A timeout in milliseconds to wait.
  pConditionFunc | [in] A function that should be called to evaluate condition.
  pConditionData | [in] A cookie to be passed to the condition functions.

## xnOSWaitForThreadExit()

XN_C_API XnStatus XN_C_DECL xnOSWaitForThreadExit | ( | XN_THREAD_HANDLE | ThreadHandle,
|  | XnUInt32 | nMilliseconds )

## xnOSWasKeyboardHit()

XN_C_API XnBool XN_C_DECL xnOSWasKeyboardHit | ( |  | ) |

## xnOSWriteDoubleToINI()

XN_C_API XnStatus XN_C_DECL xnOSWriteDoubleToINI | ( | const XnChar * | cpINIFile,
|  | const XnChar * | cpSection,
|  | const XnChar * | cpKey,
|  | const XnDouble | fSrc )

## xnOSWriteFile()

XN_C_API XnStatus XN_C_DECL xnOSWriteFile | ( | const XN_FILE_HANDLE | File,
|  | const void * | pBuffer,
|  | const XnUInt32 | nBufferSize )

## xnOSWriteFloatToINI()

XN_C_API XnStatus XN_C_DECL xnOSWriteFloatToINI | ( | const XnChar * | cpINIFile,
|  | const XnChar * | cpSection,
|  | const XnChar * | cpKey,
|  | const XnFloat | fSrc )

## xnOSWriteIntToINI()

XN_C_API XnStatus XN_C_DECL xnOSWriteIntToINI | ( | const XnChar * | cpINIFile,
|  | const XnChar * | cpSection,
|  | const XnChar * | cpKey,
|  | const XnUInt32 | nSrc )

## xnOSWriteMemoryReport()

XN_C_API void XN_C_DECL xnOSWriteMemoryReport | ( | const XnChar * | csFileName | ) |

Memory Profiling - Prints a current memory report to requested file.

## xnOSWriteStringToINI()

XN_C_API XnStatus XN_C_DECL xnOSWriteStringToINI | ( | const XnChar * | cpINIFile,
|  | const XnChar * | cpSection,
|  | const XnChar * | cpKey,
|  | const XnChar * | cpSrc )

## Variable Documentation

## g_xnOSHighResGlobalTimer

XnOSTimer g_xnOSHighResGlobalTimer

extern

The time since Xiron Core was initialized