summaryrefslogtreecommitdiffstats
path: root/doc/SetVar.3
diff options
context:
space:
mode:
Diffstat (limited to 'doc/SetVar.3')
-rw-r--r--doc/SetVar.333
1 files changed, 6 insertions, 27 deletions
diff --git a/doc/SetVar.3 b/doc/SetVar.3
index 9d8e0b7..e0eb51e 100644
--- a/doc/SetVar.3
+++ b/doc/SetVar.3
@@ -4,7 +4,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-'\"
+'\"
.TH Tcl_SetVar 3 8.1 Tcl "Tcl Library Procedures"
.so man.macros
.BS
@@ -57,7 +57,7 @@ to specify a variable in a particular namespace.
If non-NULL, gives name of element within array; in this
case \fIname1\fR must refer to an array variable.
.AP Tcl_Obj *newValuePtr in
-Points to a Tcl value containing the new value for the variable.
+Points to a Tcl object containing the new value for the variable.
.AP int flags in
OR-ed combination of bits providing additional information. See below
for valid values.
@@ -71,12 +71,12 @@ an array.
New value for variable, specified as a null-terminated string.
A copy of this value is stored in the variable.
.AP Tcl_Obj *part1Ptr in
-Points to a Tcl value containing the variable's name.
+Points to a Tcl object containing the variable's name.
The name may include a series of \fB::\fR namespace qualifiers
to specify a variable in a particular namespace.
May refer to a scalar variable or an element of an array variable.
.AP Tcl_Obj *part2Ptr in
-If non-NULL, points to a value containing the name of an element
+If non-NULL, points to an object containing the name of an element
within an array and \fIpart1Ptr\fR must refer to an array variable.
.BE
@@ -86,7 +86,7 @@ These procedures are used to create, modify, read, and delete
Tcl variables from C code.
.PP
\fBTcl_SetVar2Ex\fR, \fBTcl_SetVar\fR, \fBTcl_SetVar2\fR, and
-\fBTcl_ObjSetVar2\fR
+\fBTcl_ObjSetVar2\fR
will create a new variable or modify an existing one.
These procedures set the given variable to the value
given by \fInewValuePtr\fR or \fInewValue\fR and return a
@@ -242,29 +242,8 @@ but the array remains.
If an array name is specified without an index, then the entire
array is removed.
-.SH "REFERENCE COUNT MANAGEMENT"
-.PP
-The result of \fBTcl_SetVar2Ex\fR, \fBTcl_ObjSetVar2\fR, \fBTcl_GetVar2Ex\fR,
-and \fBTcl_ObjGetVar2\fR is (if non-NULL) a value with a reference of at least
-1, where that reference is held by the variable that the function has just
-operated upon.
-.PP
-The \fInewValuePtr\fR argument to \fBTcl_SetVar2Ex\fR and \fBTcl_ObjSetVar2\fR
-may be an arbitrary reference count value. Its reference count is
-incremented on success. On failure, if its reference count is zero, it is
-decremented and freed so the caller need do nothing with it.
-.PP
-The \fIpart1Ptr\fR argument to \fBTcl_ObjSetVar2\fR and \fBTcl_ObjGetVar2\fR can
-have any reference count. These functions never modify it.
-.PP
-The \fIpart2Ptr\fR argument to \fBTcl_ObjSetVar2\fR and \fBTcl_ObjGetVar2\fR, if
-non-NULL, should not have a zero reference count as these functions may
-retain a reference to it, particularly when it is used to create an array
-element that did not previously exist, and decrementing the reference count
-later would leave them pointing to a freed Tcl_Obj.
-
.SH "SEE ALSO"
Tcl_GetObjResult, Tcl_GetStringResult, Tcl_TraceVar
.SH KEYWORDS
-array, get variable, interpreter, scalar, set, unset, value, variable
+array, get variable, interpreter, object, scalar, set, unset, variable