OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tcl/] [doc/] [UpVar.3] - Diff between revs 578 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 578 Rev 1765
'\"
'\"
'\" Copyright (c) 1994 The Regents of the University of California.
'\" Copyright (c) 1994 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
'\" RCS: @(#) $Id: UpVar.3,v 1.1.1.1 2002-01-16 10:25:24 markom Exp $
'\" RCS: @(#) $Id: UpVar.3,v 1.1.1.1 2002-01-16 10:25:24 markom Exp $
'\"
'\"
.so man.macros
.so man.macros
.TH Tcl_UpVar 3 7.4 Tcl "Tcl Library Procedures"
.TH Tcl_UpVar 3 7.4 Tcl "Tcl Library Procedures"
.BS
.BS
.SH NAME
.SH NAME
Tcl_UpVar, Tcl_UpVar2 \- link one variable to another
Tcl_UpVar, Tcl_UpVar2 \- link one variable to another
.SH SYNOPSIS
.SH SYNOPSIS
.nf
.nf
\fB#include \fR
\fB#include \fR
.sp
.sp
int
int
\fBTcl_UpVar(\fIinterp, frameName, sourceName, destName, flags\fB)\fR
\fBTcl_UpVar(\fIinterp, frameName, sourceName, destName, flags\fB)\fR
.sp
.sp
int
int
\fBTcl_UpVar2(\fIinterp, frameName, name1, name2, destName, flags\fB)\fR
\fBTcl_UpVar2(\fIinterp, frameName, name1, name2, destName, flags\fB)\fR
.SH ARGUMENTS
.SH ARGUMENTS
.AS Tcl_VarTraceProc prevClientData
.AS Tcl_VarTraceProc prevClientData
.AP Tcl_Interp *interp in
.AP Tcl_Interp *interp in
Interpreter containing variables;  also used for error reporting.
Interpreter containing variables;  also used for error reporting.
.AP char *frameName in
.AP char *frameName in
Identifies the stack frame containing source variable.
Identifies the stack frame containing source variable.
May have any of the forms accepted by
May have any of the forms accepted by
the \fBupvar\fR command, such as \fB#0\fR or \fB1\fR.
the \fBupvar\fR command, such as \fB#0\fR or \fB1\fR.
.AP char *sourceName in
.AP char *sourceName in
Name of source variable, in the frame given by \fIframeName\fR.
Name of source variable, in the frame given by \fIframeName\fR.
May refer to a scalar variable or to an array variable with a
May refer to a scalar variable or to an array variable with a
parenthesized index.
parenthesized index.
.AP char *destName in
.AP char *destName in
Name of destination variable, which is to be linked to source
Name of destination variable, which is to be linked to source
variable so that references to \fIdestName\fR
variable so that references to \fIdestName\fR
refer to the other variable.  Must not currently exist except as
refer to the other variable.  Must not currently exist except as
an upvar-ed variable.
an upvar-ed variable.
.AP int flags in
.AP int flags in
Either TCL_GLOBAL_ONLY or 0;  if non-zero, then \fIdestName\fR is
Either TCL_GLOBAL_ONLY or 0;  if non-zero, then \fIdestName\fR is
a global variable;  otherwise it is a local to the current procedure
a global variable;  otherwise it is a local to the current procedure
(or global if no procedure is active).
(or global if no procedure is active).
.AP char *name1 in
.AP char *name1 in
First part of source variable's name (scalar name, or name of array
First part of source variable's name (scalar name, or name of array
without array index).
without array index).
.AP char *name2 in
.AP char *name2 in
If source variable is an element of an array, gives the index of the element.
If source variable is an element of an array, gives the index of the element.
For scalar source variables, is NULL.
For scalar source variables, is NULL.
.BE
.BE
.SH DESCRIPTION
.SH DESCRIPTION
.PP
.PP
\fBTcl_UpVar\fR and \fBTcl_UpVar2\fR provide the same functionality
\fBTcl_UpVar\fR and \fBTcl_UpVar2\fR provide the same functionality
as the \fBupvar\fR command:  they make a link from a source variable
as the \fBupvar\fR command:  they make a link from a source variable
to a destination variable, so that references to the destination are
to a destination variable, so that references to the destination are
passed transparently through to the source.
passed transparently through to the source.
The name of the source variable may be specified either as a single
The name of the source variable may be specified either as a single
string such as \fBxyx\fR or \fBa(24)\fR (by calling \fBTcl_UpVar\fR)
string such as \fBxyx\fR or \fBa(24)\fR (by calling \fBTcl_UpVar\fR)
or in two parts where the array name has been separated from the
or in two parts where the array name has been separated from the
element name (by calling \fBTcl_UpVar2\fR).
element name (by calling \fBTcl_UpVar2\fR).
The destination variable name is specified in a single string;  it
The destination variable name is specified in a single string;  it
may not be an array element.
may not be an array element.
.PP
.PP
Both procedures return either TCL_OK or TCL_ERROR, and they
Both procedures return either TCL_OK or TCL_ERROR, and they
leave an error message in \fIinterp->result\fR if an error
leave an error message in \fIinterp->result\fR if an error
occurs.
occurs.
.PP
.PP
As with the \fBupvar\fR command, the source variable need not exist;
As with the \fBupvar\fR command, the source variable need not exist;
if it does exist, unsetting it later does not destroy the link.  The
if it does exist, unsetting it later does not destroy the link.  The
destination variable may exist at the time of the call, but if so
destination variable may exist at the time of the call, but if so
it must exist as a linked variable.
it must exist as a linked variable.
.SH KEYWORDS
.SH KEYWORDS
linked variable, upvar, variable
linked variable, upvar, variable
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.