home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 71 / CDROM71.ISO / internet / navoff / data1.cab / Sources / src / htscatchurl.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-04-01  |  3.1 KB  |  108 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: URL catch .h                                           */
  38. /* Author: Xavier Roche                                         */
  39. /* ------------------------------------------------------------ */
  40.  
  41. // Fichier intercepteur d'URL .h
  42.  
  43. #ifndef HTS_CATCHURL_DEFH
  44. #define HTS_CATCHURL_DEFH 
  45.  
  46. #include "htsbasenet.h"
  47.  
  48. /*
  49. #if _WIN32
  50.  #include <ctype.h>
  51.  #include <winsock.h>
  52.  #include <conio.h>
  53.  typedef SOCKET T_SOC;
  54.  typedef struct hostent FAR t_hostent;
  55.  #define  bzero(a,b) memset(a,0,b)
  56.  #define  bcopy(a,b,c) memcpy(b,a,c)
  57. #else
  58.  //#define INVALID_SOCKET -1
  59.  #include <netdb.h>
  60.  #include <sys/types.h>
  61.  #include <sys/socket.h>
  62.  #include <netinet/in.h>
  63.  #include <sys/time.h>
  64.  #include <sys/ioctl.h>
  65.  // pas la peine normalement..
  66. #if HTS_PLATFORM!=3
  67.  #include <sys/filio.h>
  68. #else
  69. #endif
  70.  //typedef int T_SOC;
  71.  //typedef struct hostent t_hostent;
  72. #endif
  73. */
  74.  
  75. // Fonctions
  76. void socinput(T_SOC soc,char* s,int max);
  77. T_SOC catch_url_init_std(int* port_prox,char* adr_prox);
  78. T_SOC catch_url_init(int* port,char* adr);
  79. int catch_url(T_SOC soc,char* url,char* method,char* data);
  80.  
  81. #define CATCH_RESPONSE \
  82.   "HTTP/1.0 200 OK\r\n"\
  83.   "Content-type: text/html\r\n"\
  84.   "\r\n"\
  85.   "<!-- Generated by HTTrack Website Copier -->\r\n"\
  86.   "<HTML><HEAD>\r\n"\
  87.   "<TITLE>Link caught!</TITLE>\r\n"\
  88.   "<SCRIPT LANGUAGE=\"Javascript\">\r\n"\
  89.   "<!--\r\n"\
  90.   "function back() {\r\n"\
  91.   "  history.go(-1);\r\n"\
  92.   "}\r\n"\
  93.   "// -->\r\n"\
  94.   "</SCRIPT>\r\n"\
  95.   "</HEAD>\r\n"\
  96.   "<BODY>\r\n"\
  97.   "<H2>Link captured into HTTrack Website Copier, you can now restore your proxy preferences!</H2>\r\n"\
  98.   "<BR><BR>\r\n"\
  99.   "<H3><A HREF=\"javascript:back();\">Clic here to go back</A></H3>\r\n"\
  100.   "</BODY></HTML>"\
  101.   "<!-- Generated by HTTrack Website Copier -->\r\n"\
  102.   "\r\n"\
  103.  
  104. #endif
  105.  
  106.  
  107.  
  108.