Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

os_spec.h

Go to the documentation of this file.
00001 #ifndef __OSSPEC_H
00002 #define __OSSPEC_H
00003 
00004 /* common */
00005 
00006 /* ************ */
00007 /* Windows defs */
00008 /* ************ */
00009 #if defined WIN32 /* might also have to check for #define MSC_VER */
00010 
00011 /* constants */
00012 #define OS_SPEC_O_RDONLY _O_RDONLY
00013 #define OS_SPEC_INVALID_SOCKET INVALID_SOCKET
00014 #define OS_SPEC_SOCKET_ERROR SOCKET_ERROR
00015 
00016 /* types */
00017 #define OS_SPEC_SOCKLEN int FAR
00018 #define OS_SPEC_SOCKET_TYPE SOCKET
00019 #define OS_SPEC_STAT _stat
00020 #define OS_SPEC_ENUM static enum
00021 
00022 /* functions */
00023 #define OS_SPEC_SOCKETCLOSE closesocket
00024 #define OS_SPEC_FSTAT _fstat
00025 #define OS_SPEC_CLOSE _close
00026 #define OS_SPEC_OPEN _open
00027 #define OS_SPEC_FD_SET(arg1, arg2) FD_SET((unsigned int)arg1, arg2)
00028 #define OS_SPEC_FD_ISSET(arg1, arg2) FD_ISSET((unsigned int)arg1, arg2)
00029 #define OS_SPEC_FD_CLR(arg1, arg2) FD_CLR((unsigned int)arg1, arg2)
00030 #define OS_SPEC_SLEEP Sleep
00031 #define OS_SPEC_MKDIR(dirname, access) _mkdir ("dirname")
00032 #define OS_SPEC_RMDIR(dirname) _rmdir ("dirname")
00033 #define S_ISDIR(mode) 1
00034 int initSockets();
00035 #define OS_SPEC_GETTIME(currentTime) gettimeofday(&currentTime, NULL);
00036 #define OS_SPEC_STRICMP _stricmp
00037 #define OS_SPEC_STRNICMP _strnicmp
00038 #define OS_SPEC_VSNPRINTF _vsnprintf
00039 #define OS_SPEC_SNPRINTF _snprintf
00040 
00041 #endif /* WINDOWS */
00042 
00043 
00044 /* ********** */
00045 /* LINUX defs */
00046 /* ********** */
00047 #ifdef LINUX
00048 
00049 #ifndef UINT_MAX
00050 #define UINT_MAX        0x7fffffff
00051 #endif
00052 
00053 /* constants */
00054 #define OS_SPEC_O_RDONLY O_RDONLY
00055 #define OS_SPEC_INVALID_SOCKET 0
00056 #define OS_SPEC_SOCKET_ERROR -1
00057 
00058 /* types */
00059 #define OS_SPEC_SOCKLEN socklen_t
00060 #define OS_SPEC_SOCKET_TYPE int
00061 #define OS_SPEC_STAT stat
00062 #define OS_SPEC_ENUM enum
00063 
00064 /* functions */
00065 #define OS_SPEC_SOCKETCLOSE ::close
00066 #define OS_SPEC_FSTAT fstat
00067 #define OS_SPEC_CLOSE close
00068 #define OS_SPEC_OPEN open
00069 #define OS_SPEC_FD_SET(arg1, arg2) FD_SET(arg1, arg2)
00070 #define OS_SPEC_FD_ISSET(arg1, arg2) FD_ISSET(arg1, arg2)
00071 #define OS_SPEC_FD_CLR(arg1, arg2) FD_CLR(arg1, arg2)
00072 #define OS_SPEC_SLEEP usleep
00073 #define OS_SPEC_MKDIR(dirname, access) mkdir(dirname, access)
00074 #define OS_SPEC_RMDIR(dirname) rmdir(dirname)
00075 #define initSockets() 1
00076 #define OS_SPEC_GETTIME(currentTime) gettimeofday(&currentTime, NULL);
00077 #define OS_SPEC_STRICMP strcasecmp
00078 #define OS_SPEC_STRNICMP strncasecmp
00079 #define OS_SPEC_VSNPRINTF vsnprintf
00080 #define OS_SPEC_SNPRINTF snprintf
00081 #endif /* LINUX */
00082 
00083 #endif /* #ifndef __OS_SPEC_H */
00084 

Generated at Thu Jul 11 13:31:51 2002 for Peekabooty by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001