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