Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Types without Info is a dreadful waste

Closed / Fixed218401ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:57:08
OriginalBugID: 5294 RFE
Version: 8.3
SubmitDate: '2000-04-28'
LastModified: '2000-05-17'
Severity: MED
Status: Closed
Submitter: techsupp
ChangedBy: hobbs
OS: All
FixedDate: '2000-10-25'
ClosedDate: '2000-05-17'


Name:
Graham Swallow

DesiredBehavior:
What is the use of defining your own type, but not being able to
add your own information, in the objects type record?
obj->typePtr->*  should look like this

typedef struct Tcl_ObjType {
    char *name; 
    Tcl_FreeInternalRepProc *freeIntRepProc;
    Tcl_DupInternalRepProc *dupIntRepProc;
    Tcl_UpdateStringProc *updateStringProc;
    Tcl_SetFromAnyProc *setFromAnyProc;
// add these
ClientData ExtnMgr; // MUST be unique pointer
ClientDataItem_Type_Info; // no free requred
} Tcl_ObjType;

Both might be NULL for core components, or extensions,

ExtnMgr must be unique (or null), and has no usefulness except for
if( ExtnMgr == MyExtnMgr )  {
// its worth looking at the Item_type_info->*
// and the format there is *my* format
}

Item_type_Info belongs to my extension manager, it is the useful part.
It gives info on a per-type basis. 

Without this being a part of obj->typePtr, I have to use some slow/clumsy mechanism.

Changes to the Tcl Core:
redefine that struct
and init it NULL in RegisterObj
add RegisterObjWithoutClearingExtnFields
plus future "RegisterObj" wont clear fields after 9.0 

ExtnMgr "must be" a pointer so that is is guaranteed to be unique (or null)
but it remains as opaque ClientData to all other extensions. No delete required ?

Graham



It was pointed out in discussion on the newsgroup that use of
extended objects provides the necessary functionality:
  http://x34.deja.com/=dnc/getdoc.xp?AN=616571207 
-- 05/17/2000 hobbs
welch Closed ticket [218401ffff]. [History diff]2000-10-26 08:21:17
Log in (anonymous is fine) to add a comment.