예제 #1
0
// Function throws an Exception
void runtimeThrow(const char* file, int line,
                  const char* function,
                  long error)
{
    ASSERT(NULL != file, "runtimeThrow");
    ASSERT(0 < line, "runtimeThrow");
    ASSERT(NULL != function, "runtimeThrow");
    ASSERT(0 != error, "runtimeThrow");

    while (runtimeLast
           && runtimeLast->autorelease)
        runtimeCleanup(runtimeLast);

    if (!runtimeLast) {
        char buffer[128];
        StrPrintF(buffer, "%s: Unhandled "
                          "exception %08lX "
                          "(%s:%i)",
                  function, error, file, line);
        ErrAlertCustom(0, buffer, "", "");
        SysReset();
    }

    runtimeLast->file = file;
    runtimeLast->line = line;
    runtimeLast->error = error;
    runtimeLast->function = function;
    ErrLongJump(runtimeLast->jumpbuf, 1);
};
예제 #2
0
void exit(Int16 status) {
    EventType event;
    event.eType = keyDownEvent;

    event.data.keyDown.chr = vchrLaunch;
    event.data.keyDown.modifiers = commandKeyMask;
#ifdef PALMOS_ARM
    SysEventAddUniqueToQueue(&event, 0, true);
#else
    EvtAddUniqueEventToQueue(&event, 0, true);
#endif

    ErrLongJump(stdlib_errJumpBuf, status == 0 ? 0xDADA : status);
}
예제 #3
0
/************************************************************
 *
 *  FUNCTION: ErrThrow
 *
 *  DESCRIPTION: A Throw causes a jump to the nearest Catch block.
 *
 *  PARAMETERS: error code
 *
 *  RETURNS: never returns
 *
 *  CREATED: 3/2/95
 *
 *  BY: Ron Marianetti
 *
 *************************************************************/
void ErrThrow(Int32 err)
{
	ErrExceptionType*	tryP;
	
	tryP = (ErrExceptionPtr)*ErrExceptionList();
	
	if (tryP) {
		tryP->err = err;
		ErrLongJump(tryP->state, 1);
		}
		
	else {
		ErrDisplay("ErrThrow called without a pending ErrTry");
		}

}