W3C home > Mailing lists > Public > www-lib@w3.org > January to March 1999

ending the HTML parser loop

From: Mathew Cucuzella <mat@mcg.mot.com>
Date: Wed, 17 Feb 1999 17:24:04 -0700
Message-ID: <36CB5DA4.7DE86A3A@phx.mcd.mot.com>
To: libwww <www-lib@w3.org>
I'm using the showtags.c example program for the HTML parser. I want
to be able to enter the event loop, parse the page, and then come
back to my program. Here is the code I changed:

  /* No change here. Call to register our own termination filter */
  HTNet_addAfter(my_terminate_handler, NULL, NULL, HT_ALL, HT_FILTER_LAST);


  PRIVATE int my_terminate_handler (HTRequest * request, HTResponse * response,
			       void * param, int status) 
  {
    /* No change. We are done with this request */
    HTRequest_delete(request);

    /* No Change. Terminate libwww */
    HTProfile_delete();

    /* This use to be exit(0), I changed to ... */
--> HTEventList_stopLoop();
  }

This seems to work, because I now come back from the HTEventList_loop(),
but I'm not sure if it is the right call, or if there is a better
way to do this. I would also like to call this code multiple times for
different URI's which dumps core right now, but I haven't looked into
that problem yet.

Any comments would be appreciated.

-mat

PS - running Redhad Linux, Kernel 2.0.34 on an i686
Received on Wednesday, 17 February 1999 19:21:31 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:28 GMT