Classes | Defines | Typedefs | Enumerations | Functions | Variables
XnOS.h File Reference
#include "XnPlatform.h"
#include "XnMacros.h"
#include "XnStatusCodes.h"
Include dependency graph for XnOS.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  xnOSInfo

Defines

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

Typedefs

typedef struct XnOSSharedMemoryXN_SHARED_MEMORY_HANDLE
typedef struct xnOSSocket * XN_SOCKET_HANDLE
typedef XnBool(XN_CALLBACK_TYPEXnConditionFunc )(void *pConditionData)
typedef struct xnOSInfo xnOSInfo
typedef struct XnOSSharedMemory XnOSSharedMemory
typedef enum XnThreadPriority XnThreadPriority

Enumerations

enum  XnAllocationType {
  XN_ALLOCATION_MALLOC, XN_ALLOCATION_MALLOC_ALIGNED, XN_ALLOCATION_CALLOC, XN_ALLOCATION_CALLOC_ALIGNED,
  XN_ALLOCATION_NEW, XN_ALLOCATION_NEW_ARRAY
}
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  XnThreadPriority { XN_PRIORITY_LOW, XN_PRIORITY_NORMAL, XN_PRIORITY_HIGH, XN_PRIORITY_CRITICAL }

Functions

XN_C_API XnStatus xnOSAcceptSocket (XN_SOCKET_HANDLE ListenSocket, XN_SOCKET_HANDLE *AcceptSocketPtr, XnUInt32 nMillisecsTimeout)
XN_C_API XnStatus xnOSAppendFile (const XnChar *cpFileName, const void *pBuffer, const XnUInt32 nBufferSize)
XN_C_API XnStatus xnOSBindSocket (XN_SOCKET_HANDLE Socket)
XN_C_API voidxnOSCalloc (const XnSizeT nAllocNum, const XnSizeT nAllocSize)
XN_C_API voidxnOSCallocAligned (const XnSizeT nAllocNum, const XnSizeT nAllocSize, const XnSizeT nAlignment)
XN_C_API XnStatus xnOSCloseCriticalSection (XN_CRITICAL_SECTION_HANDLE *pCriticalSectionHandle)
XN_C_API XnStatus xnOSCloseEvent (XN_EVENT_HANDLE *pEventHandle)
XN_C_API XnStatus xnOSCloseFile (XN_FILE_HANDLE *pFile)
XN_C_API XnStatus xnOSCloseMutex (XN_MUTEX_HANDLE *pMutexHandle)
XN_C_API XnStatus xnOSCloseSharedMemory (XN_SHARED_MEMORY_HANDLE hSharedMem)
XN_C_API XnStatus xnOSCloseSocket (XN_SOCKET_HANDLE Socket)
XN_C_API XnStatus xnOSCloseThread (XN_THREAD_HANDLE *pThreadHandle)
XN_C_API XnStatus xnOSConnectSocket (XN_SOCKET_HANDLE Socket, XnUInt32 nMillisecsTimeout)
XN_C_API XnStatus xnOSCreateCriticalSection (XN_CRITICAL_SECTION_HANDLE *pCriticalSectionHandle)
XN_C_API XnStatus xnOSCreateDirectory (const XnChar *cpDirName)
XN_C_API XnStatus xnOSCreateEvent (XN_EVENT_HANDLE *pEventHandle, XnBool bManualReset)
XN_C_API XnStatus xnOSCreateMutex (XN_MUTEX_HANDLE *pMutexHandle)
XN_C_API XnStatus xnOSCreateNamedEvent (XN_EVENT_HANDLE *pEventHandle, const XnChar *cpEventName, XnBool bManualReset)
XN_C_API XnStatus xnOSCreateNamedMutex (XN_MUTEX_HANDLE *pMutexHandle, const XnChar *cpMutexName)
XN_C_API XnStatus xnOSCreateProcess (const XnChar *strExecutable, XnUInt32 nArgs, const XnChar **pstrArgs, XN_PROCESS_ID *pProcID)
XN_C_API XnStatus xnOSCreateSharedMemory (const XnChar *strName, XnUInt32 nSize, XnUInt32 nAccessFlags, XN_SHARED_MEMORY_HANDLE *phSharedMem)
XN_C_API XnStatus xnOSCreateSocket (const XnOSSocketType SocketType, const XnChar *cpIPAddress, const XnUInt16 nPort, XN_SOCKET_HANDLE *SocketPtr)
XN_C_API XnStatus xnOSCreateThread (XN_THREAD_PROC_PROTO pThreadProc, const XN_THREAD_PARAM pThreadParam, XN_THREAD_HANDLE *pThreadHandle)
XN_C_API XnStatus xnOSDeleteFile (const XnChar *cpFileName)
XN_C_API XnStatus xnOSDoesDirecotyExist (const XnChar *cpDirName, XnBool *pbResult)
XN_C_API XnStatus xnOSDoesFileExist (const XnChar *cpFileName, XnBool *pbResult)
XN_C_API XnFloat xnOSEndianSwapFLOAT (XnFloat fValue)
XN_C_API XnUInt16 xnOSEndianSwapUINT16 (XnUInt16 nValue)
XN_C_API XnUInt32 xnOSEndianSwapUINT32 (XnUInt32 nValue)
XN_C_API XnUInt64 xnOSEndianSwapUINT64 (XnUInt64 nValue)
XN_C_API XnStatus xnOSEnterCriticalSection (XN_CRITICAL_SECTION_HANDLE *pCriticalSectionHandle)
XN_C_API XnStatus xnOSExpandEnvironmentStrings (const XnChar *strSrc, XnChar *strDest, XnUInt32 nDestSize)
XN_C_API XnStatus xnOSFlushFile (const XN_FILE_HANDLE File)
XN_C_API void xnOSFree (const void *pMemBlock)
XN_C_API void xnOSFreeAligned (const void *pMemBlock)
XN_C_API XnStatus xnOSFreeLibrary (const XN_LIB_HANDLE LibHandle)
XN_C_API XnStatus xnOSGetCurrentCallStack (XnUInt32 nFramesToSkip, XnChar **astrFrames, XnUInt32 nMaxNameLength, XnUInt32 *pnFrames)
XN_C_API XnStatus xnOSGetCurrentDir (XnChar *cpDirName, const XnUInt32 nBufferSize)
XN_C_API XnStatus xnOSGetCurrentProcessID (XN_PROCESS_ID *pProcID)
XN_C_API XnStatus xnOSGetCurrentThreadID (XN_THREAD_ID *pThreadID)
XN_C_API XnStatus xnOSGetDirName (const XnChar *cpFilePath, XnChar *cpDirName, const XnUInt32 nBufferSize)
XN_C_API XnStatus xnOSGetEpochTime (XnUInt32 *nEpochTime)
XN_C_API XnStatus xnOSGetFileList (const XnChar *cpSearchPattern, const XnChar *cpPrefixPath, XnChar cpFileList[][XN_FILE_MAX_PATH], const XnUInt32 nMaxFiles, XnUInt32 *pnFoundFiles)
XN_C_API XnStatus xnOSGetFileName (const XnChar *cpFilePath, XnChar *cpFileName, const XnUInt32 nBufferSize)
XN_C_API XnStatus xnOSGetFileSize (const XnChar *cpFileName, XnUInt32 *pnFileSize)
XN_C_API XnStatus xnOSGetFullPathName (const XnChar *strFilePath, XnChar *strFullPath, XnUInt32 nBufferSize)
XN_C_API XnStatus xnOSGetHighResTimeStamp (XnUInt64 *nTimeStamp)
XN_C_API XnStatus xnOSGetInfo (xnOSInfo *pOSInfo)
XN_C_API XnStatus xnOSGetProcAddress (const XN_LIB_HANDLE LibHandle, const XnChar *cpProcName, XnFarProc *pProcAddr)
XN_C_API XnStatus xnOSGetTimeStamp (XnUInt64 *nTimeStamp)
XN_C_API XnStatus xnOSInit ()
XN_C_API XnStatus xnOSInitNetwork ()
XN_C_API XnBool xnOSIsEventSet (const XN_EVENT_HANDLE EventHandle)
XN_C_API void xnOSItoA (XnInt32 nValue, XnChar *cpStr, XnInt32 nBase)
XN_C_API XnStatus xnOSLeaveCriticalSection (XN_CRITICAL_SECTION_HANDLE *pCriticalSectionHandle)
XN_C_API XnStatus xnOSListenSocket (XN_SOCKET_HANDLE Socket)
XN_C_API XnStatus xnOSLoadFile (const XnChar *cpFileName, void *pBuffer, const XnUInt32 nBufferSize)
XN_C_API XnStatus xnOSLoadLibrary (const XnChar *cpFileName, XN_LIB_HANDLE *pLibHandle)
XN_C_API XnStatus xnOSLockMutex (const XN_MUTEX_HANDLE MutexHandle, XnUInt32 nMilliseconds)
XN_C_API voidxnOSLogMemAlloc (void *pMemBlock, XnAllocationType nAllocType, XnUInt32 nBytes, const XnChar *csFunction, const XnChar *csFile, XnUInt32 nLine, const XnChar *csAdditional)
XN_C_API void xnOSLogMemFree (const void *pMemBlock)
XN_C_API voidxnOSMalloc (const XnSizeT nAllocSize)
XN_C_API voidxnOSMallocAligned (const XnSizeT nAllocSize, const XnSizeT nAlignment)
XN_C_API XnInt32 xnOSMemCmp (const void *pBuf1, const void *pBuf2, XnSizeT nCount)
XN_C_API void xnOSMemCopy (void *pDest, const void *pSource, XnSizeT nCount)
XN_C_API void xnOSMemMove (void *pDest, const void *pSource, XnSizeT nCount)
XN_C_API void xnOSMemSet (void *pDest, XnUInt8 nValue, XnSizeT nCount)
XN_C_API XnStatus xnOSOpenFile (const XnChar *cpFileName, const XnUInt32 nFlags, XN_FILE_HANDLE *pFile)
XN_C_API XnStatus xnOSOpenNamedEvent (XN_EVENT_HANDLE *pEventHandle, const XnChar *cpEventName)
XN_C_API XnStatus xnOSOpenSharedMemory (const XnChar *strName, XnUInt32 nAccessFlags, XN_SHARED_MEMORY_HANDLE *phSharedMem)
XN_C_API XnStatus xnOSQueryTimer (XnOSTimer Timer, XnUInt64 *pnTimeSinceStart)
XN_C_API XnChar xnOSReadCharFromInput ()
XN_C_API XnStatus xnOSReadDoubleFromINI (const XnChar *cpINIFile, const XnChar *cpSection, const XnChar *cpKey, XnDouble *fDest)
XN_C_API XnStatus xnOSReadFile (const XN_FILE_HANDLE File, void *pBuffer, XnUInt32 *pnBufferSize)
XN_C_API XnStatus xnOSReadFloatFromINI (const XnChar *cpINIFile, const XnChar *cpSection, const XnChar *cpKey, XnFloat *fDest)
XN_C_API XnStatus xnOSReadIntFromINI (const XnChar *cpINIFile, const XnChar *cpSection, const XnChar *cpKey, XnUInt32 *nDest)
XN_C_API XnStatus xnOSReadStringFromINI (const XnChar *cpINIFile, const XnChar *cpSection, const XnChar *cpKey, XnChar *cpDest, const XnUInt32 nDestLength)
XN_C_API voidxnOSRealloc (void *pMemory, const XnSizeT nAllocSize)
XN_C_API voidxnOSReallocAligned (void *pMemory, const XnSizeT nAllocSize, const XnSizeT nAlignment)
XN_C_API voidxnOSRecalloc (void *pMemory, const XnSizeT nAllocNum, const XnSizeT nAllocSize)
XN_C_API XnStatus xnOSReceiveFromNetworkBuffer (XN_SOCKET_HANDLE Socket, XnChar *cpBuffer, XnUInt32 *pnBufferSize, XN_SOCKET_HANDLE *SocketFrom)
XN_C_API XnStatus xnOSReceiveNetworkBuffer (XN_SOCKET_HANDLE Socket, XnChar *cpBuffer, XnUInt32 *pnBufferSize, XnUInt32 nMillisecsTimeout)
XN_C_API XnStatus xnOSResetEvent (const XN_EVENT_HANDLE EventHandle)
XN_C_API XnStatus xnOSSaveFile (const XnChar *cpFileName, const void *pBuffer, const XnUInt32 nBufferSize)
XN_C_API XnStatus xnOSSeekFile (const XN_FILE_HANDLE File, const XnOSSeekType SeekType, const XnInt32 nOffset)
XN_C_API XnStatus xnOSSendNetworkBuffer (XN_SOCKET_HANDLE Socket, const XnChar *cpBuffer, const XnUInt32 nBufferSize)
XN_C_API XnStatus xnOSSendToNetworkBuffer (XN_SOCKET_HANDLE Socket, const XnChar *cpBuffer, const XnUInt32 nBufferSize, XN_SOCKET_HANDLE SocketTo)
XN_C_API XnStatus xnOSSetCurrentDir (const XnChar *cpDirName)
XN_C_API XnStatus xnOSSetEvent (const XN_EVENT_HANDLE EventHandle)
XN_C_API XnStatus xnOSSetSocketBufferSize (XN_SOCKET_HANDLE Socket, const XnUInt32 nSocketBufferSize)
XN_C_API XnStatus xnOSSetThreadPriority (XN_THREAD_HANDLE ThreadHandle, XnThreadPriority nPriority)
XN_C_API XnStatus xnOSSharedMemoryGetAddress (XN_SHARED_MEMORY_HANDLE hSharedMem, void **ppAddress)
XN_C_API XnStatus xnOSShutdown ()
XN_C_API XnStatus xnOSShutdownNetwork ()
XN_C_API XnStatus xnOSSleep (XnUInt32 nMilliseconds)
XN_C_API XnStatus xnOSStartHighResTimer (XnOSTimer *pTimer)
XN_C_API XnStatus xnOSStartTimer (XnOSTimer *pTimer)
XN_C_API XnStatus xnOSStopTimer (XnOSTimer *pTimer)
XN_C_API XnStatus xnOSStrAppend (XnChar *cpDestString, const XnChar *cpSrcString, const XnUInt32 nDestLength)
XN_C_API XnInt32 xnOSStrCaseCmp (const XnChar *cpFirstString, const XnChar *cpSecondString)
XN_C_API XnInt32 xnOSStrCmp (const XnChar *cpFirstString, const XnChar *cpSecondString)
XN_C_API XnStatus xnOSStrCopy (XnChar *cpDestString, const XnChar *cpSrcString, const XnUInt32 nDestLength)
XN_C_API XnStatus xnOSStrCRC32 (const XnChar *cpString, XnUInt32 *nCRC32)
XN_C_API XnCharxnOSStrDup (const XnChar *strSource)
XN_C_API XnStatus xnOSStrFormat (XnChar *cpDestString, const XnUInt32 nDestLength, XnUInt32 *pnCharsWritten, const XnChar *cpFormat,...)
XN_C_API XnStatus xnOSStrFormatV (XnChar *cpDestString, const XnUInt32 nDestLength, XnUInt32 *pnCharsWritten, const XnChar *cpFormat, va_list args)
XN_C_API XnUInt32 xnOSStrLen (const XnChar *cpString)
XN_C_API XnStatus xnOSStrNCopy (XnChar *cpDestString, const XnChar *cpSrcString, const XnUInt32 nCopyLength, const XnUInt32 nDestLength)
XN_C_API XnStatus xnOSStrNCRC32 (XnUChar *cpBuffer, XnUInt32 nBufferSize, XnUInt32 *nCRC32)
XN_C_API XnStatus xnOSStrPrefix (const XnChar *cpPrefixString, XnChar *cpDestString, const XnUInt32 nDestLength)
XN_C_API XnStatus xnOSTellFile (const XN_FILE_HANDLE File, XnUInt32 *nFilePos)
XN_C_API XnStatus xnOSTerminateThread (XN_THREAD_HANDLE *pThreadHandle)
XN_C_API XnStatus xnOSUnLockMutex (const XN_MUTEX_HANDLE MutexHandle)
XN_C_API XnStatus xnOSWaitAndTerminateThread (XN_THREAD_HANDLE *pThreadHandle, XnUInt32 nMilliseconds)
XN_C_API XnStatus xnOSWaitEvent (const XN_EVENT_HANDLE EventHandle, XnUInt32 nMilliseconds)
XN_C_API XnStatus xnOSWaitForCondition (const XN_EVENT_HANDLE EventHandle, XnUInt32 nMilliseconds, XnConditionFunc pConditionFunc, void *pConditionData)
XN_C_API XnStatus xnOSWaitForThreadExit (XN_THREAD_HANDLE ThreadHandle, XnUInt32 nMilliseconds)
XN_C_API XnBool xnOSWasKeyboardHit ()
XN_C_API XnStatus xnOSWriteDoubleToINI (const XnChar *cpINIFile, const XnChar *cpSection, const XnChar *cpKey, const XnDouble fSrc)
XN_C_API XnStatus xnOSWriteFile (const XN_FILE_HANDLE File, const void *pBuffer, const XnUInt32 nBufferSize)
XN_C_API XnStatus xnOSWriteFloatToINI (const XnChar *cpINIFile, const XnChar *cpSection, const XnChar *cpKey, const XnFloat fSrc)
XN_C_API XnStatus xnOSWriteIntToINI (const XnChar *cpINIFile, const XnChar *cpSection, const XnChar *cpKey, const XnUInt32 nSrc)
XN_C_API void xnOSWriteMemoryReport (const XnChar *csFileName)
XN_C_API XnStatus xnOSWriteStringToINI (const XnChar *cpINIFile, const XnChar *cpSection, const XnChar *cpKey, const XnChar *cpSrc)

