SaveResult.3
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:2k
- '"
- '" Copyright (c) 1997 by Sun Microsystems, Inc.
- '"
- '" See the file "license.terms" for information on usage and redistribution
- '" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- '"
- '" RCS: @(#) $Id: SaveResult.3,v 1.2 1999/04/16 00:46:33 stanton Exp $
- '"
- .so man.macros
- .TH Tcl_SaveResult 3 8.1 Tcl "Tcl Library Procedures"
- .BS
- .SH NAME
- Tcl_SaveResult, Tcl_RestoreResult, Tcl_DiscardResult - save and restore an interpreter's result
- .SH SYNOPSIS
- .nf
- fB#include <tcl.h>fR
- .sp
- fBTcl_SaveResult(fIinterp, statePtrfB)fR
- .sp
- fBTcl_RestoreResult(fIinterp, statePtrfB)fR
- .sp
- fBTcl_DiscardResult(fIstatePtrfB)fR
- .SH ARGUMENTS
- .AS Tcl_SavedResult statePtr
- .AP Tcl_Interp *interp in
- Interpreter for which state should be saved.
- .AP Tcl_SavedResult *statePtr in
- Pointer to location where interpreter result should be saved or restored.
- .BE
- .SH DESCRIPTION
- .PP
- These routines allows a C procedure to take a snapshot of the current
- interpreter result so that it can be restored after a call
- to fBTcl_EvalfR or some other routine that modifies the interpreter
- result. These routines are passed a pointer to a structure that is
- used to store enough information to restore the interpreter result
- state. This structure can be allocated on the stack of the calling
- procedure. These routines do not save the state of any error
- information in the interpreter (e.g. the fBerrorCodefR or
- fBerrorInfofR variables).
- .PP
- fBTcl_SaveResultfR moves the string and object results
- of fIinterpfR into the location specified by fIstatePtrfR.
- fBTcl_SaveResultfR clears the result for fIinterpfR and
- leaves the result in its normal empty initialized state.
- .PP
- fBTcl_RestoreResultfR moves the string and object results from
- fIstatePtrfR back into fIinterpfR. Any result or error that was
- already in the interpreter will be cleared. The fIstatePtrfR is left
- in an uninitialized state and cannot be used until another call to
- fBTcl_SaveResultfR.
- .PP
- fBTcl_DiscardResultfR releases the saved interpreter state
- stored at fBstatePtrfR. The state structure is left in an
- uninitialized state and cannot be used until another call to
- fBTcl_SaveResultfR.
- .PP
- Once fBTcl_SaveResultfR is called to save the interpreter
- result, either fBTcl_RestoreResultfR or
- fBTcl_DiscardResultfR must be called to properly clean up the
- memory associated with the saved state.
- .SH KEYWORDS
- result, state, interp