/* ------------------------------------------------------------ */ /* HTTrack Website Copier, Offline Browser for Windows and Unix Copyright (C) Xavier Roche and other contributors 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 information on persons. This would disgrace our work, and spoil the many hours we spent on it. Please visit our Website: http://www.httrack.com */ /* ------------------------------------------------------------ */ /* File: Main source */ /* DIRECT INCLUDE TO httrack.c */ /* Author: Xavier Roche */ /* ------------------------------------------------------------ */ #if HTS_ANALYSTE if (hts_htmlcheck(r.adr,(int)r.size,urladr,urlfil)) { #endif FILE* fp=NULL; // fichier écrit localement char* adr=r.adr; // pointeur (on parcourt) char* lastsaved; // adresse du dernier octet sauvé + 1 if ( (opt.debug>1) && (opt.log!=NULL) ) { fspc(opt.log,"debug"); fprintf(opt.log,"scan file.."LF); test_flush; } // Indexing! #if HTS_MAKE_KEYWORD_INDEX if (opt.kindex) { if (index_keyword(r.adr,r.size,r.contenttype,savename,opt.path_html)) { if ( (opt.debug>1) && (opt.log!=NULL) ) { fspc(opt.log,"debug"); fprintf(opt.log,"indexing file..done"LF); test_flush; } } else { if ( (opt.debug>1) && (opt.log!=NULL) ) { fspc(opt.log,"debug"); fprintf(opt.log,"indexing file..error!"LF); test_flush; } } } #endif // Now, parsing if ((opt.getmode & 1) && (ptr>0)) { // récupérer les html sur disque // créer le fichier html local HT_ADD_FOP; // écrire peu à peu le fichier } if (!error) { int detect_title=0; // détection du title // char* in_media=NULL; // in other media type (real media and so..) int intag=0; // on est dans un tag int incomment=0; // dans un " ); } else makeindex_done=-1; // fait, erreur } if (makeindex_fp!=NULL) { char tempo[HTS_URLMAXSIZE*2]; char s[HTS_URLMAXSIZE*2]; char* a=NULL; char* b=NULL; s[0]='\0'; if (p>0) { a=strchr(adr,'>'); if (a!=NULL) { a++; while(is_space(*a)) a++; // sauter espaces & co b=strchr(a,'<'); // prochain tag } } if (lienrelatif(tempo,liens[ptr]->sav,concat(opt.path_html,"index.html"))==0) { detect_title=1; // ok détecté pour cette page! makeindex_links++; // un de plus strcpy(makeindex_firstlink,tempo); // if ((b==a) || (a==NULL) || (b==NULL)) { // pas de titre strcpy(s,tempo); } else if ((b-a)<256) { b--; while(is_space(*b)) b--; strncpy(s,a,b-a+1); *(s+(b-a)+1)='\0'; } // Body fprintf(makeindex_fp,template_body, tempo, s ); } } } } } } else if (liens[ptr]->depth"); // if (p==0) p=strfield(adr,"') /* ending tag */ && ( (!inscript) || (inscript_tag) ) /* and in tag (or in script) */ ) { if (inscript_tag) { inscript_tag=inscript=0; intag=0; incomment=0; intag_start_valid=0; } else if (!incomment) { intag=0; //inquote=0; // entrée dans du javascript? // on parse ICI car il se peut qu'on ait eu a parser les src=.. dedans //if (!inscript) { // sinon on est dans un obj.write(".. if ((intag_start_valid) && ( check_tag(intag_start,"script") || check_tag(intag_start,"style") ) ) { char* a=intag_start; // < // ** while(is_realspace(*(--a))); if (*a=='<') { // sûr que c'est un tag? inscript=1; intag=1; // because après