Variables

XnOSTimer g_xnOSHighResGlobalTimer

Define Documentation

#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.

Definition at line 156 of file XnOS.h.

#define XN_DELETE (   p)    delete (p)

Definition at line 350 of file XnOS.h.

#define XN_DELETE_ARR (   p)    delete[] (p)

Definition at line 351 of file XnOS.h.

#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.

Definition at line 149 of file XnOS.h.

#define XN_MASK_OS   "xnOS"

Definition at line 39 of file XnOS.h.

#define XN_MAX_OS_NAME_LENGTH   255

Definition at line 56 of file XnOS.h.

#define XN_NEW (   type,
  arg 
)    new type(arg)

Definition at line 346 of file XnOS.h.

#define XN_NEW_ARR (   type,
  count 
)    new type[count]

Definition at line 349 of file XnOS.h.

#define XN_OS_FILE_APPEND   0x10

File be opened in append mode

Definition at line 87 of file XnOS.h.

#define XN_OS_FILE_AUTO_FLUSH   0x20

All writes will be immediately written to disk

Definition at line 89 of file XnOS.h.

#define XN_OS_FILE_CREATE_NEW_ONLY   0x04

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

Definition at line 83 of file XnOS.h.

#define XN_OS_FILE_READ   0x01

Open the file for reading.

