Tcl 9.0/Tk9.0 Documentation > Tcl C API > SaveInterpState

Tcl/Tk Applications | Tcl Commands | Tk Commands | [incr Tcl] Package Commands | SQLite3 Package Commands | TDBC Package Commands | tdbc::mysql Package Commands | tdbc::odbc Package Commands | tdbc::postgres Package Commands | tdbc::sqlite3 Package Commands | Thread Package Commands | Tcl C API | Tk C API | [incr Tcl] Package C API | TDBC Package C API

NAME
Tcl_SaveInterpState, Tcl_RestoreInterpState, Tcl_DiscardInterpState — Save and restore the state of an an interpreter.
SYNOPSIS
#include <tcl.h>
Tcl_InterpState
Tcl_SaveInterpState(interp, status)
int
Tcl_RestoreInterpState(interp, state)
Tcl_DiscardInterpState(state)
ARGUMENTS
DESCRIPTION
KEYWORDS

NAME

Tcl_SaveInterpState, Tcl_RestoreInterpState, Tcl_DiscardInterpState — Save and restore the state of an an interpreter.

SYNOPSIS

#include <tcl.h>
Tcl_InterpState
Tcl_SaveInterpState(interp, status)
int
Tcl_RestoreInterpState(interp, state)
Tcl_DiscardInterpState(state)

ARGUMENTS

Tcl_Interp *interp (in)
The interpreter for the operation.

int status (in)
The return code for the state.

Tcl_InterpState state (in)
A token for saved state.

DESCRIPTION

These routines save the state of an interpreter before a call to a routine such as Tcl_Eval, and restore the state afterwards.

Tcl_SaveInterpState saves the parts of interp that comprise the result of a script, including the resulting value, the return code passed as status, and any options such as -errorinfo and -errorcode. It returns a token for the saved state. The interpreter result is not reset and no interpreter state is changed.

Tcl_RestoreInterpState restores the state indicated by state and returns the status originally passed in the corresponding call to Tcl_SaveInterpState.

If a saved state is not restored, Tcl_DiscardInterpState must be called to release it. A token used to discard or restore state must not be used again.

KEYWORDS

result, state, interp
Copyright © 1997 Sun Microsystems, Inc.
Copyright © 2018 Nathan Coulter.