00001 /***************************************************************************** 00002 * * 00003 * OpenNI 1.0 Alpha * 00004 * Copyright (C) 2010 PrimeSense Ltd. * 00005 * * 00006 * This file is part of OpenNI. * 00007 * * 00008 * OpenNI is free software: you can redistribute it and/or modify * 00009 * it under the terms of the GNU Lesser General Public License as published * 00010 * by the Free Software Foundation, either version 3 of the License, or * 00011 * (at your option) any later version. * 00012 * * 00013 * OpenNI is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00016 * GNU Lesser General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU Lesser General Public License * 00019 * along with OpenNI. If not, see <http://www.gnu.org/licenses/>. * 00020 * * 00021 *****************************************************************************/ 00022 00023 00024 00025 00026 #ifndef _XN_OSLINUX_X86_H_ 00027 #define _XN_OSLINUX_X86_H_ 00028 00029 //--------------------------------------------------------------------------- 00030 // Includes 00031 //--------------------------------------------------------------------------- 00032 #include <sys/types.h> 00033 #include <stdarg.h> 00034 #include <time.h> 00035 #include <pthread.h> 00036 #include <sys/stat.h> 00037 #include <fcntl.h> 00038 00039 //--------------------------------------------------------------------------- 00040 // Files 00041 //--------------------------------------------------------------------------- 00043 typedef void* XN_HANDLE; 00044 00046 typedef XnInt XN_FILE_HANDLE; 00047 00048 static const XN_FILE_HANDLE XN_INVALID_FILE_HANDLE = -1; 00049 00051 #define XN_FILE_LOCAL_DIR "./" 00052 00054 #define XN_FILE_DIR_SEP "/" 00055 00057 #define XN_FILE_EXT_SEP "." 00058 00060 #define XN_FILE_ALL_WILDCARD "*" 00061 00063 #define XN_NEW_LINE_SEP "\n" 00064 00065 //--------------------------------------------------------------------------- 00066 // INI Files 00067 //--------------------------------------------------------------------------- 00069 #define XN_INI_FILE_EXT "ini" 00070 00072 // Note: This must always be big enough to contain a 32-bit number! 00073 #define XN_INI_MAX_LEN 256 00074 00075 //--------------------------------------------------------------------------- 00076 // Shared Libraries 00077 //--------------------------------------------------------------------------- 00079 typedef void* XN_LIB_HANDLE; 00080 00082 #define XN_SHARED_LIBRARY_PREFIX "lib" 00083 00085 #define XN_SHARED_LIBRARY_POSTFIX ".so" 00086 00087 //--------------------------------------------------------------------------- 00088 // Threads 00089 //--------------------------------------------------------------------------- 00091 typedef pthread_t* XN_THREAD_HANDLE; 00092 00094 typedef pthread_t XN_THREAD_ID; 00095 00097 typedef pid_t XN_PROCESS_ID; 00098 00100 typedef void* (*XN_THREAD_PROC_PROTO)(void* arg); 00101 00103 #define XN_THREAD_PROC void* 00104 00106 #define XN_THREAD_PROC_RETURN(ret) return((void*)ret) 00107 00109 typedef void* XN_THREAD_PARAM; 00110 00111 //--------------------------------------------------------------------------- 00112 // Time Outs 00113 //--------------------------------------------------------------------------- 00115 #define XN_WAIT_INFINITE 0xFFFFFFFF 00116 00117 //--------------------------------------------------------------------------- 00118 // Mutex 00119 //--------------------------------------------------------------------------- 00121 struct XnMutex; 00122 typedef XnMutex* XN_MUTEX_HANDLE; 00123 00124 //--------------------------------------------------------------------------- 00125 // Critical Sections 00126 //--------------------------------------------------------------------------- 00128 typedef XN_MUTEX_HANDLE XN_CRITICAL_SECTION_HANDLE; 00129 00130 //--------------------------------------------------------------------------- 00131 // Events 00132 //--------------------------------------------------------------------------- 00134 typedef struct 00135 { 00136 int NamedSem; 00137 pthread_cond_t cond; 00138 pthread_mutex_t mutex; 00139 XnBool bSignaled; 00140 XnBool bManualReset; 00141 XnBool bNamed; 00142 XnChar csSemFileName[XN_FILE_MAX_PATH]; 00143 int hSemFile; 00144 } _XnEvent, *XN_EVENT_HANDLE; 00145 00146 //--------------------------------------------------------------------------- 00147 // Timer 00148 //--------------------------------------------------------------------------- 00150 typedef struct XnOSTimer 00151 { 00152 struct timespec tStartTime; 00153 XnBool bHighRes; 00154 } XnOSTimer; 00155 00156 //--------------------------------------------------------------------------- 00157 // Network 00158 //--------------------------------------------------------------------------- 00160 #define XN_NETWORK_HOST_PORT_SEP ":" 00161 00162 //--------------------------------------------------------------------------- 00163 // Swaps 00164 //--------------------------------------------------------------------------- 00165 #define XN_PREPARE_VAR16_IN_BUFFER(var) (var) 00166 #define XN_PREPARE_VAR32_IN_BUFFER(var) (var) 00167 #define XN_PREPARE_VAR64_IN_BUFFER(var) (var) 00168 #define XN_PREPARE_VAR_FLOAT_IN_BUFFER(var) (var) 00169 00170 #endif //_XN_OSLINUX_X86_H_