Definition at line 79 of file XnOS.h.

#define XN_OS_FILE_TRUNCATE   0x08

Truncate the file if it already exists.

Definition at line 85 of file XnOS.h.

#define XN_OS_FILE_WRITE   0x02

Open the file for writing.

Definition at line 81 of file XnOS.h.

#define XN_OS_NETWORK_LOCAL_HOST   "127.0.0.1"

Definition at line 114 of file XnOS.h.

#define XN_VALIDATE_ALIGNED_ALLOC (   x,
  y,
  w 
)
Value:
x = (y*)xnOSMallocAligned(sizeof(y), w);        \
                XN_VALIDATE_ALLOC_PTR(x);

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

Definition at line 139 of file XnOS.h.

#define XN_VALIDATE_ALIGNED_CALLOC (   x,
  y,
  z,
  w 
)
Value:
x = (y*)xnOSCallocAligned(z, sizeof(y), w);     \
                XN_VALIDATE_ALLOC_PTR(x);

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

Definition at line 144 of file XnOS.h.

#define XN_VALIDATE_ALLOC (   x,
  y 
)
Value:
x = (y*)xnOSMalloc(sizeof(y));  \
                XN_VALIDATE_ALLOC_PTR(x);

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

Definition at line 129 of file XnOS.h.

