home *** CD-ROM | disk | FTP | other *** search
/ PC Open 48 / pcopen48.iso / Internet / HtTrack / DATA1.CAB / Sources / src / htsglobal.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-21  |  6.4 KB  |  268 lines

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