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

Re: ending the HTML parser loop

From: Henrik Frystyk Nielsen <frystyk@w3.org>
Date: Wed, 17 Feb 1999 19:40:09 -0500
Message-Id: <3.0.5.32.19990217194009.00c2c5e0@localhost>
To: Mathew Cucuzella <mat@mcg.mot.com>, libwww <www-lib@w3.org>
At 17:24 2/17/99 -0700, Mathew Cucuzella wrote:
>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.

Stopping the loop is fine - but I wouldn't terminate libwww (delete the
profile) if I were you if you know that you are entering it again later.

That may also be the problem with the core.

Henrik
--
Henrik Frystyk Nielsen,
World Wide Web Consortium
http://www.w3.org/People/Frystyk
Received on Wednesday, 17 February 1999 19:40:15 GMT

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