-const struct exception exception_none = { 0, NO_ERROR, NULL };
-
-/* Possible catcher states. */
-enum catcher_state {
- /* Initial state, a new catcher has just been created. */
- CATCHER_CREATED,
- /* The catch code is running. */
- CATCHER_RUNNING,
- CATCHER_RUNNING_1,
- /* The catch code threw an exception. */
- CATCHER_ABORTING
-};
-
-/* Possible catcher actions. */
-enum catcher_action {
- CATCH_ITER,
- CATCH_ITER_1,
- CATCH_THROWING
-};
-
-struct catcher
-{
- enum catcher_state state;
- /* Jump buffer pointing back at the exception handler. */
- EXCEPTIONS_SIGJMP_BUF buf;
- /* Status buffer belonging to the exception handler. */
- volatile struct exception *exception;
- /* Saved/current state. */
- int mask;
- struct ui_out *saved_uiout;
- struct cleanup *saved_cleanup_chain;
- /* Back link. */
- struct catcher *prev;
-};
-
-/* Where to go for throw_exception(). */
-static struct catcher *current_catcher;
-
-EXCEPTIONS_SIGJMP_BUF *
-exceptions_state_mc_init (struct ui_out *func_uiout,
- volatile struct exception *exception,
- return_mask mask)
-{
- struct catcher *new_catcher = XZALLOC (struct catcher);
-
- /* Start with no exception, save it's address. */
- exception->reason = 0;
- exception->error = NO_ERROR;
- exception->message = NULL;
- new_catcher->exception = exception;
-
- new_catcher->mask = mask;
-
- /* Override the global ``struct ui_out'' builder. */
- new_catcher->saved_uiout = uiout;
- uiout = func_uiout;
-
- /* Prevent error/quit during FUNC from calling cleanups established
- prior to here. */
- new_catcher->saved_cleanup_chain = save_cleanups ();
-
- /* Push this new catcher on the top. */
- new_catcher->prev = current_catcher;
- current_catcher = new_catcher;
- new_catcher->state = CATCHER_CREATED;
-
- return &new_catcher->buf;
-}
-
-static void
-catcher_pop (void)
-{
- struct catcher *old_catcher = current_catcher;
- current_catcher = old_catcher->prev;
-
- /* Restore the cleanup chain, the error/quit messages, and the uiout
- builder, to their original states. */