diff options
Diffstat (limited to 'generic/tclDictObj.c')
| -rw-r--r-- | generic/tclDictObj.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c index c14536a..b5d6e56 100644 --- a/generic/tclDictObj.c +++ b/generic/tclDictObj.c @@ -1062,6 +1062,26 @@ Tcl_DictObjRemove( /* *---------------------------------------------------------------------- * + * Tcl_DictGetSize + * + * Returns the size of dictPtr. Caller must ensure that dictPtr has type + * 'tclDicttype'. + * + * + *---------------------------------------------------------------------- + */ + +Tcl_Size +TclDictGetSize(Tcl_Obj *dictPtr) +{ + Dict *dict; + DictGetInternalRep(dictPtr, dict); + return dict->table.numEntries; +} + +/* + *---------------------------------------------------------------------- + * * Tcl_DictObjSize -- * * How many key,value pairs are there in the dictionary? |