#define XN_VALIDATE_ALLOC_PTR (   x)    XN_VALIDATE_PTR(x, XN_STATUS_ALLOC_FAILED)

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

Definition at line 126 of file XnOS.h.

#define XN_VALIDATE_CALLOC (   x,
  y,
  z 
)
Value:
x = (y*)xnOSCalloc(z, sizeof(y));       \
                XN_VALIDATE_ALLOC_PTR(x);

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

Definition at line 134 of file XnOS.h.

#define XN_VALIDATE_FILE_EXISTS (   x,
  y,
  z 
)    XN_VALIDATE_FILE_EXISTS_RET(x,y,z,XN_STATUS_OS_FILE_NOT_FOUND)

Definition at line 309 of file XnOS.h.

#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);                                                     \
                }

Returns XN_STATUS_OS_FILE_NOT_FOUND if the file x doesn't exists.

Definition at line 302 of file XnOS.h.

#define XN_VALIDATE_INPUT_PTR (   x)    XN_VALIDATE_PTR(x, XN_STATUS_NULL_INPUT_PTR)

Validate that the input pointer X is not NULL.

Definition at line 121 of file XnOS.h.

#define XN_VALIDATE_LOCK_MUTEX (   x,
  y,
  z 
)
Value:
z = xnOSLockMutex(x, y);                \
                XN_IS_STATUS_OK(z);

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

