sprint 1-alpha
sprint/network_headers.h
Go to the documentation of this file.
00001 /******************************************************************************
00002 *  sprint::network
00003 *
00004 *   Copyright (C) 2005-2011  Paolo Medici <www.pmx.it>
00005 *
00006 *  This library is free software; you can redistribute it and/or
00007 *  modify it under the terms of the GNU Lesser General Public
00008 *  License as published by the Free Software Foundation; either
00009 *  version 2.1 of the License, or (at your option) any later version.
00010 *
00011 *  This library is distributed in the hope that it will be useful,
00012 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 *  Lesser General Public License for more details.
00015 *
00016 *  You should have received a copy of the GNU Lesser General Public
00017 *  License along with this library; if not, write to the Free Software
00018 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00019 *
00020 *******************************************************************************/
00021 
00022 #ifndef _SPRINT_NETWORK_HEADER_H
00023 #define _SPRINT_NETWORK_HEADER_H
00024 
00028 #include <sprint/platform.h>
00029 
00030 #ifdef WIN32
00031 
00032 # include <winsock2.h>
00033 # include <ws2tcpip.h>
00034 # include <windows.h>
00035 
00036 #else
00037 
00038 #ifndef __BEOS__
00039         //for linux only
00040         #include <unistd.h>
00041 
00042         #include <sys/socket.h>
00043         #include <netinet/in.h>
00044         #include <sys/signal.h>
00045         #include <sys/errno.h>
00046         #include <arpa/inet.h>
00047 
00048         #include <sys/types.h>
00049         #include <sys/ioctl.h>
00050         #include <sys/time.h>
00051 
00052         #include <netdb.h>
00053    
00054     #define closesocket(s)      close(s)
00055 #else
00056         //for BeOS only
00057         #include <be/NetKit.h>
00058         #include <be/NetworkKit.h>
00059         #include <be/net/socket.h>
00060 #endif // __BEOS__
00061 
00062 #define SOCKET_ERROR            -1
00063 #define INVALID_SOCKET          -1
00064 
00065 typedef struct sockaddr SOCKADDR,*LPSOCKADDR;
00066 typedef struct sockaddr_in SOCKADDR_IN,*LPSOCKADDR_IN;
00067 
00068 #define ioctlsocket ioctl
00069 
00070 #define SD_RECV                 0
00071 #define SD_SEND                 1
00072 #define SD_BOTH                 2
00073 
00074 #endif
00075 
00076 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines