diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-01-24 10:00:06 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-01-24 10:00:06 (GMT) |
commit | 16e6b20816194ac97a6a8adb11ab9ca050ee51d7 (patch) | |
tree | 5958654f0a172b87caf4d0e87db0e5051dff21f0 /generic/tclStubInit.c | |
parent | ffb2eeb8d171ebccdb0ed6364f34a415afd2c98a (diff) | |
download | tcl-16e6b20816194ac97a6a8adb11ab9ca050ee51d7.zip tcl-16e6b20816194ac97a6a8adb11ab9ca050ee51d7.tar.gz tcl-16e6b20816194ac97a6a8adb11ab9ca050ee51d7.tar.bz2 |
Extend for Tcl dicts too (API only)
Diffstat (limited to 'generic/tclStubInit.c')
-rw-r--r-- | generic/tclStubInit.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 836eddc..234805c 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -125,6 +125,7 @@ static const char *TclUtfPrev(const char *src, const char *start) { #define TclListObjGetElements_ LOGetElements #define TclListObjLength_ LOLength +#define TclDictObjSize_ DOSize static int LOGetElements(Tcl_Interp *interp, Tcl_Obj *listPtr, size_t *objcPtr, Tcl_Obj ***objvPtr) { int n; @@ -143,6 +144,15 @@ static int LOLength(Tcl_Interp *interp, Tcl_Obj *listPtr, } return result; } +static int DOSize(Tcl_Interp *interp, Tcl_Obj *dictPtr, + size_t *sizePtr) { + int n; + int result = Tcl_DictObjSize(interp, dictPtr, &n); + if (sizePtr) { + *sizePtr = n; + } + return result; +} #define TclBN_mp_add mp_add #define TclBN_mp_and mp_and @@ -1967,6 +1977,7 @@ const TclStubs tclStubs = { Tcl_AsyncMarkFromSignal, /* 660 */ TclListObjGetElements_, /* 661 */ TclListObjLength_, /* 662 */ + TclDictObjSize_, /* 663 */ }; /* !END!: Do not edit above this line. */ |