Definition at line 291 of file XnOS.h.

#define XN_VALIDATE_NEW (   ptr,
  type 
)
Value:
do {                                                                                                    \
                        (ptr) = XN_NEW(type);                                                           \
                        if ((ptr) == NULL)                                                                      \
                        {                                                                                                       \
                                return (XN_STATUS_ALLOC_FAILED);                                \
                        }                                                                                                       \
                } while (0)

Creates a new type object and validates that allocation succeeded.

Definition at line 192 of file XnOS.h.

#define XN_VALIDATE_NEW_AND_INIT (   ptr,
  type 
)
Value:
do {                                                                                                    \
                        XN_VALIDATE_NEW(ptr, type);                                                     \
                        XnStatus rc = (ptr)->Init();                                            \
                        if (rc != XN_STATUS_OK)                                                         \
                        {                                                                                                       \
                                XN_DELETE(ptr);                                                                 \
                                return (rc);                                                                    \
                        }                                                                                                       \
                } while (0)

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

Definition at line 237 of file XnOS.h.

#define XN_VALIDATE_OUTPUT_PTR (   x)    XN_VALIDATE_PTR(x, XN_STATUS_NULL_OUTPUT_PTR)

Validate that the output pointer X is not NULL.

Definition at line 124 of file XnOS.h.

#define XN_VALIDATE_READ_INI_DOUBLE (   v,
  w,
  x,
  y,
  z 
)
Value:
z = xnOSReadDoubleFromINI(v, w, x, y);  \
                XN_IS_STATUS_OK(z);

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

Definition at line 285 of file XnOS.h.

#define XN_VALIDATE_READ_INI_FLOAT (   v,
  w,
  x,
  y,
  z 
)
Value:
z = xnOSReadFloatFromINI(v, w, x, y);   \
                XN_IS_STATUS_OK(z);

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

Definition at line 280 of file XnOS.h.

#define XN_VALIDATE_READ_INI_INT (   v,
  w,
  x,
  y,
  z 
)
Value:
z = xnOSReadIntFromINI(v, w, x, y);             \
                XN_IS_STATUS_OK(z);

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

Definition at line 275 of file XnOS.h.

#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);

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

Definition at line 270 of file XnOS.h.

#define XN_VALIDATE_STR_APPEND (   w,
  x,
  y,
  z 
)
Value:
z = xnOSStrAppend(w, x, y);                     \
        XN_IS_STATUS_OK(z);

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

Definition at line 251 of file XnOS.h.

#define XN_VALIDATE_STR_COPY (   w,
  x,
  y,
  z 
)
Value:
z = xnOSStrCopy(w, x, y);                       \
        XN_IS_STATUS_OK(z);

Definition at line 260 of file XnOS.h.

