summaryrefslogtreecommitdiffstats
path: root/generic/tclDictObj.c
diff options
context:
space:
mode:
authorpooryorick <com.digitalsmarties@pooryorick.com>2023-05-17 12:26:11 (GMT)
committerpooryorick <com.digitalsmarties@pooryorick.com>2023-05-17 12:26:11 (GMT)
commitac555b905c136e91ee92a89d6b225b9a46851e8d (patch)
tree020a6935435777cb8e313cc5268351a1229fed6a /generic/tclDictObj.c
parent599038222278a31912d42c4a6db1aee88052c40b (diff)
downloadtcl-ac555b905c136e91ee92a89d6b225b9a46851e8d.zip
tcl-ac555b905c136e91ee92a89d6b225b9a46851e8d.tar.gz
tcl-ac555b905c136e91ee92a89d6b225b9a46851e8d.tar.bz2
New functions: TclUndoRefCount() and TclDictGetSize().
Diffstat (limited to 'generic/tclDictObj.c')
-rw-r--r--generic/tclDictObj.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c
index f996f4b..c4ff0fa 100644
--- a/generic/tclDictObj.c
+++ b/generic/tclDictObj.c
@@ -1048,6 +1048,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?