Index: generic/nsf.c =================================================================== diff -u -re0eea786da148230d07ff3b228838474df6ea518 -re530487c1945b471b745838c3168e1b3788d48c5 --- generic/nsf.c (.../nsf.c) (revision e0eea786da148230d07ff3b228838474df6ea518) +++ generic/nsf.c (.../nsf.c) (revision e530487c1945b471b745838c3168e1b3788d48c5) @@ -17013,6 +17013,18 @@ Tcl_Command importedCmd = GetOriginalCommand(cmd); return ListCmdParams(interp, importedCmd, methodName, NSF_PARAMS_PARAMETER); } + case InfomethodsubcmdReturnsIdx: + { + Tcl_Command importedCmd; + NsfParamDefs *paramDefs; + + importedCmd = GetOriginalCommand(cmd); + paramDefs = ParamDefsGet(importedCmd); + if (paramDefs && paramDefs->returns) { + Tcl_SetObjResult(interp, paramDefs->returns); + return TCL_OK; + } + } case InfomethodsubcmdParametersyntaxIdx: { Tcl_Command importedCmd = GetOriginalCommand(cmd); @@ -22790,7 +22802,7 @@ /* classInfoMethod method NsfClassInfoMethodMethod { - {-argName "infomethodsubcmd" -type "args|body|definition|exists|registrationhandle|definitionhandle|origin|handle|parameter|parametersyntax|type|precondition|postcondition|submethods"} + {-argName "infomethodsubcmd" -type "args|body|definition|exists|registrationhandle|definitionhandle|origin|handle|parameter|parametersyntax|type|precondition|postcondition|submethods|returns"} {-argName "name" -required 1 -type tclobj} } */ Index: generic/nsfAPI.decls =================================================================== diff -u -r8040970d348ab537d9e3fefbc7f15d262ca52870 -re530487c1945b471b745838c3168e1b3788d48c5 --- generic/nsfAPI.decls (.../nsfAPI.decls) (revision 8040970d348ab537d9e3fefbc7f15d262ca52870) +++ generic/nsfAPI.decls (.../nsfAPI.decls) (revision e530487c1945b471b745838c3168e1b3788d48c5) @@ -384,7 +384,7 @@ {-argName "pattern" -required 0} } objectInfoMethod method NsfObjInfoMethodMethod { - {-argName "infomethodsubcmd" -required 1 -type "args|body|definition|exists|registrationhandle|definitionhandle|handle|origin|parameter|parametersyntax|type|precondition|postcondition|submethods"} + {-argName "infomethodsubcmd" -required 1 -type "args|body|definition|exists|registrationhandle|definitionhandle|handle|origin|parameter|parametersyntax|type|precondition|postcondition|submethods|returns"} {-argName "name" -required 1 -type tclobj} } objectInfoMethod methods NsfObjInfoMethodsMethod { @@ -439,7 +439,7 @@ } classInfoMethod method NsfClassInfoMethodMethod { - {-argName "infomethodsubcmd" -required 1 -type "args|body|definition|exists|registrationhandle|definitionhandle|handle|origin|parameter|parametersyntax|type|precondition|postcondition|submethods"} + {-argName "infomethodsubcmd" -required 1 -type "args|body|definition|exists|registrationhandle|definitionhandle|handle|origin|parameter|parametersyntax|type|precondition|postcondition|submethods|returns"} {-argName "name" -required 1 -type tclobj} } classInfoMethod methods NsfClassInfoMethodsMethod { Index: generic/nsfAPI.h =================================================================== diff -u -r8040970d348ab537d9e3fefbc7f15d262ca52870 -re530487c1945b471b745838c3168e1b3788d48c5 --- generic/nsfAPI.h (.../nsfAPI.h) (revision 8040970d348ab537d9e3fefbc7f15d262ca52870) +++ generic/nsfAPI.h (.../nsfAPI.h) (revision e530487c1945b471b745838c3168e1b3788d48c5) @@ -5,12 +5,12 @@ */ -enum InfomethodsubcmdIdx {InfomethodsubcmdNULL, InfomethodsubcmdArgsIdx, InfomethodsubcmdBodyIdx, InfomethodsubcmdDefinitionIdx, InfomethodsubcmdExistsIdx, InfomethodsubcmdRegistrationhandleIdx, InfomethodsubcmdDefinitionhandleIdx, InfomethodsubcmdHandleIdx, InfomethodsubcmdOriginIdx, InfomethodsubcmdParameterIdx, InfomethodsubcmdParametersyntaxIdx, InfomethodsubcmdTypeIdx, InfomethodsubcmdPreconditionIdx, InfomethodsubcmdPostconditionIdx, InfomethodsubcmdSubmethodsIdx}; +enum InfomethodsubcmdIdx {InfomethodsubcmdNULL, InfomethodsubcmdArgsIdx, InfomethodsubcmdBodyIdx, InfomethodsubcmdDefinitionIdx, InfomethodsubcmdExistsIdx, InfomethodsubcmdRegistrationhandleIdx, InfomethodsubcmdDefinitionhandleIdx, InfomethodsubcmdHandleIdx, InfomethodsubcmdOriginIdx, InfomethodsubcmdParameterIdx, InfomethodsubcmdParametersyntaxIdx, InfomethodsubcmdTypeIdx, InfomethodsubcmdPreconditionIdx, InfomethodsubcmdPostconditionIdx, InfomethodsubcmdSubmethodsIdx, InfomethodsubcmdReturnsIdx}; static int ConvertToInfomethodsubcmd(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param CONST *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { int index, result; - static CONST char *opts[] = {"args", "body", "definition", "exists", "registrationhandle", "definitionhandle", "handle", "origin", "parameter", "parametersyntax", "type", "precondition", "postcondition", "submethods", NULL}; + static CONST char *opts[] = {"args", "body", "definition", "exists", "registrationhandle", "definitionhandle", "handle", "origin", "parameter", "parametersyntax", "type", "precondition", "postcondition", "submethods", "returns", NULL}; (void)pPtr; result = Tcl_GetIndexFromObj(interp, objPtr, opts, "infomethodsubcmd", 0, &index); *clientData = (ClientData) INT2PTR(index + 1); @@ -191,7 +191,7 @@ static enumeratorConverterEntry enumeratorConverterEntries[] = { {ConvertToScope, "all|class|object"}, {ConvertToInfoobjectparametersubcmd, "list|name|parameter|parametersyntax"}, - {ConvertToInfomethodsubcmd, "args|body|definition|exists|registrationhandle|definitionhandle|handle|origin|parameter|parametersyntax|type|precondition|postcondition|submethods"}, + {ConvertToInfomethodsubcmd, "args|body|definition|exists|registrationhandle|definitionhandle|handle|origin|parameter|parametersyntax|type|precondition|postcondition|submethods|returns"}, {ConvertToCallprotection, "all|public|protected|private"}, {ConvertToMethodtype, "all|scripted|builtin|alias|forwarder|object|setter|nsfproc"}, {ConvertToFrame, "method|object|default"}, Index: generic/nsfDecls.h =================================================================== diff -u -ra09faeafaaacd8dcd4c52cdb86653993e8dc499a -re530487c1945b471b745838c3168e1b3788d48c5 --- generic/nsfDecls.h (.../nsfDecls.h) (revision a09faeafaaacd8dcd4c52cdb86653993e8dc499a) +++ generic/nsfDecls.h (.../nsfDecls.h) (revision e530487c1945b471b745838c3168e1b3788d48c5) @@ -28,167 +28,95 @@ * Exported function declarations: */ -#ifndef Nsf_Init_TCL_DECLARED -#define Nsf_Init_TCL_DECLARED /* 0 */ EXTERN int Nsf_Init(Tcl_Interp *interp); -#endif /* Slot 1 is reserved */ -#ifndef NsfIsClass_TCL_DECLARED -#define NsfIsClass_TCL_DECLARED /* 2 */ EXTERN struct Nsf_Class * NsfIsClass(Tcl_Interp *interp, ClientData cd); -#endif -#ifndef NsfGetObject_TCL_DECLARED -#define NsfGetObject_TCL_DECLARED /* 3 */ EXTERN struct Nsf_Object * NsfGetObject(Tcl_Interp *interp, CONST char *name); -#endif -#ifndef NsfGetClass_TCL_DECLARED -#define NsfGetClass_TCL_DECLARED /* 4 */ EXTERN struct Nsf_Class * NsfGetClass(Tcl_Interp *interp, CONST char *name); -#endif -#ifndef NsfDeleteObject_TCL_DECLARED -#define NsfDeleteObject_TCL_DECLARED /* 5 */ EXTERN int NsfDeleteObject(Tcl_Interp *interp, struct Nsf_Object *object); -#endif -#ifndef NsfRemoveObjectMethod_TCL_DECLARED -#define NsfRemoveObjectMethod_TCL_DECLARED /* 6 */ EXTERN int NsfRemoveObjectMethod(Tcl_Interp *interp, struct Nsf_Object *object, CONST char *nm); -#endif -#ifndef NsfRemoveClassMethod_TCL_DECLARED -#define NsfRemoveClassMethod_TCL_DECLARED /* 7 */ EXTERN int NsfRemoveClassMethod(Tcl_Interp *interp, struct Nsf_Class *cl, CONST char *nm); -#endif -#ifndef Nsf_ObjSetVar2_TCL_DECLARED -#define Nsf_ObjSetVar2_TCL_DECLARED /* 8 */ EXTERN Tcl_Obj * Nsf_ObjSetVar2(struct Nsf_Object *object, Tcl_Interp *interp, Tcl_Obj *name1, Tcl_Obj *name2, Tcl_Obj *value, int flgs); -#endif -#ifndef Nsf_ObjGetVar2_TCL_DECLARED -#define Nsf_ObjGetVar2_TCL_DECLARED /* 9 */ EXTERN Tcl_Obj * Nsf_ObjGetVar2(struct Nsf_Object *object, Tcl_Interp *interp, Tcl_Obj *name1, Tcl_Obj *name2, int flgs); -#endif -#ifndef Nsf_UnsetVar2_TCL_DECLARED -#define Nsf_UnsetVar2_TCL_DECLARED /* 10 */ EXTERN int Nsf_UnsetVar2(struct Nsf_Object *object, Tcl_Interp *interp, CONST char *name1, CONST char *name2, int flgs); -#endif -#ifndef NsfDStringPrintf_TCL_DECLARED -#define NsfDStringPrintf_TCL_DECLARED /* 11 */ EXTERN void NsfDStringPrintf(Tcl_DString *dsPtr, CONST char *fmt, va_list apSrc); -#endif -#ifndef NsfPrintError_TCL_DECLARED -#define NsfPrintError_TCL_DECLARED /* 12 */ EXTERN int NsfPrintError(Tcl_Interp *interp, CONST char *fmt, ...); -#endif -#ifndef NsfErrInProc_TCL_DECLARED -#define NsfErrInProc_TCL_DECLARED /* 13 */ EXTERN int NsfErrInProc(Tcl_Interp *interp, Tcl_Obj *objName, Tcl_Obj *clName, CONST char *procName); -#endif -#ifndef NsfObjErrType_TCL_DECLARED -#define NsfObjErrType_TCL_DECLARED /* 14 */ EXTERN int NsfObjErrType(Tcl_Interp *interp, CONST char *context, Tcl_Obj *value, CONST char *type, Nsf_Param CONST *pPtr); -#endif -#ifndef NsfStackDump_TCL_DECLARED -#define NsfStackDump_TCL_DECLARED /* 15 */ EXTERN void NsfStackDump(Tcl_Interp *interp); -#endif -#ifndef NsfSetObjClientData_TCL_DECLARED -#define NsfSetObjClientData_TCL_DECLARED /* 16 */ EXTERN void NsfSetObjClientData(Tcl_Interp *interp, Nsf_Object *object, ClientData data); -#endif -#ifndef NsfGetObjClientData_TCL_DECLARED -#define NsfGetObjClientData_TCL_DECLARED /* 17 */ EXTERN ClientData NsfGetObjClientData(Tcl_Interp *interp, Nsf_Object *object); -#endif -#ifndef NsfSetClassClientData_TCL_DECLARED -#define NsfSetClassClientData_TCL_DECLARED /* 18 */ EXTERN void NsfSetClassClientData(Tcl_Interp *interp, Nsf_Class *cl, ClientData data); -#endif -#ifndef NsfGetClassClientData_TCL_DECLARED -#define NsfGetClassClientData_TCL_DECLARED /* 19 */ EXTERN ClientData NsfGetClassClientData(Tcl_Interp *interp, Nsf_Class *cl); -#endif -#ifndef NsfRequireObjNamespace_TCL_DECLARED -#define NsfRequireObjNamespace_TCL_DECLARED /* 20 */ EXTERN void NsfRequireObjNamespace(Tcl_Interp *interp, Nsf_Object *object); -#endif -#ifndef NsfCallMethodWithArgs_TCL_DECLARED -#define NsfCallMethodWithArgs_TCL_DECLARED /* 21 */ EXTERN int NsfCallMethodWithArgs(Tcl_Interp *interp, Nsf_Object *object, Tcl_Obj *method, Tcl_Obj *arg, int objc, Tcl_Obj *CONST objv[], int flags); -#endif -#ifndef NsfAddObjectMethod_TCL_DECLARED -#define NsfAddObjectMethod_TCL_DECLARED /* 22 */ EXTERN int NsfAddObjectMethod(Tcl_Interp *interp, struct Nsf_Object *object, CONST char *nm, Tcl_ObjCmdProc *proc, ClientData cd, Tcl_CmdDeleteProc *dp, int flags); -#endif -#ifndef NsfAddClassMethod_TCL_DECLARED -#define NsfAddClassMethod_TCL_DECLARED /* 23 */ EXTERN int NsfAddClassMethod(Tcl_Interp *interp, struct Nsf_Class *cl, CONST char *nm, Tcl_ObjCmdProc *proc, ClientData cd, Tcl_CmdDeleteProc *dp, int flags); -#endif -#ifndef NsfCreate_TCL_DECLARED -#define NsfCreate_TCL_DECLARED /* 24 */ EXTERN int NsfCreate(Tcl_Interp *in, Nsf_Class *class, Tcl_Obj *name, int objc, Tcl_Obj *CONST objv[]); -#endif typedef struct NsfStubHooks { - struct NsfIntStubs *nsfIntStubs; + const struct NsfIntStubs *nsfIntStubs; } NsfStubHooks; typedef struct NsfStubs { int magic; - struct NsfStubHooks *hooks; + const struct NsfStubHooks *hooks; int (*nsf_Init) (Tcl_Interp *interp); /* 0 */ - VOID *reserved1; + void (*reserved1)(void); struct Nsf_Class * (*nsfIsClass) (Tcl_Interp *interp, ClientData cd); /* 2 */ struct Nsf_Object * (*nsfGetObject) (Tcl_Interp *interp, CONST char *name); /* 3 */ struct Nsf_Class * (*nsfGetClass) (Tcl_Interp *interp, CONST char *name); /* 4 */ @@ -217,116 +145,68 @@ #ifdef __cplusplus extern "C" { #endif -extern NsfStubs *nsfStubsPtr; +extern const NsfStubs *nsfStubsPtr; #ifdef __cplusplus } #endif -#if defined(USE_NSF_STUBS) && !defined(USE_NSF_STUB_PROCS) +#if defined(USE_NSF_STUBS) /* * Inline function declarations: */ -#ifndef Nsf_Init #define Nsf_Init \ (nsfStubsPtr->nsf_Init) /* 0 */ -#endif /* Slot 1 is reserved */ -#ifndef NsfIsClass #define NsfIsClass \ (nsfStubsPtr->nsfIsClass) /* 2 */ -#endif -#ifndef NsfGetObject #define NsfGetObject \ (nsfStubsPtr->nsfGetObject) /* 3 */ -#endif -#ifndef NsfGetClass #define NsfGetClass \ (nsfStubsPtr->nsfGetClass) /* 4 */ -#endif -#ifndef NsfDeleteObject #define NsfDeleteObject \ (nsfStubsPtr->nsfDeleteObject) /* 5 */ -#endif -#ifndef NsfRemoveObjectMethod #define NsfRemoveObjectMethod \ (nsfStubsPtr->nsfRemoveObjectMethod) /* 6 */ -#endif -#ifndef NsfRemoveClassMethod #define NsfRemoveClassMethod \ (nsfStubsPtr->nsfRemoveClassMethod) /* 7 */ -#endif -#ifndef Nsf_ObjSetVar2 #define Nsf_ObjSetVar2 \ (nsfStubsPtr->nsf_ObjSetVar2) /* 8 */ -#endif -#ifndef Nsf_ObjGetVar2 #define Nsf_ObjGetVar2 \ (nsfStubsPtr->nsf_ObjGetVar2) /* 9 */ -#endif -#ifndef Nsf_UnsetVar2 #define Nsf_UnsetVar2 \ (nsfStubsPtr->nsf_UnsetVar2) /* 10 */ -#endif -#ifndef NsfDStringPrintf #define NsfDStringPrintf \ (nsfStubsPtr->nsfDStringPrintf) /* 11 */ -#endif -#ifndef NsfPrintError #define NsfPrintError \ (nsfStubsPtr->nsfPrintError) /* 12 */ -#endif -#ifndef NsfErrInProc #define NsfErrInProc \ (nsfStubsPtr->nsfErrInProc) /* 13 */ -#endif -#ifndef NsfObjErrType #define NsfObjErrType \ (nsfStubsPtr->nsfObjErrType) /* 14 */ -#endif -#ifndef NsfStackDump #define NsfStackDump \ (nsfStubsPtr->nsfStackDump) /* 15 */ -#endif -#ifndef NsfSetObjClientData #define NsfSetObjClientData \ (nsfStubsPtr->nsfSetObjClientData) /* 16 */ -#endif -#ifndef NsfGetObjClientData #define NsfGetObjClientData \ (nsfStubsPtr->nsfGetObjClientData) /* 17 */ -#endif -#ifndef NsfSetClassClientData #define NsfSetClassClientData \ (nsfStubsPtr->nsfSetClassClientData) /* 18 */ -#endif -#ifndef NsfGetClassClientData #define NsfGetClassClientData \ (nsfStubsPtr->nsfGetClassClientData) /* 19 */ -#endif -#ifndef NsfRequireObjNamespace #define NsfRequireObjNamespace \ (nsfStubsPtr->nsfRequireObjNamespace) /* 20 */ -#endif -#ifndef NsfCallMethodWithArgs #define NsfCallMethodWithArgs \ (nsfStubsPtr->nsfCallMethodWithArgs) /* 21 */ -#endif -#ifndef NsfAddObjectMethod #define NsfAddObjectMethod \ (nsfStubsPtr->nsfAddObjectMethod) /* 22 */ -#endif -#ifndef NsfAddClassMethod #define NsfAddClassMethod \ (nsfStubsPtr->nsfAddClassMethod) /* 23 */ -#endif -#ifndef NsfCreate #define NsfCreate \ (nsfStubsPtr->nsfCreate) /* 24 */ -#endif -#endif /* defined(USE_NSF_STUBS) && !defined(USE_NSF_STUB_PROCS) */ +#endif /* defined(USE_NSF_STUBS) */ /* !END!: Do not edit above this line. */