#define XN_VALIDATE_STR_PREFIX (   w,
  x,
  y,
  z 
)
Value:
z = xnOSStrPrefix(w, x, y);                     \
        XN_IS_STATUS_OK(z);

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

Definition at line 256 of file XnOS.h.

#define XN_VALIDATE_STRN_COPY (   v,
  w,
  x,
  y,
  z 
)
Value:
z = xnOSStrNCopy(v, w, x, y);                   \
        XN_IS_STATUS_OK(z);

Definition at line 264 of file XnOS.h.

#define XN_VALIDATE_UNLOCK_MUTEX (   x,
  z 
)
Value:
z = xnOSUnLockMutex(x);                 \
                XN_IS_STATUS_OK(z);

UnLock the mutex x and check the status via z.

Definition at line 296 of file XnOS.h.


Typedef Documentation

Definition at line 588 of file XnOS.h.

typedef struct xnOSSocket* XN_SOCKET_HANDLE

Definition at line 571 of file XnOS.h.

typedef XnBool(XN_CALLBACK_TYPE* XnConditionFunc)(void *pConditionData)

Definition at line 66 of file XnOS.h.

typedef struct xnOSInfo xnOSInfo

Definition at line 588 of file XnOS.h.


Enumeration Type Documentation

Enumerator:
XN_ALLOCATION_MALLOC 
XN_ALLOCATION_MALLOC_ALIGNED 
XN_ALLOCATION_CALLOC 
XN_ALLOCATION_CALLOC_ALIGNED 
XN_ALLOCATION_NEW 
XN_ALLOCATION_NEW_ARRAY 

Definition at line 353 of file XnOS.h.

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.

Definition at line 93 of file XnOS.h.

The network socket type.

Enumerator:
XN_OS_UDP_SOCKET 

UDP socket.

XN_OS_TCP_SOCKET 

TCP socket.

Definition at line 107 of file XnOS.h.

Enumerator:
XN_PRIORITY_LOW 
XN_PRIORITY_NORMAL 
XN_PRIORITY_HIGH 
XN_PRIORITY_CRITICAL 

Definition at line 516 of file XnOS.h.


Function Documentation

XN_C_API XnStatus xnOSAcceptSocket ( XN_SOCKET_HANDLE  ListenSocket,
XN_SOCKET_HANDLE AcceptSocketPtr,
XnUInt32  nMillisecsTimeout 
)
XN_C_API XnStatus xnOSAppendFile ( const XnChar cpFileName,
const void pBuffer,
const XnUInt32  nBufferSize 
)
XN_C_API void* xnOSCalloc ( const XnSizeT  nAllocNum,
const XnSizeT  nAllocSize 
)
XN_C_API void* xnOSCallocAligned ( const XnSizeT  nAllocNum,
const XnSizeT  nAllocSize,
const XnSizeT  nAlignment 
)

Closes a shared memory block.

Parameters:
hSharedMem[in] A handle to the block to be closed.
XN_C_API XnStatus xnOSConnectSocket ( XN_SOCKET_HANDLE  Socket,
XnUInt32  nMillisecsTimeout 
)
XN_C_API XnStatus xnOSCreateDirectory ( const XnChar cpDirName)
XN_C_API XnStatus xnOSCreateEvent ( XN_EVENT_HANDLE pEventHandle,
XnBool  bManualReset 
)
XN_C_API XnStatus xnOSCreateNamedEvent ( XN_EVENT_HANDLE pEventHandle,
const XnChar cpEventName,
XnBool  bManualReset 
)
XN_C_API XnStatus xnOSCreateNamedMutex ( XN_MUTEX_HANDLE pMutexHandle,
const XnChar cpMutexName 
)
XN_C_API XnStatus xnOSCreateProcess ( const XnChar strExecutable,
XnUInt32  nArgs,
const XnChar **  pstrArgs,
XN_PROCESS_ID pProcID 
)
XN_C_API XnStatus 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.
XN_C_API XnStatus xnOSCreateSocket ( const XnOSSocketType  SocketType,
const XnChar cpIPAddress,
const XnUInt16  nPort,
XN_SOCKET_HANDLE SocketPtr 
)
XN_C_API XnStatus xnOSCreateThread ( XN_THREAD_PROC_PROTO  pThreadProc,
const XN_THREAD_PARAM  pThreadParam,
XN_THREAD_HANDLE pThreadHandle 
)
XN_C_API XnStatus xnOSDeleteFile ( const XnChar cpFileName)
XN_C_API XnStatus xnOSDoesDirecotyExist ( const XnChar cpDirName,
XnBool pbResult 
)
XN_C_API XnStatus xnOSDoesFileExist ( const XnChar cpFileName,
XnBool pbResult 
)
XN_C_API XnStatus xnOSExpandEnvironmentStrings ( const XnChar strSrc,
XnChar strDest,
XnUInt32  nDestSize 
)
XN_C_API void xnOSFree ( const void pMemBlock)
XN_C_API void xnOSFreeAligned ( const void pMemBlock)
XN_C_API XnStatus xnOSGetCurrentCallStack ( XnUInt32  nFramesToSkip,
XnChar **  astrFrames,
XnUInt32  nMaxNameLength,
XnUInt32 pnFrames 
)
XN_C_API XnStatus xnOSGetCurrentDir ( XnChar cpDirName,
const XnUInt32  nBufferSize 
)
XN_C_API XnStatus xnOSGetDirName ( const XnChar cpFilePath,
XnChar cpDirName,
const XnUInt32  nBufferSize 
)
XN_C_API XnStatus xnOSGetFileList ( const XnChar cpSearchPattern,
const XnChar cpPrefixPath,
XnChar  cpFileList[][XN_FILE_MAX_PATH],
const XnUInt32  nMaxFiles,
XnUInt32 pnFoundFiles 
)
XN_C_API XnStatus xnOSGetFileName ( const XnChar cpFilePath,
XnChar cpFileName,
const XnUInt32  nBufferSize 
)
XN_C_API XnStatus xnOSGetFileSize ( const XnChar cpFileName,
XnUInt32 pnFileSize 
)
XN_C_API XnStatus xnOSGetFullPathName ( const XnChar strFilePath,
XnChar strFullPath,
XnUInt32  nBufferSize 
)
XN_C_API XnStatus xnOSGetProcAddress ( const XN_LIB_HANDLE  LibHandle,
const XnChar cpProcName,
XnFarProc pProcAddr 
)
XN_C_API void xnOSItoA ( XnInt32  nValue,
XnChar cpStr,
XnInt32  nBase 
)
XN_C_API XnStatus xnOSLoadFile ( const XnChar cpFileName,
void pBuffer,
const XnUInt32  nBufferSize 
)
XN_C_API XnStatus xnOSLoadLibrary ( const XnChar cpFileName,
XN_LIB_HANDLE pLibHandle 
)
XN_C_API XnStatus xnOSLockMutex ( const XN_MUTEX_HANDLE  MutexHandle,
XnUInt32  nMilliseconds 
)
XN_C_API void* 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.

