Index: generic/tclAPI.h =================================================================== diff -u -re9d5dd4af67bdeeaa3052f5c010d135d899a6dd6 -r164610e4ee54aad4403b5c8940b22ee6ee4ec58a --- generic/tclAPI.h (.../tclAPI.h) (revision e9d5dd4af67bdeeaa3052f5c010d135d899a6dd6) +++ generic/tclAPI.h (.../tclAPI.h) (revision 164610e4ee54aad4403b5c8940b22ee6ee4ec58a) @@ -51,6 +51,19 @@ return result; } +enum SourceIdx {SourceNULL, SourceAllIdx, SourceApplicationIdx, SourceBaseclassesIdx}; + +static int ConvertToSource(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param CONST *pPtr, + ClientData *clientData, Tcl_Obj **outObjPtr) { + int index, result; + static CONST char *opts[] = {"all", "application", "baseclasses", NULL}; + (void)pPtr; + result = Tcl_GetIndexFromObj(interp, objPtr, opts, "-source", 0, &index); + *clientData = (ClientData) INT2PTR(index + 1); + *outObjPtr = objPtr; + return result; +} + enum FrameIdx {FrameNULL, FrameMethodIdx, FrameObjectIdx, FrameDefaultIdx}; static int ConvertToFrame(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param CONST *pPtr, @@ -142,20 +155,7 @@ return result; } -enum SourceIdx {SourceNULL, SourceAllIdx, SourceApplicationIdx, SourceBaseclassesIdx}; -static int ConvertToSource(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param CONST *pPtr, - ClientData *clientData, Tcl_Obj **outObjPtr) { - int index, result; - static CONST char *opts[] = {"all", "application", "baseclasses", NULL}; - (void)pPtr; - result = Tcl_GetIndexFromObj(interp, objPtr, opts, "-source", 0, &index); - *clientData = (ClientData) INT2PTR(index + 1); - *outObjPtr = objPtr; - return result; -} - - static enumeratorConverterEntry enumeratorConverterEntries[] = { {ConvertToScope, "all|class|object"}, {ConvertToInfomethodsubcmd, "args|body|definition|exists|handle|parameter|parametersyntax|type|precondition|postcondition|submethods"}, @@ -290,7 +290,7 @@ static int NsfClassInfoMixinOfMethod(Tcl_Interp *interp, NsfClass *cl, int withClosure, int withScope, CONST char *patternString, NsfObject *patternObj); static int NsfClassInfoMixinclassesMethod(Tcl_Interp *interp, NsfClass *cl, int withClosure, int withGuards, int withHeritage, CONST char *patternString, NsfObject *patternObj); static int NsfClassInfoMixinguardMethod(Tcl_Interp *interp, NsfClass *cl, CONST char *mixin); -static int NsfClassInfoSlotsMethod(Tcl_Interp *interp, NsfClass *cl, int withClosure, NsfClass *withType); +static int NsfClassInfoSlotsMethod(Tcl_Interp *interp, NsfClass *cl, int withClosure, int withSource, NsfClass *withType); static int NsfClassInfoSubclassMethod(Tcl_Interp *interp, NsfClass *cl, int withClosure, CONST char *patternString, NsfObject *patternObj); static int NsfClassInfoSuperclassMethod(Tcl_Interp *interp, NsfClass *cl, int withClosure, Tcl_Obj *pattern); static int NsfAliasCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, CONST char *methodName, int withFrame, Tcl_Obj *cmdName); @@ -353,7 +353,7 @@ static int NsfObjInfoLookupFilterMethod(Tcl_Interp *interp, NsfObject *obj, CONST char *filter); static int NsfObjInfoLookupMethodMethod(Tcl_Interp *interp, NsfObject *obj, Tcl_Obj *name); static int NsfObjInfoLookupMethodsMethod(Tcl_Interp *interp, NsfObject *obj, int withCallprotection, int withIncontext, int withMethodtype, int withNomixins, int withPath, int withSource, CONST char *pattern); -static int NsfObjInfoLookupSlotsMethod(Tcl_Interp *interp, NsfObject *obj, NsfClass *withType); +static int NsfObjInfoLookupSlotsMethod(Tcl_Interp *interp, NsfObject *obj, int withSource, NsfClass *withType); static int NsfObjInfoMethodMethod(Tcl_Interp *interp, NsfObject *obj, int infomethodsubcmd, Tcl_Obj *name); static int NsfObjInfoMethodsMethod(Tcl_Interp *interp, NsfObject *obj, int withCallprotection, int withIncontext, int withMethodtype, int withNomixins, int withPath, CONST char *pattern); static int NsfObjInfoMixinclassesMethod(Tcl_Interp *interp, NsfObject *obj, int withGuards, int withHeritage, CONST char *patternString, NsfObject *patternObj); @@ -858,10 +858,11 @@ return TCL_ERROR; } else { int withClosure = (int )PTR2INT(pc.clientData[0]); - NsfClass *withType = (NsfClass *)pc.clientData[1]; + int withSource = (int )PTR2INT(pc.clientData[1]); + NsfClass *withType = (NsfClass *)pc.clientData[2]; assert(pc.status == 0); - return NsfClassInfoSlotsMethod(interp, cl, withClosure, withType); + return NsfClassInfoSlotsMethod(interp, cl, withClosure, withSource, withType); } } @@ -2026,10 +2027,11 @@ &pc) != TCL_OK) { return TCL_ERROR; } else { - NsfClass *withType = (NsfClass *)pc.clientData[0]; + int withSource = (int )PTR2INT(pc.clientData[0]); + NsfClass *withType = (NsfClass *)pc.clientData[1]; assert(pc.status == 0); - return NsfObjInfoLookupSlotsMethod(interp, obj, withType); + return NsfObjInfoLookupSlotsMethod(interp, obj, withSource, withType); } } @@ -2261,8 +2263,9 @@ {"::nsf::methods::class::info::mixinguard", NsfClassInfoMixinguardMethodStub, 1, { {"mixin", NSF_ARG_REQUIRED, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, -{"::nsf::methods::class::info::slots", NsfClassInfoSlotsMethodStub, 2, { +{"::nsf::methods::class::info::slots", NsfClassInfoSlotsMethodStub, 3, { {"-closure", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"-source", 0|NSF_ARG_IS_ENUMERATION, 1, ConvertToSource, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"-type", 0, 1, Nsf_ConvertToClass, NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, {"::nsf::methods::class::info::subclass", NsfClassInfoSubclassMethodStub, 2, { @@ -2521,7 +2524,8 @@ {"-source", 0|NSF_ARG_IS_ENUMERATION, 1, ConvertToSource, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"pattern", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, -{"::nsf::methods::object::info::lookupslots", NsfObjInfoLookupSlotsMethodStub, 1, { +{"::nsf::methods::object::info::lookupslots", NsfObjInfoLookupSlotsMethodStub, 2, { + {"-source", 0|NSF_ARG_IS_ENUMERATION, 1, ConvertToSource, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"-type", 0, 1, Nsf_ConvertToClass, NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, {"::nsf::methods::object::info::method", NsfObjInfoMethodMethodStub, 2, {