"Fossies" - the Fresh Open Source Software Archive

Member "delegate9.9.13/include/ysocket.h" (16 Aug 2009, 1788 Bytes) of package /linux/misc/old/delegate9.9.13.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "ysocket.h" see the Fossies "Dox" file reference documentation.

    1 #ifndef _YSOCKET_H
    2 #define _YSOCKET_H
    3 
    4 #ifdef _MSC_VER
    5 #include <winsock2.h> /* for fd_set */
    6 #include "ywinsock.h"
    7 #endif
    8 
    9 typedef struct sockaddr *_SAP;
   10 int _SOCKET(int,int,int);
   11 int _BIND(int,_SAP,int);
   12 int _LISTEN(int,int);
   13 int _ACCEPT(int,_SAP,int*);
   14 int _CONNECT(int,const _SAP,int);
   15 int _SENDTO(int,const void*,unsigned int,int,_SAP,unsigned int);
   16 int _RECVFROM(int,void*,unsigned int,int,_SAP,int*);
   17 int _SEND(int,const void*,unsigned int,int);
   18 int _RECV(int,void*,unsigned int,int);
   19 int _GETSOCKOPT(int,int,int,void *,int*);
   20 int _SETSOCKOPT(int,int,int,const void *,int);
   21 int _SELECT(int,fd_set*,fd_set*,fd_set*,struct timeval*);
   22 int _GETHOSTNAME(char*,unsigned int);
   23 int _SHUTDOWN(int,int);
   24 
   25 #ifdef __APPLE__
   26 int recvDarwin(int s,void *b,int l,int f,FL_PAR);
   27 #define recv(s,b,l,f) recvDarwin(s,b,l,f,FL_ARG)
   28 #endif
   29 
   30 #define STD_HOSTENT
   31 #define gethostbyname   _GETHOSTBYNAME
   32 #define gethostbyaddr   _GETHOSTBYADDR
   33 
   34 
   35 #ifdef _MSC_VER
   36 
   37 int _GETSOCKNAME(int s,_SAP,int *l);
   38 int _GETPEERNAME(int s,_SAP,int *l);
   39 
   40 
   41 /*
   42 #define socket      _SOCKET
   43 */
   44 #define bind        _BIND
   45 #define listen      _LISTEN
   46 /*
   47 #define accept      _ACCEPT
   48 */
   49 #define connect     _CONNECT
   50 #define shutdown    _SHUTDOWN
   51 
   52 #define select      _SELECT
   53 
   54 #define send        _SEND
   55 #define recv        _RECV
   56 #define sendto      _SENDTO
   57 #define recvfrom    _RECVFROM
   58 
   59 #define getsockname _GETSOCKNAME
   60 #define getpeername _GETPEERNAME
   61 
   62 #define setsockopt  _SETSOCKOPT
   63 #define getsockopt  _GETSOCKOPT
   64 
   65 #define gethostname _GETHOSTNAME
   66 #else /* !_MSC_VER */
   67 
   68 #define bind(s,a,l) _BIND(s,a,l)
   69 #define accept(s,a,l)   _ACCEPT(s,a,l)
   70 #define connect(s,a,l)  _CONNECT(s,a,l)
   71 
   72 #endif /* _MSC_VER */
   73 
   74 #define PS_IN     001
   75 #define PS_PRI    002
   76 #define PS_OUT    004
   77 #define PS_ERR    010
   78 #define PS_HUP    020
   79 #define PS_NVAL   040
   80 #define PS_ERRORS 070
   81 
   82 #endif /* _YSOCKET_H */