Artifacts Associated With Ticket 218574ffffffffff
Ticket change [04d2a7b96e] (rid 88941) by nobody on 2000-10-26 01:02:37:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
OriginalBugID: 1263 RFE Version: 8.1b1 SubmitDate: '1999-02-23' LastModified: '1999-03-17' Severity: LOW Status: Released Submitter: pat ChangedBy: stanton OS: Other Machine: NA FixedDate: '1999-03-17' FixedInVersion: 8.1b2 ClosedDate: '2000-10-25' Name: Kevin B. Kenny CVS: * RCS: @(#) $Id: tclVar.c,v 1.1.2.3 1998/11/06 21:51:57 stanton Exp $ DesiredBehavior: It seems a bit gratuitous to eliminate Tcl_ObjGetVar2 and Tcl_ObjSetVar2 from Tcl 8.1. Since Tcl strings are once again null terminated (with UTF-8 used to represent embedded multibyte characters that contain nulls), it would appear safe to implement them as straightforward wrappers around the new Tcl_GetObjVar2 and Tcl_SetObjVar2 functions. That change would avoid breaking a fair amount of existing code. Patch: I've just been adding the following in a separate source file so as not to hack up the Tcl core. It should probably go in tclVar.c, and of course the functions should go back into tcl.h. /* * Tcl_ObjSetVar2 -- * *Given a two-part variable name, which may refer to either a scalar *variable or an element of an array, change the value of the variable *to a new Tcl object value. If the named scalar or array element *doesn't exist, then create it. * * Results: *Returns a pointer to the Tcl_Obj structure that holds the new *value of the variable. If the write operation was disallowed *because an array was expected but a scalar was found (or vice *versa), or because a write trace failed, then NULL is returned. *If the TCL_LEAVE_ERR_MSG flag is set, then an explanatory message *is left in the interpreter's result. Note that the returned object *may not be the same one that was passed in newValuePtr, nor need *it have the same value; write traces could have modified the *value of the variable before Tcl_ObjSetVar2 returns. * * Side effects: *The value of the variable is set. If either the array or the *entry didn't exist, then a new variable is created. * * This function is simply a wrapper around Tcl_SetObjVar2, provided * for compatibility with Tcl 8.0. * *---------------------------------------------------------------------- */ Tcl_Obj* Tcl_ObjSetVar2( interp, part1Ptr, part2Ptr, newValuePtr, flags ) Tcl_Interp* interp;/* Tcl interpreter */ Tcl_Obj* part1Ptr;/* Part 1 of the variable name */ Tcl_Obj* part2Ptr;/* Part 2 of the variable name */ Tcl_Obj* newValuePtr;/* New value of the variable */ int flags;/* OR-ed combination of bits providing * additional information for the operation. */ { return Tcl_SetObjVar2( interp, Tcl_GetString( part1Ptr ), Tcl_GetString( part2Ptr ), newValuePtr, flags ); } /* *---------------------------------------------------------------------- * * Tcl_GetObjVar2 -- * *Return the value of a Tcl variable as a Tcl object, given a *two-part name consisting of array name and element within array. * * Results: *The return value points to the current object value of the variable *given by part1Ptr and part2Ptr. If the specified variable doesn't *exist, or if there is a clash in array usage, then NULL is returned *and a message will be left in the interpreter's result if the *TCL_LEAVE_ERR_MSG flag is set. * * Side effects: *The ref count for the returned object is _not_ incremented to *reflect the returned reference; if you want to keep a reference to *the object you must increment its ref count yourself. * *---------------------------------------------------------------------- */ Tcl_Obj* Tcl_ObjGetVar2( interp, part1Ptr, part2Ptr, flags ) Tcl_Interp* interp;/* Tcl interpreter */ Tcl_Obj* part1;/* Name of the array or variable */ Tcl_Obj* part2;/* Subscript in the array, or NULL */ int flags;/* OR-ed combination of bits providing * additional information for the operation. */ { return Tcl_GetObjVar2( interp, Tcl_GetString( part1Ptr ), Tcl_GetString( part2Ptr ), flags ); } 03/17/1999 17:50 - stanton - Obj*Var2 interfaces were added back to 8.1b2 - foundin initialized to: "obsolete: 8.1b1"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "69. Other"
- title initialized to: "Tcl_ObjGetVar2 and Tcl_ObjSetVar2"
- type initialized to: "Bug"
Ticket change [513524f4d0] (rid 126097) by welch on 2000-10-26 08:24:15:
- closedate changed to: "2000-10-26T01:24:15"
- closer changed to: "welch"
- priority changed to: "2"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [c6c25c78cc] (rid 121820) by dgp on 2001-04-17 04:54:28:
- closedate changed to: "2001-04-16T21:54:28"
- closer changed to: "dgp"
- subsystem changed to: "07. Variables"