home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 71 / CDROM71.ISO / internet / navoff / data1.cab / Sources / src / htsglobal.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-04-01  |  6.5 KB  |  269 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: Global #define file                                    */
  38. /* Author: Xavier Roche                                         */
  39. /* ------------------------------------------------------------ */
  40.  
  41. // Fichier rΘunissant l'ensemble des defines
  42.  
  43. #ifndef HTTRACK_GLOBAL_DEFH
  44. #define HTTRACK_GLOBAL_DEFH
  45.  
  46. // Version
  47. #define HTTRACK_VERSION      "3.00"
  48. #define HTTRACK_VERSIONID    "3.00.00"
  49. #define HTTRACK_AFF_VERSION  "3.x"
  50. //#define HTTRACK_AFF_WARNING  "This is a RELEASE CANDIDATE version of WinHTTrack Website Copier 3.0\nPlease report us any bug or problem"
  51.  
  52.  
  53.  
  54. // DΘfinition plate-forme
  55. #include "htssystem.h"
  56. #include "htsconfig.h"
  57.  
  58. // Socket windows ou socket unix
  59. #if HTS_PLATFORM==1
  60. #define HTS_WIN 1
  61. #else
  62. #define HTS_WIN 0
  63. #endif
  64.  
  65. // compatibilitΘ DOS
  66. #if HTS_WIN
  67. #define HTS_DOSNAME 1
  68. #else
  69. #define HTS_DOSNAME 0
  70. #endif
  71.  
  72. /*
  73. #if HTS_XGETHOST
  74. #if HTS_PLATFORM==1
  75. #ifndef __cplusplus
  76. #undef HTS_XGMETHOD
  77. #undef HTS_XGETHOST
  78. #endif
  79. #endif
  80. #else
  81. #undef HTS_XGMETHOD
  82. #undef HTS_XGETHOST
  83. #endif
  84. */
  85.  
  86. /* rc file */
  87. #if HTS_WIN
  88. #define HTS_HTTRACKRC "httrackrc"
  89. #else
  90. #define HTS_HTTRACKRC ".httrackrc"
  91. #define HTS_HTTRACKCNF "/etc/httrack.conf"
  92. #endif
  93.  
  94. /* Gestion des tables de hashage */
  95. #define HTS_HASH_SIZE 20147
  96. /* Taille max d'une URL */
  97. #define HTS_URLMAXSIZE 512
  98. /* Taille max ligne de commande (>=HTS_URLMAXSIZE*2) */
  99. #define HTS_CDLMAXSIZE 1024
  100. /* Copyright (C)Xavier Roche, Yann Philippot '1998-2001 */
  101. #define HTTRACK_AFF_AUTHORS "[XR,YP'2001]"
  102. #define HTS_DEFAULT_FOOTER "<!-- Mirrored from %s by HTTrack Website Copier/"HTTRACK_AFF_VERSION" "HTTRACK_AFF_AUTHORS" -->"
  103. #define HTS_UPDATE_WEBSITE "http://www.httrack.com/update.php3?Product=HTTrack&Version="HTTRACK_VERSIONID"&VersionStr="HTTRACK_VERSION"&Platform=%d&Language=%s"
  104. //#define HTS_UPDATE_WEBSITE "http://ghost/update.php3?Product=HTTrack&Version="HTTRACK_VERSIONID"&Platform=%d"
  105.  
  106. #define H_CRLF "\x0d\x0a"
  107. #define CRLF   "\x0d\x0a"
  108. #if HTS_WIN
  109. #define LF "\x0d\x0a"
  110. #else
  111. #define LF "\x0a"
  112. #endif
  113.  
  114. /* Θquivaut α "paramΦtre vide", par exemple -F (none) */
  115. #define HTS_NOPARAM "(none)"
  116. #define HTS_NOPARAM2 "\"(none)\""
  117.  
  118. /* maximum et minimum */
  119. #define maximum(A,B) ( (A) > (B) ? (A) : (B) )
  120. #define minimum(A,B) ( (A) < (B) ? (A) : (B) )
  121.  
  122. /* chaine vide? */
  123. #define strnotempty(A) (((A)[0]!='\0') ? 1 : 0)
  124.  
  125. /* optimisation inline si possible */
  126. #ifdef __cplusplus
  127. #define HTS_INLINE inline
  128. #else
  129. #define HTS_INLINE
  130. #endif
  131.  
  132. #ifdef HTS_NO_64_BIT
  133. #define HTS_LONGLONG 0
  134. #else
  135. #define HTS_LONGLONG 1
  136. #endif
  137.  
  138. // long long int? (or int)
  139. // (and int cast for system functions like malloc() )
  140. #if HTS_LONGLONG
  141.  #if HTS_WIN
  142.   typedef __int64 LLint;
  143.   typedef int INTsys;
  144.   #define LLintP "%I64d"
  145.  #else
  146.   typedef long long int LLint;
  147.   typedef int INTsys;
  148.   #define LLintP "%Ld"
  149.  #endif
  150. #else
  151.  typedef int LLint;
  152.  typedef int INTsys;
  153.  #define LLintP "%d"
  154. #endif
  155.  
  156. #if HTS_WIN
  157. #else
  158. #define __cdecl 
  159. #endif
  160.  
  161. /* mode pour mkdir ET chmod (accΦs aux fichiers) */
  162. #define HTS_PROTECT_FOLDER (S_IRUSR|S_IWUSR|S_IXUSR)
  163. #if HTS_ACCESS
  164. #define HTS_ACCESS_FILE (S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)
  165. #define HTS_ACCESS_FOLDER (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)
  166. #else
  167. #define HTS_ACCESS_FILE (S_IRUSR|S_IWUSR)
  168. #define HTS_ACCESS_FOLDER (S_IRUSR|S_IWUSR|S_IXUSR)
  169. #endif
  170.  
  171. /* vΘrifier la dΘclaration des variables prΘprocesseur */
  172. #ifndef HTS_DOSNAME
  173. #error | HTS_DOSNAME Has not been defined.
  174. #error | Set it to 1 if you are under DOS, 0 under Unix.
  175. #error | Example: place this line in you source, before includes:
  176. #error | #define HTS_DOSNAME 0
  177. #error
  178. #error
  179. #endif
  180. #ifndef HTS_ACCESS
  181. /* Par dΘfaut, accΦs α tous les utilisateurs */
  182. #define HTS_ACCESS 1
  183. #endif
  184.  
  185. /* fflush sur stdout */
  186. #define io_flush { fflush(stdout); fflush(stdin); }
  187.  
  188.  
  189.  
  190. /* HTSLib */
  191.  
  192. // Cache DNS, accΘlΦre les rΘsolution d'adresses
  193. #define HTS_DNSCACHE 1
  194.  
  195. // ID d'une pseudo-socket locale pour les file://
  196. #define LOCAL_SOCKET_ID -500000
  197.  
  198. // taille de chaque buffer (10 sockets 650 ko)
  199. #define TAILLE_BUFFER 65535
  200.  
  201. #if HTS_WIN
  202. #else
  203. // use pthreads.h
  204. #ifdef HTS_DO_NOT_USE_PTHREAD
  205. #define USE_PTHREAD 0
  206. #else
  207. #define USE_PTHREAD 1
  208. #endif
  209. #endif
  210.  
  211. #if HTS_WIN
  212. #define USE_BEGINTHREAD 1
  213. #else
  214. #if USE_PTHREAD
  215. #define USE_BEGINTHREAD 1
  216. #else
  217. /* sh*t.. */
  218. #define USE_BEGINTHREAD 0
  219. #endif
  220. #endif
  221.  
  222. /* ------------------------------------------------------------ */
  223. /* Debugging                                                    */
  224. /* ------------------------------------------------------------ */
  225.  
  226. // dΘbuggage types
  227. #define DEBUG_SHOWTYPES 0
  228. // backing debug
  229. #define BDEBUG 0
  230. // chunk receive
  231. #define CHUNKDEBUG 0
  232. // realloc links debug
  233. #define MDEBUG 0
  234. // cache debug
  235. #define DEBUGCA 0
  236. // DNS debug
  237. #define DEBUGDNS 0
  238. // savename debug
  239. #define DEBUG_SAVENAME 0
  240. // debug robots
  241. #define DEBUG_ROBOTS 0
  242. // debug hash
  243. #define DEBUG_HASH 0
  244. // VΘrification d'intΘgritΘ
  245. #define DEBUG_CHECKINT 0
  246. // nbr sockets debug
  247. #define NSDEBUG 0
  248. // tracer mallocs
  249. #define HTS_TRACE_MALLOC 0
  250.  
  251. // dΘbuggage HTSLib
  252. #define HDEBUG 0
  253. // surveillance de la connexion
  254. #define CNXDEBUG 0
  255. // debuggage cookies
  256. #define DEBUG_COOK 0
  257. // dΘbuggage hard..
  258. #define HTS_WIDE_DEBUG 0
  259. // debuggage deletehttp et cie
  260. #define HTS_DEBUG_CLOSESOCK 0
  261. // debug tracage mΘmoire
  262. #define MEMDEBUG 0
  263.  
  264. // htsmain
  265. #define DEBUG_STEPS 0
  266.  
  267. #endif
  268.  
  269.