home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 71 / CDROM71.ISO / internet / navoff / data1.cab / Sources / src / htsnet.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-04-01  |  2.6 KB  |  88 lines

  1. /* ------------------------------------------------------------ */
  2. /*
  3. HTTrack Website Copier, Offline Browser for Windows and Unix
  4. Copyright (C) Xavier Roche, Yann Philippot and other contributors
  5.  
  6. This program is free software; you can redistribute it and/or
  7. modify it under the terms of the GNU General Public License
  8. as published by the Free Software Foundation; either version 2
  9. of the License, or any later version.
  10.  
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with this program; if not, write to the Free Software
  18. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  19.  
  20.  
  21. Important notes:
  22.  
  23. - We hereby ask people using this source NOT to use it in purpose of grabbing
  24. emails addresses, or collecting any other private information on persons.
  25. This would disgrace our work, and spoil the many hours we spent on it.
  26.  
  27.  
  28. This project has been developed by Xavier Roche and Yann Philippot,
  29. from the company Serianet at Caen, France (http://www.serianet.com)
  30. and other contributors (see the greetings file)
  31.  
  32. Please visit our Website: http://www.httrack.com
  33. */
  34.  
  35.  
  36. /* ------------------------------------------------------------ */
  37. /* File: Net definitions                                        */
  38. /*       Used in .c files that needs connect() functions and so */
  39. /* Note: includes htsbasenet.h                                  */
  40. /* Author: Xavier Roche                                         */
  41. /* ------------------------------------------------------------ */
  42.  
  43. #ifndef HTS_DEFNETH
  44. #define HTS_DEFNETH
  45.  
  46. /* basic net definitions */
  47. #include "htsbasenet.h"
  48.  
  49. #include <ctype.h>
  50. #if HTS_WIN
  51.  #include <winsock.h>
  52.  //typedef SOCKET T_SOC;
  53.  // pour read
  54.  #include <io.h>
  55.  // pour FindFirstFile
  56.  #include <winbase.h>
  57. #else
  58.  //typedef int T_SOC;
  59.  #define INVALID_SOCKET -1
  60.  #include <netdb.h>
  61.  #include <sys/types.h>
  62.  #include <sys/socket.h>
  63.  #include <netinet/in.h>
  64.  #include <sys/time.h>
  65.  #include <sys/ioctl.h>
  66.  /* gethostname & co */
  67.  #include <unistd.h>
  68.  /* inet_addr */
  69.  #include <arpa/inet.h>
  70.  // pas la peine normalement..
  71. #if HTS_PLATFORM!=3
  72.  #include <sys/filio.h>
  73. #else
  74. #ifndef HTS_DO_NOT_REDEFINE_in_addr_t
  75.  typedef unsigned long in_addr_t;
  76. #endif
  77. #endif
  78. #ifndef min
  79.  #define min(a,b) ((a)>(b)?(b):(a))
  80.  #define max(a,b) ((a)>(b)?(a):(b))
  81. #endif
  82. #define Sleep(a) { if (((a)*1000)%1000000) usleep(((a)*1000)%1000000); if (((a)*1000)/1000000) sleep(((a)*1000)/1000000); }
  83. #endif
  84.  
  85. #endif
  86.  
  87.  
  88.