HTTrack Website Copier
Free software offline browser - FORUM
Subject: Re: Callbacks and GUI
Author: Xavier Roche
Date: 10/02/2004 16:34
 
> Exactly. Most of the callbacks are issued, while an HTML
> page is analyzed or while links are checked if they should
> be included in the mirror. In other words, it's pretty 
> low level stuff

I add the following: httrack (the commandline tool), 
winhttrack (the windoz GUI) and webhttrack are all "simple" 
programs, that link to libhttrack, registering their 
callbacks.

Here's the httrack.c main() function:

int main(int argc, char **argv) {
  int ret = 0;
  hts_init();  // initialize libhttrack

  // register our callbacks
  htswrap_add("init",htsshow_init);
  htswrap_add("free",htsshow_uninit);
  htswrap_add("start",htsshow_start);
...
  htswrap_add("receive-header", htsshow_receiveheader);

  // launch
  ret = hts_main(argc,argv);
  if (ret) {
    fprintf(stderr, "* %s\n", hts_errmsg());
  }
  return ret;
}

.. and that's all. WinHTTrack and WebHTTrack almost do the 
same, except that the callbacks are very differents: they 
all build a commandline, initialize the library, register 
callbacks, and start the engine.

(BTW, reading httrack.c is a good tutorial for writing a 
GUI for httrack :) )
 
Reply Create subthread


All articles

Subject Author Date
Callbacks and GUI

09/20/2004 02:17
Re: Callbacks and GUI

09/20/2004 13:42
Re: Callbacks and GUI

10/02/2004 16:34




4

Created with FORUM 2.0.11