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

Re: functionality of HTEventRequestTerminate

From: Erik Selberg <selberg@cs.washington.edu>
Date: Fri, 26 Jan 1996 02:19:26 PST
Message-Id: <199601261019.CAA07162@wally.cs.washington.edu>
To: "Daniel W. Connolly" <connolly@beach.w3.org>
Cc: www-lib@w3.org
"Daniel W Connolly" writes:

> I suggest the design used in the ILU runtime:

(which is a mainEventLoop() function and a stopMainEventLoop()
function, which causes the mainEventLoop() to stop after the current
interation)

Well, as I see it, the HTEvent_Loop can be stopped by either using:

(1) a library function which sets an internal library variable
(2) a user function which presumably checks some user variable, and
    returns true / false

I'm partial to (2), mostly because I find it cleaner in terms of where
it comes in the loop (it's intuitive where it's called) and it allows
for greater flexibility.

Then again, there's no reason why both can't exist:

PRIVATE quit_main_loop = 0;
typedef int HTEventLoopTermFunc();
PRIVATE HTEventLoopTermFunc *eventloop_termfunc;

PUBLIC HTEventLoop_Quit() {
    quit_main_loop = 1;
}

PUBLIC HTEvent_Loop() {
    quit_main_loop = 0;

    do {
	...
    } while (!quit_main_loop && 
		(!eventloop_termfunc || (*eventloop_termfunc)()));
}

-Erik

    
Received on Friday, 26 January 1996 05:19:30 GMT

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