extern void OS_select_registry_entry (unsigned long registry,
int i, int *fd, unsigned int *mode);
extern void OS_syserr_names (unsigned long *, const char ***);
-extern void Interpret (int pop_return_p);
-extern void alienate_float_environment (void);
extern void foreach_async_signal (void(*func)(int signo));
extern void abort_to_c (void);
+extern void re_enter_scheme (void);
extern int interrupts_p (void);
static void init_signal_handling (void);
return (FALSE);
}
-static gboolean
-do_scheme (GSource *source)
-{
- slice_counter += 1;
- trace (";scheme_source_dispatch: running time slice %d\n", slice_counter);
-
- Interpret (1);
- alienate_float_environment ();
-
- trace (";scheme_source_dispatch: finished time slice %d\n", slice_counter);
- return (TRUE); /* Not a once-only. */
-}
-
static gboolean
scheme_source_dispatch (GSource * source,
GSourceFunc callback, gpointer user_data)
arguments. Must return TRUE to stay on the list of event
sources. */
- gboolean ret = FALSE;
+ if (g_source_is_destroyed (source))
+ return (FALSE);
+
+ slice_counter += 1;
+ trace (";scheme_source_dispatch: running time slice %d\n", slice_counter);
- if (!g_source_is_destroyed (source))
- ret = do_scheme (source);
+ re_enter_scheme ();
- return ret;
+ trace (";scheme_source_dispatch: finished time slice %d\n", slice_counter);
+ return (TRUE); /* Not a once-only. */
}
GSourceFuncs scheme_source_funcs =
{
/* Runs g_main_loop_run with scheme_source attached. Returns TRUE when
successful. Returns FALSE when main loop is already running. */
+ CalloutTrampIn tramp = &Scm_continue_start_glib;
+ gboolean retval = TRUE;
if (scheme_source != NULL)
return (FALSE);
slice_hook = NULL;
init_signal_handling ();
- CalloutTrampIn tramp = &Scm_continue_start_glib;
- gboolean retval = TRUE;
+ install_scheme_source ();
- /* Prep the machine for re-entry via scheme_source->dispatch(),
- which should continue with the seemingly aborted application of
- C-CALL-CONTINUE, which should call Scm_continue_start_glib().
- That function expects one gboolean in the top CSTACK frame. */
callout_unseal (tramp);
CSTACK_PUSH (gboolean, retval);
CSTACK_PUSH (int, cstack_depth);
CSTACK_PUSH (CalloutTrampIn, tramp);
- install_scheme_source ();
loop = g_main_loop_new (NULL, TRUE);
g_main_loop_run (loop);
g_main_loop_unref (loop);
if (slice_hook != NULL) (*slice_hook)();
- /* The c-call primitive has arranged for c-call-continue to run (and
- thus Scm_run_glib_continue) when Scheme continues. */
abort_to_c ();
/*NOTREACHED*/
}