00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00036 #ifndef OW_TYPES_HPP_INCLUDE_GUARD_
00037 #define OW_TYPES_HPP_INCLUDE_GUARD_
00038 #include "OW_config.h"
00039 
00040 #ifndef __cplusplus
00041 #error "OW_Types.hpp can only be included by c++ files"
00042 #endif
00043 
00044 extern "C"
00045 {
00046 #include <sys/types.h>
00047 }
00048 
00049 namespace OW_NAMESPACE
00050 {
00051 
00052 typedef unsigned char               UInt8;
00053 typedef signed char                 Int8;
00054 #if OW_SIZEOF_SHORT_INT == 2
00055 typedef unsigned short              UInt16;
00056 typedef short                 Int16;
00057 #define OW_INT16_IS_SHORT 1
00058 #elif OW_SIZEOF_INT == 2
00059 typedef unsigned int             UInt16;
00060 typedef int                      Int16;
00061 #define OW_INT16_IS_INT 1
00062 #endif
00063 #if OW_SIZEOF_INT == 4
00064 typedef unsigned int                UInt32;
00065 typedef int                   Int32;
00066 #define OW_INT32_IS_INT 1
00067 #elif OW_SIZEOF_LONG_INT == 4
00068 typedef unsigned long            UInt32;
00069 typedef long                     Int32;
00070 #define OW_INT32_IS_LONG 1
00071 #endif
00072 #if OW_SIZEOF_LONG_INT == 8
00073 typedef unsigned long   UInt64;
00074 typedef long    Int64;
00075 #define OW_INT64_IS_LONG 1
00076 #elif OW_SIZEOF_LONG_LONG_INT == 8
00077 typedef unsigned long long          UInt64;
00078 typedef long long             Int64;
00079 #define OW_INT64_IS_LONG_LONG 1
00080 #else
00081 #error "Compiler must support 64 bit long"
00082 #endif
00083 #if OW_SIZEOF_DOUBLE == 8
00084 typedef double                Real64;
00085 #define OW_REAL64_IS_DOUBLE 1
00086 #elif OW_SIZEOF_LONG_DOUBLE == 8
00087 typedef long double              Real64;
00088 #define OW_REAL64_IS_LONG_DOUBLE 1
00089 #endif
00090 #if OW_SIZEOF_FLOAT == 4
00091 typedef float                 Real32;
00092 #define OW_REAL32_IS_FLOAT 1
00093 #elif OW_SIZEOF_DOUBLE == 4
00094 typedef double                Real32;
00095 #define OW_REAL32_IS_DOUBLE 1
00096 #endif
00097 
00098 #ifdef OW_WIN32
00099 
00100 #define OW_SHAREDLIB_EXTENSION ".dll"
00101 #define OW_FILENAME_SEPARATOR "\\"
00102 #define OW_FILENAME_SEPARATOR_C '\\'
00103 #define OW_PATHNAME_SEPARATOR ";"
00104 
00105 
00106 struct Select_t
00107 {
00108    Select_t() 
00109       : event(NULL)
00110       , sockfd(INVALID_SOCKET)
00111       , networkevents(0)
00112       , doreset(false)
00113    {
00114    }
00115 
00116    Select_t(const Select_t& arg)
00117       : event(arg.event)
00118       , sockfd(arg.sockfd)
00119       , networkevents(arg.networkevents)
00120       , doreset(arg.doreset)
00121    {
00122    }
00123    
00124    HANDLE event;
00125    SOCKET sockfd;
00126    long networkevents;
00127    bool doreset;
00128 };
00129 
00130 
00131 #else
00132 
00133 
00134 
00135 
00136 typedef int Select_t;
00137 
00138 #if defined OW_DARWIN
00139 #define OW_SHAREDLIB_EXTENSION ".dylib.bundle"
00140 #elif defined OW_HPUX
00141 #define OW_SHAREDLIB_EXTENSION ".sl"
00142 #elif defined OW_NETWARE
00143 #define OW_SHAREDLIB_EXTENSION ".nlm"
00144 #else
00145 #define OW_SHAREDLIB_EXTENSION ".so"
00146 #endif
00147 #define OW_FILENAME_SEPARATOR "/"
00148 #define OW_FILENAME_SEPARATOR_C '/'
00149 #define OW_PATHNAME_SEPARATOR ":"
00150 #endif
00151 
00152 #ifdef OW_WIN32
00153 typedef HANDLE FileHandle;
00154 #define OW_INVALID_FILEHANDLE INVALID_HANDLE_VALUE
00155 typedef int UserId;
00156 typedef int uid_t;
00157 typedef DWORD pid_t;
00158 typedef DWORD ProcId;
00159 typedef struct {} siginfo_t;
00160 #else
00161 typedef int FileHandle;
00162 #define OW_INVALID_FILEHANDLE -1
00163 typedef uid_t UserId;
00164 typedef pid_t ProcId;
00165 #endif
00166 
00167 } 
00168 
00169 #endif