static void relinquish_to_ios(SINGLE_QSP_ARG_DECL) { // We halt the interpreter to let ios take over // and do whatever, using the same mechanism we // use for alerts. In the case of alerts, however, // the users dismissal of the alert serves to send // control back to the interpreter. Here, on the other // hand, we don't know if anything at all is going to happen // (although it probably will, given that this will // be called when the script executes os/events). // // We set a timer based on the display refresh to wake up // the interpreter... // If this assertion fails, that means that we've // already called this? assert( ! IS_HALTING( THIS_QSP ) ); SET_QS_FLAG_BITS(THIS_QSP,QS_HALTING); // Now the interpreter will stop reading input. // But we now need to schedule a wakeup so that it can pick up // again after the OS has done it's stuff... sync_with_ios(); }
static void exec_qs_cmds( void *_qsp ) { Query_Stack *qsp=(Query_Stack *)_qsp; while( lookahead_til(QSP_ARG 0) ){ while( QS_HAS_SOMETHING(qsp) && ! IS_HALTING(qsp) ){ QS_DO_CMD(qsp); } } }