Index: generic/nsf.c =================================================================== diff -u -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 { } */