Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

phSocketPrivate.h

Go to the documentation of this file.
00001 /* ---------------------------------------------------------------------------
00002     Phission : 
00003         Realtime Vision Processing System
00004     
00005     Copyright (C) 2003-2006 Philip D.S. Thoren (pthoren@cs.uml.edu)
00006     University of Massachusetts at Lowell,
00007     Laboratory for Artificial Intelligence and Robotics
00008     
00009     This file is part of Phission.
00010 
00011     Phission is free software; you can redistribute it and/or modify
00012     it under the terms of the GNU Lesser General Public License as published by
00013     the Free Software Foundation; either version 2 of the License, or
00014     (at your option) any later version.
00015 
00016     Phission is distributed in the hope that it will be useful,
00017     but WITHOUT ANY WARRANTY; without even the implied warranty of
00018     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019     GNU Lesser General Public License for more details.
00020 
00021     You should have received a copy of the GNU Lesser General Public License
00022     along with Phission; if not, write to the Free Software
00023     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00024 
00025  ---------------------------------------------------------------------------*/
00026 /* This file has socket private definitions/macros that shouldn't be wrapped
00027  * into any other language */
00028 #ifndef _PHSOCKETPRIVATE_H
00029 #define _PHSOCKETPRIVATE_H
00030 
00031 /* ---------------------------------------------------------------------- */
00041 #ifndef PH_USE_SOCKET_PRIVATE
00042     #define PH_USE_SOCKET_PRIVATE 0
00043 #endif
00044 
00045 #if defined(PH_USE_SOCKET_PRIVATE)
00046 
00047 /* ------------------------------------------------------------------------- */
00048 #if defined(WIN32)
00049     /* WIN32 */
00050     #define socklen_t int
00051 #else 
00052     /* !WIN32 */
00053     #define _POSIX_PII_SOCKET
00054 #endif
00055 
00056 /* ------------------------------------------------------------------------- */
00057 #if defined(WIN32)
00058     #define ph_setsockopt_val_cast() (const char *)
00059 #else
00060     #define ph_setsockopt_val_cast() (const void *)
00061 #endif
00062 
00063 /* ------------------------------------------------------------------------- */
00064 #if defined(WIN32)
00065     #define phSOCKET SOCKET
00066 
00067     #define phEINTR           WSAEINTR
00068     #define phEBADF           WSAEBADF
00069     #define phEACCES          WSAEACCES
00070     #define phEFAULT          WSAEFAULT
00071     #define phEINVAL          WSAEINVAL
00072     #define phEMFILE          WSAEMFILE
00073     #define phEWOULDBLOCK     WSAEWOULDBLOCK
00074     #define phEINPROGRESS     WSAEINPROGRESS
00075     #define phEALREADY        WSAEALREADY
00076     #define phENOTSOCK        WSAENOTSOCK
00077     #define phEDESTADDRREQ    WSAEDESTADDRREQ
00078     #define phEMSGSIZE        WSAEMSGSIZE
00079     #define phEPROTOTYPE      WSAEPROTOTYPE
00080     #define phENOPROTOOPT     WSAENOPROTOOPT
00081     #define phEPROTONOSUPPORT WSAEPROTONOSUPPORT
00082     #define phESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
00083     #define phEOPNOTSUPP      WSAEOPNOTSUPP
00084     #define phEPFNOSUPPORT    WSAEPFNOSUPPORT
00085     #define phEAFNOSUPPORT    WSAEAFNOSUPPORT
00086     #define phEADDRINUSE      WSAEADDRINUSE
00087     #define phEADDRNOTAVAIL   WSAEADDRNOTAVAIL
00088     #define phENETDOWN        WSAENETDOWN
00089     #define phENETUNREACH     WSAENETUNREACH
00090     #define phENETRESET       WSAENETRESET
00091     #define phECONNABORTED    WSAECONNABORTED
00092     #define phECONNRESET      WSAECONNRESET
00093     #define phENOBUFS         WSAENOBUFS
00094     #define phEISCONN         WSAEISCONN
00095     #define phENOTCONN        WSAENOTCONN
00096     #define phESHUTDOWN       WSAESHUTDOWN
00097     #define phETOOMANYREFS    WSAETOOMANYREFS
00098     #define phETIMEDOUT       WSAETIMEDOUT
00099     #define phECONNREFUSED    WSAECONNREFUSED
00100     #define phELOOP           WSAELOOP
00101     #define phENAMETOOLONG    WSAENAMETOOLONG
00102     #define phEHOSTDOWN       WSAEHOSTDOWN
00103     #define phEHOSTUNREACH    WSAEHOSTUNREACH
00104     #define phENOTEMPTY       WSAENOTEMPTY
00105     #define phEPROCLIM        WSAEPROCLIM
00106     #define phEUSERS          WSAEUSERS
00107     #define phEDQUOT          WSAEDQUOT
00108     #define phESTALE          WSAESTALE
00109     #define phEREMOTE         WSAEREMOTE
00110     #define phEDISCON         WSAEDISCON
00111     #define phSYSNOTREADY     WSASYSNOTREADY
00112     #define phVERNOTSUPPORTED WSAVERNOTSUPPORTED
00113     #define phNOTINITIALISED  WSANOTINITIALISED
00114     #define phHOST_NOT_FOUND  WSAHOST_NOT_FOUND
00115     #define phTRY_AGAIN       WSATRY_AGAIN
00116     #define phNO_RECOVERY     WSANO_RECOVERY
00117     #define phNO_DATA         WSANO_DATA
00118     
00119     #define phSHUT_RD         SD_RECEIVE
00120     #define phSHUT_WR         SD_SEND
00121     #define phSHUT_RDWR       SD_BOTH         
00122 
00123 #else /* WIN32 */
00124     #define phSOCKET int
00125 
00126     #define phEINTR           EINTR
00127     #define phEBADF           EBADF
00128     #define phEACCES          EACCES
00129     #define phEFAULT          EFAULT
00130     #define phEINVAL          EINVAL
00131     #define phEMFILE          EMFILE
00132     #define phEWOULDBLOCK     EWOULDBLOCK
00133     #define phEINPROGRESS     EINPROGRESS
00134     #define phEALREADY        EALREADY
00135     #define phENOTSOCK        ENOTSOCK
00136     #define phEDESTADDRREQ    EDESTADDRREQ
00137     #define phEMSGSIZE        EMSGSIZE
00138     #define phEPROTO          EPROTO
00139     #define phEPROTOTYPE      EPROTOTYPE
00140     #define phENOPROTOOPT     ENOPROTOOPT
00141     #define phEPROTONOSUPPORT EPROTONOSUPPORT
00142     #define phESOCKTNOSUPPORT ESOCKTNOSUPPORT
00143     #define phEOPNOTSUPP      EOPNOTSUPP
00144     #define phEPFNOSUPPORT    EPFNOSUPPORT
00145     #define phEAFNOSUPPORT    EAFNOSUPPORT
00146     #define phEADDRINUSE      EADDRINUSE
00147     #define phEADDRNOTAVAIL   EADDRNOTAVAIL
00148     #define phENETDOWN        ENETDOWN
00149     #define phENETUNREACH     ENETUNREACH
00150     #define phENETRESET       ENETRESET
00151     #define phECONNABORTED    ECONNABORTED
00152     #define phECONNRESET      ECONNRESET
00153     #define phENOBUFS         ENOBUFS
00154     #define phEISCONN         EISCONN
00155     #define phENOTCONN        ENOTCONN
00156     #define phESHUTDOWN       ESHUTDOWN
00157     #define phETOOMANYREFS    ETOOMANYREFS
00158     #define phETIMEDOUT       ETIMEDOUT
00159     #define phECONNREFUSED    ECONNREFUSED
00160     #define phELOOP           ELOOP
00161     #define phENAMETOOLONG    ENAMETOOLONG
00162     #define phEHOSTDOWN       EHOSTDOWN
00163     #define phEHOSTUNREACH    EHOSTUNREACH
00164     #define phENOTEMPTY       ENOTEMPTY
00165     #define phEPROCLIM        EPROCLIM
00166     #define phEUSERS          EUSERS
00167     #define phEDQUOT          EDQUOT
00168     #define phESTALE          ESTALE
00169     #define phEREMOTE         EREMOTE
00170     #define phEDISCON         EDISCON
00171     #define phSYSNOTREADY     SYSNOTREADY
00172     #define phVERNOTSUPPORTED VERNOTSUPPORTED
00173     #define phNOTINITIALISED  NOTINITIALISED
00174     #define phHOST_NOT_FOUND  HOST_NOT_FOUND
00175     #define phTRY_AGAIN       TRY_AGAIN
00176     #define phNO_RECOVERY     NO_RECOVERY
00177     #define phNO_DATA         NO_DATA
00178 
00179     
00180     #define phSHUT_RD         SHUT_RD
00181     #define phSHUT_WR         SHUT_WR
00182     #define phSHUT_RDWR       SHUT_RDWR
00183         
00184     #if defined(HAVE_LWIP_SOCKETS_H)
00185         #ifndef SHUT_RD
00186             #define SHUT_RD         0x0
00187         #endif
00188         #ifndef SHUT_WR
00189             #define SHUT_WR         0x1
00190         #endif
00191         #ifndef SHUT_RDWR
00192             #define SHUT_RDWR       0x2
00193         #endif
00194     #endif
00195 
00196 #endif /* !WIN32 */
00197 
00198 /* ------------------------------------------------------------------------- */
00199 #if defined(WIN32)
00200 #define phWINSOCK_ERR_PRINT( msg, ... )             \
00201 {                                                   \
00202     ph_string buf = NULL;                           \
00203     phErrorString(WSAGetLastError(),&buf);          \
00204     phERR_PRINT("(%s)" msg "\n", buf, ##__VA_ARGS__ );\
00205     phFree(buf);                                    \
00206 }
00207 #endif
00208 /* ------------------------------------------------------------------------- */
00209 #define phSOCK_ERR_PRINT( msg, ... )                \
00210 {                                                   \
00211     ph_string buf = NULL;                           \
00212     phErrorString(this->lastSocketError(),&buf);            \
00213     phERR_PRINT("(%s)" msg "\n", buf, ##__VA_ARGS__ );\
00214     phFree(buf);                                    \
00215 }
00216 
00217 
00218 #endif /* if defined(PH_USE_SOCKET_PRIVATE) */
00219  /* end \addtogroup Network */
00221 
00222 #endif /* _PHSOCKETPRIVATE_H */




Copyright (C) 2002 - 2007 Philip D.S. Thoren ( pthoren@users.sourceforge.net )
University Of Massachusetts at Lowell
Robotics Lab
SourceForge.net Logo

Generated on Sat Jun 16 02:44:02 2007 for phission by  doxygen 1.4.4