/* GetOptionMap -- * Return a cached OptionMap matching the specified optionTable * for the specified element, creating it if necessary. */ static OptionMap GetOptionMap(ElementImpl *elementImpl, Tk_OptionTable optionTable) { OptionMap optionMap; int isNew; Tcl_HashEntry *entryPtr = Tcl_CreateHashEntry( &elementImpl->optMapCache, (ClientData)optionTable, &isNew); if (isNew) { optionMap = BuildOptionMap(elementImpl, optionTable); Tcl_SetHashValue(entryPtr, optionMap); } else { optionMap = (OptionMap)(Tcl_GetHashValue(entryPtr)); } return optionMap; }
/* GetOptionMap -- * Return a cached OptionMap matching the specified optionTable * for the specified element, creating it if necessary. */ static OptionMap GetOptionMap(Ttk_ElementClass *elementClass, Tk_OptionTable optionTable) { OptionMap optionMap; int isNew; Tcl_HashEntry *entryPtr = Tcl_CreateHashEntry( &elementClass->optMapCache, (void*)optionTable, &isNew); if (isNew) { optionMap = BuildOptionMap(elementClass, optionTable); Tcl_SetHashValue(entryPtr, optionMap); } else { optionMap = Tcl_GetHashValue(entryPtr); } return optionMap; }