XN_C_API void xnOSLogMemFree ( const void pMemBlock)

Memory Profiling - Logs freeing of memory.

XN_C_API void* xnOSMalloc ( const XnSizeT  nAllocSize)
XN_C_API void* xnOSMallocAligned ( const XnSizeT  nAllocSize,
const XnSizeT  nAlignment 
)
XN_C_API XnInt32 xnOSMemCmp ( const void pBuf1,
const void pBuf2,
XnSizeT  nCount 
)
XN_C_API void xnOSMemCopy ( void pDest,
const void pSource,
XnSizeT  nCount 
)
XN_C_API void xnOSMemMove ( void pDest,
const void pSource,
XnSizeT  nCount 
)
XN_C_API void xnOSMemSet ( void pDest,
XnUInt8  nValue,
XnSizeT  nCount 
)
XN_C_API XnStatus xnOSOpenFile ( const XnChar cpFileName,
const XnUInt32  nFlags,
XN_FILE_HANDLE pFile 
)
XN_C_API XnStatus xnOSOpenNamedEvent ( XN_EVENT_HANDLE pEventHandle,
const XnChar cpEventName 
)
XN_C_API XnStatus 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.
XN_C_API XnStatus xnOSQueryTimer ( XnOSTimer  Timer,
XnUInt64 pnTimeSinceStart 
)
XN_C_API XnStatus xnOSReadDoubleFromINI ( const XnChar cpINIFile,
const XnChar cpSection,
const XnChar cpKey,
XnDouble fDest 
)
XN_C_API XnStatus xnOSReadFile ( const XN_FILE_HANDLE  File,
void pBuffer,
XnUInt32 pnBufferSize 
)
XN_C_API XnStatus xnOSReadFloatFromINI ( const XnChar cpINIFile,
const XnChar cpSection,
const XnChar cpKey,
XnFloat fDest 
)
XN_C_API XnStatus xnOSReadIntFromINI ( const XnChar cpINIFile,
const XnChar cpSection,
const XnChar cpKey,
XnUInt32 nDest 
)
XN_C_API XnStatus xnOSReadStringFromINI ( const XnChar cpINIFile,
const XnChar cpSection,
const XnChar cpKey,
XnChar cpDest,
const XnUInt32  nDestLength 
)
XN_C_API void* xnOSRealloc ( void pMemory,
const XnSizeT  nAllocSize 
)
XN_C_API void* xnOSReallocAligned ( void pMemory,
const XnSizeT  nAllocSize,
const XnSizeT  nAlignment 
)
XN_C_API void* xnOSRecalloc ( void pMemory,
const XnSizeT  nAllocNum,
const XnSizeT  nAllocSize 
)
XN_C_API XnStatus xnOSReceiveFromNetworkBuffer ( XN_SOCKET_HANDLE  Socket,
XnChar cpBuffer,
XnUInt32 pnBufferSize,
XN_SOCKET_HANDLE SocketFrom 
)
XN_C_API XnStatus xnOSReceiveNetworkBuffer ( XN_SOCKET_HANDLE  Socket,
XnChar cpBuffer,
XnUInt32 pnBufferSize,
XnUInt32  nMillisecsTimeout 
)
XN_C_API XnStatus xnOSSaveFile ( const XnChar cpFileName,
const void pBuffer,
const XnUInt32  nBufferSize 
)
XN_C_API XnStatus xnOSSeekFile ( const XN_FILE_HANDLE  File,
const XnOSSeekType  SeekType,
const XnInt32  nOffset 
)
XN_C_API XnStatus xnOSSendNetworkBuffer ( XN_SOCKET_HANDLE  Socket,
const XnChar cpBuffer,
const XnUInt32  nBufferSize 
)
XN_C_API XnStatus xnOSSendToNetworkBuffer ( XN_SOCKET_HANDLE  Socket,
const XnChar cpBuffer,
const XnUInt32  nBufferSize,
XN_SOCKET_HANDLE  SocketTo 
)
XN_C_API XnStatus xnOSSetCurrentDir ( const XnChar cpDirName)
XN_C_API XnStatus xnOSSetSocketBufferSize ( XN_SOCKET_HANDLE  Socket,
const XnUInt32  nSocketBufferSize 
)

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.
XN_C_API XnStatus xnOSSleep ( XnUInt32  nMilliseconds)
XN_C_API XnStatus xnOSStrAppend ( XnChar cpDestString,
const XnChar cpSrcString,
const XnUInt32  nDestLength 
)
XN_C_API XnInt32 xnOSStrCaseCmp ( const XnChar cpFirstString,
const XnChar cpSecondString 
)
XN_C_API XnInt32 xnOSStrCmp ( const XnChar cpFirstString,
const XnChar cpSecondString 
)
XN_C_API XnStatus xnOSStrCopy ( XnChar cpDestString,
const XnChar cpSrcString,
const XnUInt32  nDestLength 
)
XN_C_API XnStatus xnOSStrCRC32 ( const XnChar cpString,
XnUInt32 nCRC32 
)
XN_C_API XnChar* xnOSStrDup ( const XnChar strSource)

