/*------------------------------------------------------------------------*/ void C2F(setprlev)( int *pause) { if ( *pause == 0 ) { sprintf(Sci_Prompt, SCIPROMPT); } else if ( *pause > 0 ) { if (dispWarningLevelPrompt) { if (getWarningMode()) { sciprint(_("Type '%s' or '%s' to return to standard level prompt.\n\n"), "resume", "abort"); dispWarningLevelPrompt = FALSE; } } sprintf(Sci_Prompt, SCIPROMPT_INTERRUPT, *pause); // bug 5513 // when we change prompt to a pause level, we change also temp. prompt SetTemporaryPrompt(Sci_Prompt); } else { sprintf(Sci_Prompt, SCIPROMPT_PAUSE); // bug 5513 // when we change prompt to halt level, we change also temp. prompt SetTemporaryPrompt(Sci_Prompt); } }
/*------------------------------------------------------------------------*/ void setPreviousLevel(int pause) { //debugger prompt first ! if (isEnableDebug()) { if (isDebugInterrupted()) { Sci_Prompt = SCIPROMPTBREAK; } else { Sci_Prompt = SCIPROMPTDEBUG; } } else if (pause == 0) { if (temporaryPrompt.empty() == false) { Sci_Prompt = temporaryPrompt; ClearTemporaryPrompt(); } else { Sci_Prompt = SCIPROMPT; } } else if (pause > 0) { if (dispWarningLevelPrompt) { if (getWarningMode()) { sciprint(_("Type '%s' or '%s' to return to standard level prompt.\n\n"), "resume", "abort"); dispWarningLevelPrompt = FALSE; } } char t[50]; sprintf(t, SCIPROMPT_INTERRUPT, pause); Sci_Prompt = t; // bug 5513 // when we change prompt to a pause level, we change also temp. prompt //SetTemporaryPrompt(Sci_Prompt); } else { Sci_Prompt = SCIPROMPT_PAUSE; // bug 5513 // when we change prompt to halt level, we change also temp. prompt SetTemporaryPrompt(Sci_Prompt.data()); } }
/*------------------------------------------------------------------------*/ void C2F(setprlev)( int *pause) { //debugger prompt first ! if (isEnableDebug()) { if (isDebugInterrupted()) { sprintf(Sci_Prompt, SCIPROMPTBREAK); } else { sprintf(Sci_Prompt, SCIPROMPTDEBUG); } } else if ( *pause == 0 ) { if (temporaryPrompt != NULL) { strcpy(Sci_Prompt, temporaryPrompt); ClearTemporaryPrompt(); } else { sprintf(Sci_Prompt, SCIPROMPT); } } else if ( *pause > 0 ) { if (dispWarningLevelPrompt) { if (getWarningMode()) { sciprint(_("Type '%s' or '%s' to return to standard level prompt.\n\n"), "resume", "abort"); dispWarningLevelPrompt = FALSE; } } sprintf(Sci_Prompt, SCIPROMPT_INTERRUPT, *pause); // bug 5513 // when we change prompt to a pause level, we change also temp. prompt //SetTemporaryPrompt(Sci_Prompt); } else { sprintf(Sci_Prompt, SCIPROMPT_PAUSE); // bug 5513 // when we change prompt to halt level, we change also temp. prompt SetTemporaryPrompt(Sci_Prompt); } }
/*--------------------------------------------------------------------------*/ int sci_prompt(char *fname, unsigned long fname_len) { char currentPrompt[PROMPT_SIZE_MAX]; static int n1 = 0, m1 = 0, l1 = 0; int outIndex = 0 ; CheckRhs(0, 1); CheckLhs(0, 2); if (Rhs == 0) /* Get current Scilab prompt */ { GetCurrentPrompt(currentPrompt); m1 = (int)strlen(currentPrompt); n1 = 1; CreateVar( Rhs + 1, STRING_DATATYPE, &m1, &n1, &outIndex); strcpy(cstk(outIndex), currentPrompt); if (Lhs == 2) { m1 = 1; n1 = 1; l1 = 0; CreateVar( Rhs + 2, MATRIX_OF_INTEGER_DATATYPE, &m1, &n1, &l1 ); *istk(l1) = (int)C2F(recu).paus ; } LhsVar(1) = Rhs + 1; if (Lhs == 2) { LhsVar(2) = Rhs + 2; } PutLhsVar(); } else /* Tempory change of Scilab prompt */ { if (Lhs <= 1) { if (VarType(1) != sci_strings) { Scierror(999, _("%s: Wrong type for input argument #%d: A string expected.\n"), fname, 1); return FALSE; } GetRhsVar(1, STRING_DATATYPE, &m1, &n1, &l1); if (n1 != 1) { Scierror(999, _("%s: Wrong size for input argument #%d: A string expected.\n"), fname, 1); return FALSE; } SetTemporaryPrompt(cstk(l1)); LhsVar(1) = 0; PutLhsVar(); } else { Scierror(999, _("%s: Wrong number of output argument(s).\n"), fname); } } return 0; }