The issue is that the control flow for this library looks like this:
PilotMain (provided by me) calls glk_main (provided by author of Glk-using program) calls glk_select (provided by me, handles event loop).
Unfortunately, there is no easy way for me to tell glk_main 'Time to quit now', and it may be nontrivial to hack in a 'Quit' event type due to how the Glk-using program is implemented. (As an example in the sample code, there is a function 'yes_or_no' that polls glk_select until it gets a yes or no answer, and then returns a boolean. Adding a 'Quit' event type would require changing the return type of this function and checking for that everywhere it is called...and so on until we get back out to glk_main.) Thus, if I get a sysEventAppStopEvent, I have no easy way that I can see to properly exit out of glk_select. (I could call SysUIAppSwitch, but that would annoy the heck out of the users if they had exited via a hard button.)
Is there either: a way for me to immediately exit as if I had returned from PilotMain (equivalent of C library exit()), or an equivalent of setjmp/longjmp that I can use to jump out of glk_select all the way to PilotMain?
BJ
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
