TCL9: Tcl_xxxxxxx() API changes around Tcl_SaveResult()
This commit is contained in:
parent
e27b8a9d19
commit
33b9c63c41
|
|
@ -629,7 +629,11 @@ keys_and_buttons:
|
|||
|
||||
if ((LocRedirect == TX_INPUT_REDIRECTED) && TxTkConsole)
|
||||
{
|
||||
#if TCL_MAJOR_VERSION < 9
|
||||
Tcl_SavedResult state;
|
||||
#else
|
||||
Tcl_InterpState state;
|
||||
#endif
|
||||
static char outstr[] = "::tkcon::Insert .text \"x\" ";
|
||||
|
||||
switch (keysym)
|
||||
|
|
@ -644,12 +648,20 @@ keys_and_buttons:
|
|||
TxInputRedirect = TX_INPUT_NORMAL;
|
||||
TxSetPrompt('%');
|
||||
|
||||
#if TCL_MAJOR_VERSION < 9
|
||||
Tcl_SaveResult(magicinterp, &state);
|
||||
#else
|
||||
state = Tcl_SaveInterpState(magicinterp, TCL_OK);
|
||||
#endif
|
||||
Tcl_EvalEx(magicinterp, "history event 0", 15, 0);
|
||||
MacroDefine(mw->w_client, (int)'.',
|
||||
Tcl_GetStringResult(magicinterp), NULL,
|
||||
FALSE);
|
||||
#if TCL_MAJOR_VERSION < 9
|
||||
Tcl_RestoreResult(magicinterp, &state);
|
||||
#else
|
||||
Tcl_RestoreInterpState(magicinterp, state);
|
||||
#endif
|
||||
break;
|
||||
case XK_Up:
|
||||
Tcl_EvalEx(consoleinterp, "::tkcon::Event -1",
|
||||
|
|
|
|||
|
|
@ -634,7 +634,11 @@ keys_and_buttons:
|
|||
|
||||
if ((LocRedirect == TX_INPUT_REDIRECTED) && TxTkConsole)
|
||||
{
|
||||
#if TCL_MAJOR_VERSION < 9
|
||||
Tcl_SavedResult state;
|
||||
#else
|
||||
Tcl_InterpState state;
|
||||
#endif
|
||||
static char outstr[] = "::tkcon::Insert .text \"x\" ";
|
||||
|
||||
switch (keysym)
|
||||
|
|
@ -649,12 +653,20 @@ keys_and_buttons:
|
|||
TxInputRedirect = TX_INPUT_NORMAL;
|
||||
TxSetPrompt('%');
|
||||
|
||||
#if TCL_MAJOR_VERSION < 9
|
||||
Tcl_SaveResult(magicinterp, &state);
|
||||
#else
|
||||
state = Tcl_SaveInterpState(magicinterp, TCL_OK);
|
||||
#endif
|
||||
Tcl_EvalEx(magicinterp, "history event 0", 15, 0);
|
||||
MacroDefine(mw->w_client, (int)'.',
|
||||
Tcl_GetStringResult(magicinterp), NULL,
|
||||
FALSE);
|
||||
#if TCL_MAJOR_VERSION < 9
|
||||
Tcl_RestoreResult(magicinterp, &state);
|
||||
#else
|
||||
Tcl_RestoreInterpState(magicinterp, state);
|
||||
#endif
|
||||
break;
|
||||
case XK_Up:
|
||||
Tcl_EvalEx(consoleinterp, "::tkcon::Event -1",
|
||||
|
|
|
|||
|
|
@ -886,7 +886,11 @@ keys_and_buttons:
|
|||
|
||||
if ((LocRedirect == TX_INPUT_REDIRECTED) && TxTkConsole)
|
||||
{
|
||||
#if TCL_MAJOR_VERSION < 9
|
||||
Tcl_SavedResult state;
|
||||
#else
|
||||
Tcl_InterpState state;
|
||||
#endif
|
||||
static char outstr[] = "::tkcon::Insert .text \"x\" ";
|
||||
/* Translate Control-H to BackSpace */
|
||||
if ((keymod & ControlMask) && (keysym == XK_h))
|
||||
|
|
@ -904,13 +908,21 @@ keys_and_buttons:
|
|||
TxInputRedirect = TX_INPUT_NORMAL;
|
||||
TxSetPrompt('%');
|
||||
|
||||
#if TCL_MAJOR_VERSION < 9
|
||||
Tcl_SaveResult(magicinterp, &state);
|
||||
#else
|
||||
state = Tcl_SaveInterpState(magicinterp, TCL_OK);
|
||||
#endif
|
||||
Tcl_EvalEx(magicinterp, "history event 0", 15,
|
||||
0);
|
||||
MacroDefine(mw->w_client, (int)'.',
|
||||
Tcl_GetStringResult(magicinterp), NULL,
|
||||
FALSE);
|
||||
#if TCL_MAJOR_VERSION < 9
|
||||
Tcl_RestoreResult(magicinterp, &state);
|
||||
#else
|
||||
Tcl_RestoreInterpState(magicinterp, state);
|
||||
#endif
|
||||
break;
|
||||
case XK_Up:
|
||||
Tcl_EvalEx(consoleinterp, "::tckon::Event -1",
|
||||
|
|
|
|||
|
|
@ -104,7 +104,11 @@ TagCallback(interp, tkpath, argc, argv)
|
|||
char *postcmd, *substcmd, *newcmd, *sptr, *sres;
|
||||
char *croot;
|
||||
HashEntry *entry;
|
||||
#if TCL_MAJOR_VERSION < 9
|
||||
Tcl_SavedResult state;
|
||||
#else
|
||||
Tcl_InterpState state;
|
||||
#endif
|
||||
bool reset = FALSE;
|
||||
int cmdnum;
|
||||
|
||||
|
|
@ -240,12 +244,28 @@ TagCallback(interp, tkpath, argc, argv)
|
|||
/* fprintf(stderr, "Substituted tag callback is \"%s\"\n", substcmd); */
|
||||
/* fflush(stderr); */
|
||||
|
||||
#if TCL_MAJOR_VERSION < 9
|
||||
Tcl_SaveResult(interp, &state);
|
||||
#else
|
||||
state = Tcl_SaveInterpState(interp, TCL_OK);
|
||||
#endif
|
||||
result = Tcl_EvalEx(interp, substcmd, -1, 0);
|
||||
if ((result == TCL_OK) && (reset == FALSE))
|
||||
{
|
||||
#if TCL_MAJOR_VERSION < 9
|
||||
Tcl_RestoreResult(interp, &state);
|
||||
#else
|
||||
Tcl_RestoreInterpState(interp, state);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
#if TCL_MAJOR_VERSION < 9
|
||||
Tcl_DiscardResult(&state);
|
||||
#else
|
||||
Tcl_DiscardInterpState(state);
|
||||
#endif
|
||||
}
|
||||
|
||||
freeMagic(substcmd);
|
||||
TxCommandNumber = cmdnum; /* restore original value */
|
||||
|
|
@ -858,15 +878,27 @@ void
|
|||
TxSetPrompt(ch)
|
||||
char ch;
|
||||
{
|
||||
#if TCL_MAJOR_VERSION < 9
|
||||
Tcl_SavedResult state;
|
||||
#else
|
||||
Tcl_InterpState state;
|
||||
#endif
|
||||
char promptline[16];
|
||||
|
||||
if (TxTkConsole)
|
||||
{
|
||||
sprintf(promptline, "replaceprompt %c", ch);
|
||||
#if TCL_MAJOR_VERSION < 9
|
||||
Tcl_SaveResult(consoleinterp, &state);
|
||||
#else
|
||||
state = Tcl_SaveInterpState(consoleinterp, TCL_OK);
|
||||
#endif
|
||||
Tcl_EvalEx(consoleinterp, promptline, 15, 0);
|
||||
#if TCL_MAJOR_VERSION < 9
|
||||
Tcl_RestoreResult(consoleinterp, &state);
|
||||
#else
|
||||
Tcl_RestoreInterpState(consoleinterp, state);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -979,11 +1011,23 @@ TxParseString(str, q, event)
|
|||
void
|
||||
TxFlushErr()
|
||||
{
|
||||
#if TCL_MAJOR_VERSION < 9
|
||||
Tcl_SavedResult state;
|
||||
#else
|
||||
Tcl_InterpState state;
|
||||
#endif
|
||||
|
||||
#if TCL_MAJOR_VERSION < 9
|
||||
Tcl_SaveResult(magicinterp, &state);
|
||||
#else
|
||||
state = Tcl_SaveInterpState(magicinterp, TCL_OK);
|
||||
#endif
|
||||
Tcl_EvalEx(magicinterp, "::tcl_flush stderr", 18, 0);
|
||||
#if TCL_MAJOR_VERSION < 9
|
||||
Tcl_RestoreResult(magicinterp, &state);
|
||||
#else
|
||||
Tcl_RestoreInterpState(magicinterp, state);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------*/
|
||||
|
|
@ -991,11 +1035,23 @@ TxFlushErr()
|
|||
void
|
||||
TxFlushOut()
|
||||
{
|
||||
#if TCL_MAJOR_VERSION < 9
|
||||
Tcl_SavedResult state;
|
||||
#else
|
||||
Tcl_InterpState state;
|
||||
#endif
|
||||
|
||||
#if TCL_MAJOR_VERSION < 9
|
||||
Tcl_SaveResult(magicinterp, &state);
|
||||
#else
|
||||
state = Tcl_SaveInterpState(magicinterp, TCL_OK);
|
||||
#endif
|
||||
Tcl_EvalEx(magicinterp, "::tcl_flush stdout", 18, 0);
|
||||
#if TCL_MAJOR_VERSION < 9
|
||||
Tcl_RestoreResult(magicinterp, &state);
|
||||
#else
|
||||
Tcl_RestoreInterpState(magicinterp, state);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue