globle void InterruptCurrentEnvironment() { #if ALLOW_ENVIRONMENT_GLOBALS EnvSetHaltExecution(GetCurrentEnvironment(),TRUE); CloseAllBatchSources(GetCurrentEnvironment()); #endif }
static void CatchCtrlC( int sgnl) { EnvSetHaltExecution(mainEnv,true); CloseAllBatchSources(mainEnv); signal(SIGINT,CatchCtrlC); }
static int ExitBatch( void *theEnv, int num) { CloseAllBatchSources(theEnv); return(1); }
static void _cdecl CatchCtrlC() { #if ALLOW_ENVIRONMENT_GLOBALS SetHaltExecution(GetCurrentEnvironment(),TRUE); CloseAllBatchSources(GetCurrentEnvironment()); #endif }
static void CatchCtrlC( int sgnl) { #if ALLOW_ENVIRONMENT_GLOBALS SetHaltExecution(GetCurrentEnvironment(),TRUE); CloseAllBatchSources(GetCurrentEnvironment()); #endif signal(SIGINT,CatchCtrlC); }
static void ExitBatchCallback( Environment *theEnv, int num, void *context) { #if MAC_XCD #pragma unused(num,context) #endif CloseAllBatchSources(theEnv); }
static int ExitBatch( void *theEnv, int num) { #if MAC_XCD #pragma unused(num) #endif CloseAllBatchSources(theEnv); return(1); }
void CommandLoopBatchDriver( void *theEnv) { int inchar; while (true) { if (GetHaltCommandLoopBatch(theEnv) == true) { CloseAllBatchSources(theEnv); SetHaltCommandLoopBatch(theEnv,false); } /*===================================================*/ /* If a batch file is active, grab the command input */ /* directly from the batch file, otherwise call the */ /* event function. */ /*===================================================*/ if (BatchActive(theEnv) == true) { inchar = LLGetcBatch(theEnv,STDIN,true); if (inchar == EOF) { return; } else { ExpandCommandString(theEnv,(char) inchar); } } else { return; } /*=================================================*/ /* If execution was halted, then remove everything */ /* from the command buffer. */ /*=================================================*/ if (EnvGetHaltExecution(theEnv) == true) { EnvSetHaltExecution(theEnv,false); EnvSetEvaluationError(theEnv,false); FlushCommandString(theEnv); #if ! WINDOW_INTERFACE fflush(stdin); #endif EnvPrintRouter(theEnv,WPROMPT,"\n"); PrintPrompt(theEnv); } /*=========================================*/ /* If a complete command is in the command */ /* buffer, then execute it. */ /*=========================================*/ ExecuteIfCommandComplete(theEnv); } }
static void CatchCtrlC() { #if ALLOW_ENVIRONMENT_GLOBALS _XSTACK *sf; /* Real-mode interrupt handler stack frame. */ sf = (_XSTACK *) _get_stk_frame(); /* Get pointer to V86 _XSTACK frame. */ SetHaltExecution(GetCurrentEnvironment(),TRUE); /* Terminate execution and */ CloseAllBatchSources(GetCurrentEnvironment()); /* return to the command prompt. */ sf->opts |= _STK_NOINT; /* Set _ST_NOINT to prevent V86 call. */ #endif }