int _pSLerr_init (void) { if (Default_Error_Queue == NULL) { Suspend_Error_Messages = 0; if (NULL == (Default_Error_Queue = _pSLerr_new_error_queue (1))) return -1; } if (-1 == init_exceptions ()) return -1; return 0; }
int _pSLang_push_error_context (void) { Error_Context_Type *c; if (NULL == (c = (Error_Context_Type *)SLmalloc (sizeof (Error_Context_Type)))) return -1; c->next = Error_Context; c->err = _pSLang_Error; c->err_cleared = 0; c->rethrow = 0; c->file = File_With_Error; c->function = Function_With_Error; /* steal pointers */ c->linenum = Linenum_With_Error; c->err_queue = Error_Message_Queue; File_With_Error = NULL; Function_With_Error = NULL; Linenum_With_Error = -1; if (NULL == (Error_Message_Queue = _pSLerr_new_error_queue (1))) { Error_Message_Queue = c->err_queue; SLfree ((char *) c); return -1; } Error_Context = c; SLKeyBoard_Quit = 0; c->object_was_thrown = (Object_Thrownp != NULL); if (c->object_was_thrown) { c->object_thrown = Object_Thrown; Object_Thrownp = NULL; } if (-1 == SLang_set_error (0)) { _pSLang_pop_error_context (1); return -1; } return 0; }