home *** CD-ROM | disk | FTP | other *** search
Wrap
/* ------------------------------------------------------------ */ /* HTTrack Website Copier, Offline Browser for Windows and Unix Copyright (C) Xavier Roche & Yann Philippot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Important notes: - We hereby ask people using this source NOT to use it in purpose of grabbing emails addresses, or collecting any other private informations on persons. This would disgrace our work, and spoil the many hours we spent on it. This project has been developed by Xavier Roche and Yann Philippot, and originally supervised by Daniel CarrĪ and Patrick Ducrot from "ISMRA - Ensi Caen", computing department (http://www.ismra.fr) Please visit our Web site: http://httrack.free.fr */ /* ------------------------------------------------------------ */ /* File: httracklib.h: */ /* library calling */ /* ------------------------------------------------------------ */ #include "httracklib.h" #include "src/httrack.h" #include "src/htsmain.h" #ifdef _WIN32 #include "Winsock.h" #endif #include <stdio.h> /* * Name: HTTrackLib_main * Description: Main HTTrack function * Parameters: argc (number of arguments) * argv (arguments) * Returns: Error status */ int HTTrackLib_main(int argc, char **argv) { return hts_main(argc,argv); } /* CALLBACK FUNCTIONS */ /* Initialize the Winsock */ void hts_htmlcheck_init() { HTTrackLib_Init(); /* */ #ifdef _WIN32 { WORD wVersionRequested; // requested version WinSock API WSADATA wsadata; // Windows Sockets API data int stat; wVersionRequested = 0x0101; stat = WSAStartup( wVersionRequested, &wsadata ); if (stat != 0) { printf("Winsock not found!\n"); return; } else if (LOBYTE(wsadata.wVersion) != 1 && HIBYTE(wsadata.wVersion) != 1) { printf("WINSOCK.DLL does not support version 1.1\n"); WSACleanup(); return; } } #endif } void hts_htmlcheck_uninit() { HTTrackLib_Close(); /* */ #ifdef _WIN32 WSACleanup(); #endif } int hts_htmlcheck_start() { return HTTrackLib_Start(); } int hts_htmlcheck_end() { return HTTrackLib_End(); } int hts_htmlcheck(char* html,int len,char* url_adresse,char* url_fichier) { return HTTrackLib_TestParse(url_adresse,url_fichier,html,len); } int hts_htmlcheck_loop(lien_back* back,int back_max,int back_index,int lien_tot,int lien_ntot,LLint stat_bytes,LLint stat_bytes_recv,int stat_time,int stat_nsocket,LLint stat_written, int stat_updated, int stat_errors, int irate, int nbk ) { return 1; } char* hts_htmlcheck_query(char* question) { return ""; } char* hts_htmlcheck_query2(char* question) { static char reponse[]="YES"; return reponse; } char* hts_htmlcheck_query3(char* question) { static char reponse[]="4"; return reponse; } int hts_htmlcheck_check(char* adr,char* fil,int status) { return HTTrackLib_TestLink(adr,fil,status); }