home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Games / ms-0.07 / lib / inet.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-27  |  1.1 KB  |  55 lines

  1. /* inet.h -- internet-related declarations */
  2.  
  3. #ifndef _inet_h
  4. #define _inet_h
  5.  
  6. #ifdef _AIX
  7. #ifndef NEED_SYS_SELECT_H
  8. #define NEED_SYS_SELECT_H
  9. #endif
  10. #endif
  11.  
  12. #ifdef NEED_SYS_SELECT_H
  13. /* for AIX, mostly */
  14. #include <sys/select.h>
  15. #endif
  16.  
  17. #ifndef __TYPES__
  18. /* __TYPES__ is defined by X headers that include <sys/types.h> */
  19. #include <sys/types.h>
  20. #include <sys/file.h>    /* HP-UX needs this for FNDELAY */
  21. #ifdef HAVE_SELECT
  22. #include <sys/time.h>    /* 4.3 BSD needs this and <sys/time.h> for select() */
  23. #endif
  24. #endif
  25.  
  26. #include <fcntl.h>
  27.  
  28. #ifdef HAVE_SOCKETS
  29.  
  30. #include <sys/socket.h>
  31. #include <netinet/in.h>
  32. #include <netdb.h>
  33. typedef struct sockaddr_in NET_ADDRESS;
  34.  
  35. #else /* !HAVE_SOCKETS */
  36.  
  37. typedef struct
  38. { int sin_port;         /* dummy, needed by mslaved */
  39. } NET_ADDRESS;
  40.  
  41. /* define dummy byteorder functions (there is no network, so we don't */
  42. /* need to be network portable) */
  43. #define ntohl(x) (x)
  44. #define htonl(x) (x)
  45. #define ntohs(x) (x)
  46. #define htons(x) (x)
  47.  
  48. #endif /* !HAVE_SOCKETS */
  49.  
  50. /* network to host byteorder, long (signed) integer (ntohl may return an */
  51. /* unsigned quantity) */
  52. #define ntohli(x) ((sint32) ntohl(x))
  53.  
  54. #endif /* _inet_h */
  55.