Index: TODO =================================================================== diff -u -N -r299a221ba9d77636fdd3b6bd41a0927735826136 -r308a9122fcd679ed416ce55670ea93aab4b87478 --- TODO (.../TODO) (revision 299a221ba9d77636fdd3b6bd41a0927735826136) +++ TODO (.../TODO) (revision 308a9122fcd679ed416ce55670ea93aab4b87478) @@ -5829,6 +5829,12 @@ therefore the configure name was not changed - Remove occurrences of deprecated Tcl Call Tcl_AppendResult() in overall code +- Remove unused NsfObjInfoObjectparameterMethod() + (:nsf::methods::object::info::objectparameter). Makes CID 88775 + obsolete. Entails removal of the then unused NsfParamDefsFilter() + (which has been effectively replaced by performed by + ::nsf::parameter::filter at the script level). + ======================================================================== TODO: - maybe add "nsf::configure logSeverity" as a new name for "debugLevel" Index: generic/nsf.c =================================================================== diff -u -N -r90559741eea6829e9bf09560d136759813b0dbdd -r308a9122fcd679ed416ce55670ea93aab4b87478 --- generic/nsf.c (.../nsf.c) (revision 90559741eea6829e9bf09560d136759813b0dbdd) +++ generic/nsf.c (.../nsf.c) (revision 308a9122fcd679ed416ce55670ea93aab4b87478) @@ -11298,66 +11298,6 @@ } /*---------------------------------------------------------------------- - * NsfParamDefsFilter -- - * - * Process a list of ParamDefs and return a subset of it matching the - * provided pattern. If no parameter name matches the pattern, NULL is - * returned. The client is supposed to FREE the returned parameter list - * (entries are shared, a free of the returned pointer is sufficient). - * - * Results: - * Parameter definitions or NULL - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ -static Nsf_Param *NsfParamDefsFilter(Tcl_Interp *interp, Nsf_Param const *paramsPtr, const char *pattern) - nonnull(1) nonnull(2) nonnull(3); - -static Nsf_Param * -NsfParamDefsFilter(Tcl_Interp *interp, Nsf_Param const *paramsPtr, const char *pattern) { - static Nsf_Param *paramList = NULL; - Nsf_Param const *pPtr; - int maxParams, nrMatchingParams; - - /* - * If a single parameter or pattern name is given, we construct a filtered - * parameter list on the fly and we return it - */ - - /* - * Count the parameters - */ - for (pPtr = paramsPtr, maxParams = 0; pPtr->name != NULL; pPtr++, maxParams++) { - ; - } - - /* - * Allocate the number of potentional matches - */ - paramList = ParamsNew(maxParams); - - for (pPtr = paramsPtr, nrMatchingParams = 0; pPtr->name != NULL; pPtr++) { - if (Tcl_StringMatch( ObjStr(pPtr->nameObj), pattern)) { - paramList[nrMatchingParams] = *pPtr; - nrMatchingParams++; - } - } - - if (nrMatchingParams == 0) { - /* - * The named parameter were NOT found, so return NULL - */ - FREE(Nsf_Param*, paramList); - paramList = NULL; - } - - return paramList; -} - -/*---------------------------------------------------------------------- * NsfParamDefsNonposLookup -- * * Process a list of ParamDefs look for a nonpos args. If there is no exact @@ -30463,78 +30403,6 @@ } /* -objectInfoMethod objectparameter NsfObjInfoObjectparameterMethod { - {-argName "infoobjectparametersubcmd" -type "definitions|list|names|syntax" -required 1} - {-argName "pattern" -required 0} -} -*/ -/* - * Actually, this method (object::info::objectparameter) is not used anymore. - */ -static int -NsfObjInfoObjectparameterMethod(Tcl_Interp *interp, NsfObject *object, - InfoobjectparametersubcmdIdx_t subcmd, const char *pattern) { - NsfParsedParam parsedParam; - Tcl_Obj *listObj = NULL; - Nsf_Param const *paramsPtr; - Nsf_Param *paramList = NULL; - int result; - - nonnull_assert(interp != NULL); - nonnull_assert(object != NULL); - - result = GetObjectParameterDefinition(interp, NsfGlobalObjs[NSF_EMPTY], - object, NULL, &parsedParam); - - if (result != TCL_OK || parsedParam.paramDefs == NULL) { - return result; - } - - paramsPtr = parsedParam.paramDefs->paramsPtr; - - if (pattern != NULL) { - paramList = NsfParamDefsFilter(interp, paramsPtr, pattern); - if (unlikely(paramList == NULL)) { - /* - * The named parameter were NOT found, so return "". - */ - Tcl_SetObjResult(interp, NsfGlobalObjs[NSF_EMPTY]); - return TCL_OK; - } - /* Iterate below over the computed selection */ - paramsPtr = paramList; - } - - switch (subcmd) { - case InfoobjectparametersubcmdDefinitionsIdx: - listObj = ParamDefsFormat(interp, paramsPtr, NULL, NULL); - break; - case InfoobjectparametersubcmdListIdx: - listObj = ParamDefsList(interp, paramsPtr, NULL, NULL); - break; - case InfoobjectparametersubcmdNamesIdx: - listObj = ParamDefsNames(interp, paramsPtr, NULL, NULL); - break; - case InfoobjectparametersubcmdSyntaxIdx: - listObj = NsfParamDefsSyntax(interp, paramsPtr, NULL, NULL); - break; - case InfoobjectparametersubcmdNULL: - /* do nothing; just for detection if option was specfied */ - break; - } - assert(listObj != NULL); - - Tcl_SetObjResult(interp, listObj); - - DECR_REF_COUNT2("paramDefsObj", listObj); - if (paramList != NULL) { - FREE(Nsf_Param*, paramList); - } - - return TCL_OK; -} - -/* objectInfoMethod parent NsfObjInfoParentMethod { } */ Index: generic/nsfAPI.decls =================================================================== diff -u -N -raa5b3f4293624fedf641985718ab15c82f5daf78 -r308a9122fcd679ed416ce55670ea93aab4b87478 --- generic/nsfAPI.decls (.../nsfAPI.decls) (revision aa5b3f4293624fedf641985718ab15c82f5daf78) +++ generic/nsfAPI.decls (.../nsfAPI.decls) (revision 308a9122fcd679ed416ce55670ea93aab4b87478) @@ -528,10 +528,7 @@ } objectInfoMethod parent NsfObjInfoParentMethod { } -objectInfoMethod objectparameter NsfObjInfoObjectparameterMethod { - {-argName "subcmd" -typeName "infoobjectparametersubcmd" -type "definitions|list|names|syntax" -required 1} - {-argName "pattern" -required 0} -} + objectInfoMethod precedence NsfObjInfoPrecedenceMethod { {-argName "-intrinsic" -nrargs 0 -type switch} {-argName "pattern" -required 0} Index: generic/nsfAPI.h =================================================================== diff -u -N -raa5b3f4293624fedf641985718ab15c82f5daf78 -r308a9122fcd679ed416ce55670ea93aab4b87478 --- generic/nsfAPI.h (.../nsfAPI.h) (revision aa5b3f4293624fedf641985718ab15c82f5daf78) +++ generic/nsfAPI.h (.../nsfAPI.h) (revision 308a9122fcd679ed416ce55670ea93aab4b87478) @@ -259,22 +259,8 @@ return result; } -typedef enum {InfoobjectparametersubcmdNULL, InfoobjectparametersubcmdDefinitionsIdx, InfoobjectparametersubcmdListIdx, InfoobjectparametersubcmdNamesIdx, InfoobjectparametersubcmdSyntaxIdx} InfoobjectparametersubcmdIdx_t; -static int ConvertToInfoobjectparametersubcmd(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, - ClientData *clientData, Tcl_Obj **outObjPtr) { - int index, result; - static const char *opts[] = {"definitions", "list", "names", "syntax", NULL}; - (void)pPtr; - result = Tcl_GetIndexFromObj(interp, objPtr, opts, "infoobjectparametersubcmd", 0, &index); - *clientData = (ClientData) INT2PTR(index + 1); - *outObjPtr = objPtr; - return result; -} - - static Nsf_EnumeratorConverterEntry enumeratorConverterEntries[] = { - {ConvertToInfoobjectparametersubcmd, "definitions|list|names|syntax"}, {ConvertToInfomethodsubcmd, "args|body|definition|exists|registrationhandle|definitionhandle|origin|parameter|syntax|type|precondition|postcondition|submethods|returns"}, {ConvertToCallprotection, "all|public|protected|private"}, {ConvertToMethodtype, "all|scripted|builtin|alias|forwarder|object|setter|nsfproc"}, @@ -295,7 +281,7 @@ /* just to define the symbol */ -static Nsf_methodDefinition method_definitions[115]; +static Nsf_methodDefinition method_definitions[114]; static const char *method_command_namespace_names[] = { "::nsf::methods::object::info", @@ -521,8 +507,6 @@ NSF_nonnull(1) NSF_nonnull(2) NSF_nonnull(4); static int NsfObjInfoNameMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST* objv) NSF_nonnull(1) NSF_nonnull(2) NSF_nonnull(4); -static int NsfObjInfoObjectparameterMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST* objv) - NSF_nonnull(1) NSF_nonnull(2) NSF_nonnull(4); static int NsfObjInfoParentMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST* objv) NSF_nonnull(1) NSF_nonnull(2) NSF_nonnull(4); static int NsfObjInfoPrecedenceMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST* objv) @@ -750,8 +734,6 @@ NSF_nonnull(1) NSF_nonnull(2); static int NsfObjInfoNameMethod(Tcl_Interp *interp, NsfObject *obj) NSF_nonnull(1) NSF_nonnull(2); -static int NsfObjInfoObjectparameterMethod(Tcl_Interp *interp, NsfObject *obj, InfoobjectparametersubcmdIdx_t subcmd, const char *pattern) - NSF_nonnull(1) NSF_nonnull(2); static int NsfObjInfoParentMethod(Tcl_Interp *interp, NsfObject *obj) NSF_nonnull(1) NSF_nonnull(2); static int NsfObjInfoPrecedenceMethod(Tcl_Interp *interp, NsfObject *obj, int withIntrinsic, const char *pattern) @@ -871,7 +853,6 @@ NsfObjInfoMixinguardMethodIdx, NsfObjInfoMixinsMethodIdx, NsfObjInfoNameMethodIdx, - NsfObjInfoObjectparameterMethodIdx, NsfObjInfoParentMethodIdx, NsfObjInfoPrecedenceMethodIdx, NsfObjInfoSlotobjectsMethodIdx, @@ -3405,31 +3386,6 @@ } static int -NsfObjInfoObjectparameterMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST* objv) { - ParseContext pc; - NsfObject *obj; - - NSF_nonnull_assert(clientData != NULL); - assert(objc > 0); - - obj = (NsfObject *)clientData; - if (likely(ArgumentParse(interp, objc, objv, obj, objv[0], - method_definitions[NsfObjInfoObjectparameterMethodIdx].paramDefs, - method_definitions[NsfObjInfoObjectparameterMethodIdx].nrParameters, 0, NSF_ARGPARSE_BUILTIN, - &pc) == TCL_OK)) { - InfoobjectparametersubcmdIdx_t subcmd = (InfoobjectparametersubcmdIdx_t )pc.clientData[0]; - const char *pattern = (const char *)pc.clientData[1]; - - assert(pc.status == 0); - return NsfObjInfoObjectparameterMethod(interp, obj, subcmd, pattern); - - } else { - - return TCL_ERROR; - } -} - -static int NsfObjInfoParentMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST* objv) { NsfObject *obj; @@ -3523,7 +3479,7 @@ } } -static Nsf_methodDefinition method_definitions[115] = { +static Nsf_methodDefinition method_definitions[114] = { {"::nsf::methods::class::alloc", NsfCAllocMethodStub, 1, { {"objectName", NSF_ARG_REQUIRED, 1, Nsf_ConvertTo_Tclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, @@ -4003,10 +3959,6 @@ {"::nsf::methods::object::info::name", NsfObjInfoNameMethodStub, 0, { {NULL, 0, 0, NULL, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, -{"::nsf::methods::object::info::objectparameter", NsfObjInfoObjectparameterMethodStub, 2, { - {"subcmd", NSF_ARG_REQUIRED|NSF_ARG_IS_ENUMERATION, 1, ConvertToInfoobjectparametersubcmd, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, - {"pattern", 0, 1, Nsf_ConvertTo_String, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} -}, {"::nsf::methods::object::info::parent", NsfObjInfoParentMethodStub, 0, { {NULL, 0, 0, NULL, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, Index: generic/nsfAPI.nxdocindex =================================================================== diff -u -N -r21686b86d06844eca86086b9f9391d77d54dbc06 -r308a9122fcd679ed416ce55670ea93aab4b87478 --- generic/nsfAPI.nxdocindex (.../nsfAPI.nxdocindex) (revision 21686b86d06844eca86086b9f9391d77d54dbc06) +++ generic/nsfAPI.nxdocindex (.../nsfAPI.nxdocindex) (revision 308a9122fcd679ed416ce55670ea93aab4b87478) @@ -95,7 +95,6 @@ set ::nxdoc::include(::nsf::methods::object::info::mixinguard) 0 set ::nxdoc::include(::nsf::methods::object::info::name) 0 set ::nxdoc::include(::nsf::methods::object::info::parent) 0 -set ::nxdoc::include(::nsf::methods::object::info::objectparameter) 0 set ::nxdoc::include(::nsf::methods::object::info::precedence) 0 set ::nxdoc::include(::nsf::methods::object::info::slotobjects) 0 set ::nxdoc::include(::nsf::methods::object::info::vars) 0