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 */

    /* No Change. Terminate libwww */

    /* 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.


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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:33:49 UTC