From b323b6696d5340e0202d6fc888c404cd232dceec Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 26 Jan 2022 13:33:49 +0000 Subject: Add TclParseArgsObjv_ --- generic/tcl.decls | 4 ++++ generic/tclDecls.h | 12 ++++++++++++ generic/tclStubInit.c | 17 +++++++++++++---- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/generic/tcl.decls b/generic/tcl.decls index e59f841..ebdbac1 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -2464,6 +2464,10 @@ declare 665 { declare 666 { Tcl_Obj *TclFSSplitPath_(Tcl_Obj *pathPtr, size_t *lenPtr) } +declare 667 { + int TclParseArgsObjv_(Tcl_Interp *interp, const Tcl_ArgvInfo *argTable, + size_t *objcPtr, Tcl_Obj *const *objv, Tcl_Obj ***remObjv) +} # ----- BASELINE -- FOR -- 8.7.0 ----- # diff --git a/generic/tclDecls.h b/generic/tclDecls.h index d3728d2..909cb6e 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -1967,6 +1967,11 @@ EXTERN void TclSplitPath_(const char *path, size_t *argcPtr, const char ***argvPtr); /* 666 */ EXTERN Tcl_Obj * TclFSSplitPath_(Tcl_Obj *pathPtr, size_t *lenPtr); +/* 667 */ +EXTERN int TclParseArgsObjv_(Tcl_Interp *interp, + const Tcl_ArgvInfo *argTable, + size_t *objcPtr, Tcl_Obj *const *objv, + Tcl_Obj ***remObjv); typedef struct { const struct TclPlatStubs *tclPlatStubs; @@ -2669,6 +2674,7 @@ typedef struct TclStubs { int (*tclSplitList_) (Tcl_Interp *interp, const char *listStr, size_t *argcPtr, const char ***argvPtr); /* 664 */ void (*tclSplitPath_) (const char *path, size_t *argcPtr, const char ***argvPtr); /* 665 */ Tcl_Obj * (*tclFSSplitPath_) (Tcl_Obj *pathPtr, size_t *lenPtr); /* 666 */ + int (*tclParseArgsObjv_) (Tcl_Interp *interp, const Tcl_ArgvInfo *argTable, size_t *objcPtr, Tcl_Obj *const *objv, Tcl_Obj ***remObjv); /* 667 */ } TclStubs; extern const TclStubs *tclStubsPtr; @@ -4031,6 +4037,8 @@ extern const TclStubs *tclStubsPtr; (tclStubsPtr->tclSplitPath_) /* 665 */ #define TclFSSplitPath_ \ (tclStubsPtr->tclFSSplitPath_) /* 666 */ +#define TclParseArgsObjv_ \ + (tclStubsPtr->tclParseArgsObjv_) /* 667 */ #endif /* defined(USE_TCL_STUBS) */ @@ -4333,6 +4341,10 @@ extern const TclStubs *tclStubsPtr; # define Tcl_FSSplitPath(pathPtr, lenPtr) (sizeof(*lenPtr) == sizeof(int) \ ? tclStubsPtr->tcl_FSSplitPath((pathPtr), (int *)(void *)(lenPtr)) \ : tclStubsPtr->tclFSSplitPath_((pathPtr), (size_t *)(void *)(lenPtr))) +# undef Tcl_ParseArgsObjv +# define Tcl_ParseArgsObjv(interp, argTable, objcPtr, objv, remObjv) (sizeof(*objcPtr) == sizeof(int) \ + ? tclStubsPtr->tcl_ParseArgsObjv((interp), (argTable), (int *)(void *)(objcPtr), (objv), (remObjv)) \ + : tclStubsPtr->tclParseArgsObjv_((interp), (argTable), (size_t *)(void *)(objcPtr), (objv), (remObjv))) #endif /* TCL_NO_DEPRECATED */ #else # define Tcl_WCharToUtfDString (sizeof(wchar_t) != sizeof(short) \ diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 62d2fce..f9987cf 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -129,10 +129,10 @@ static const char *TclUtfPrev(const char *src, const char *start) { #define TclSplitList_ SplitList #define TclSplitPath_ SplitPath #define TclFSSplitPath_ FSSplitPath +#define TclParseArgsObjv_ ParseArgsObjv static int LOGetElements(Tcl_Interp *interp, Tcl_Obj *listPtr, size_t *objcPtr, Tcl_Obj ***objvPtr) { - int n; - int result = Tcl_ListObjGetElements(interp, listPtr, &n, objvPtr); + int n, result = Tcl_ListObjGetElements(interp, listPtr, &n, objvPtr); if (objcPtr) { *objcPtr = n; } @@ -149,8 +149,7 @@ static int LOLength(Tcl_Interp *interp, Tcl_Obj *listPtr, } static int DOSize(Tcl_Interp *interp, Tcl_Obj *dictPtr, size_t *sizePtr) { - int n; - int result = Tcl_DictObjSize(interp, dictPtr, &n); + int n, result = Tcl_DictObjSize(interp, dictPtr, &n); if (sizePtr) { *sizePtr = n; } @@ -180,6 +179,15 @@ static Tcl_Obj *FSSplitPath(Tcl_Obj *pathPtr, size_t *lenPtr) { } return result; } +static int ParseArgsObjv(Tcl_Interp *interp, + const Tcl_ArgvInfo *argTable, size_t *objcPtr, Tcl_Obj *const *objv, + Tcl_Obj ***remObjv) { + int n, result = Tcl_ParseArgsObjv(interp, argTable, &n, objv, remObjv); + if (objcPtr) { + *objcPtr = n; + } + return result; +} #define TclBN_mp_add mp_add #define TclBN_mp_and mp_and @@ -2008,6 +2016,7 @@ const TclStubs tclStubs = { TclSplitList_, /* 664 */ TclSplitPath_, /* 665 */ TclFSSplitPath_, /* 666 */ + TclParseArgsObjv_, /* 667 */ }; /* !END!: Do not edit above this line. */ -- cgit v0.12