Should be freed using xnOSFree()

XN_C_API XnStatus xnOSStrFormat ( XnChar cpDestString,
const XnUInt32  nDestLength,
XnUInt32 pnCharsWritten,
const XnChar cpFormat,
  ... 
)
XN_C_API XnStatus xnOSStrFormatV ( XnChar cpDestString,
const XnUInt32  nDestLength,
XnUInt32 pnCharsWritten,
const XnChar cpFormat,
va_list  args 
)
XN_C_API XnUInt32 xnOSStrLen ( const XnChar cpString)
XN_C_API XnStatus xnOSStrNCopy ( XnChar cpDestString,
const XnChar cpSrcString,
const XnUInt32  nCopyLength,
const XnUInt32  nDestLength 
)
XN_C_API XnStatus xnOSStrNCRC32 ( XnUChar cpBuffer,
XnUInt32  nBufferSize,
XnUInt32 nCRC32 
)
XN_C_API XnStatus xnOSStrPrefix ( const XnChar cpPrefixString,
XnChar cpDestString,
const XnUInt32  nDestLength 
)
XN_C_API XnStatus xnOSTellFile ( const XN_FILE_HANDLE  File,
XnUInt32 nFilePos 
)
XN_C_API XnStatus xnOSWaitAndTerminateThread ( XN_THREAD_HANDLE pThreadHandle,
XnUInt32  nMilliseconds 
)
XN_C_API XnStatus xnOSWaitEvent ( const XN_EVENT_HANDLE  EventHandle,
XnUInt32  nMilliseconds 
)
XN_C_API XnStatus 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.
XN_C_API XnStatus xnOSWaitForThreadExit ( XN_THREAD_HANDLE  ThreadHandle,
XnUInt32  nMilliseconds 
)
XN_C_API XnStatus xnOSWriteDoubleToINI ( const XnChar cpINIFile,
const XnChar cpSection,
const XnChar cpKey,
const XnDouble  fSrc 
)
XN_C_API XnStatus xnOSWriteFile ( const XN_FILE_HANDLE  File,
const void pBuffer,
const XnUInt32  nBufferSize 
)
XN_C_API XnStatus xnOSWriteFloatToINI ( const XnChar cpINIFile,
const XnChar cpSection,
const XnChar cpKey,
const XnFloat  fSrc 
)
XN_C_API XnStatus xnOSWriteIntToINI ( const XnChar cpINIFile,
const XnChar cpSection,
const XnChar cpKey,
const XnUInt32  nSrc 
)
XN_C_API void xnOSWriteMemoryReport ( const XnChar csFileName)

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

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

Variable Documentation

The time since Xiron Core was initialized



nao_openni
Author(s): Bener SUAY
autogenerated on Mon Jan 6 2014 11:27:51