Index: generic/nsfError.c =================================================================== diff -u -r211c77c1a94a47be185a8bfb12c89512937b1901 -r5c464365425434543edd13f1674e1dd2d7f17a71 --- generic/nsfError.c (.../nsfError.c) (revision 211c77c1a94a47be185a8bfb12c89512937b1901) +++ generic/nsfError.c (.../nsfError.c) (revision 5c464365425434543edd13f1674e1dd2d7f17a71) @@ -31,7 +31,7 @@ *---------------------------------------------------------------------- */ -void +extern void NsfDStringPrintf(Tcl_DString *dsPtr, CONST char *fmt, va_list apSrc) { int result, avail = dsPtr->spaceAvl, offset = dsPtr->length; @@ -69,7 +69,7 @@ * *---------------------------------------------------------------------- */ -void +extern void NsfDStringArgv(Tcl_DString *dsPtr, int objc, Tcl_Obj *CONST objv[]) { int i; @@ -94,8 +94,7 @@ * *---------------------------------------------------------------------- */ - -int +extern int NsfPrintError(Tcl_Interp *interp, CONST char *fmt, ...) { va_list ap; Tcl_DString ds; @@ -112,7 +111,23 @@ return TCL_ERROR; } -int +/* + *---------------------------------------------------------------------- + * + * NsfErrInProc -- + * + * Produce a general error message when an error occurs in a scripted nsf + * method. + * + * Results: + * TCL_ERROR + * + * Side effects: + * Sets the result message. + * + *---------------------------------------------------------------------- + */ +extern int NsfErrInProc(Tcl_Interp *interp, Tcl_Obj *objName, Tcl_Obj *clName, CONST char *procName) { Tcl_DString errMsg; @@ -137,7 +152,23 @@ return TCL_ERROR; } -int +/* + *---------------------------------------------------------------------- + * + * NsfObjWrongArgs -- + * + * Produce a general error message when a nsf method is called with an + * invalid argument list (wrong number of arguments). + * + * Results: + * TCL_ERROR + * + * Side effects: + * Sets the result message. + * + *---------------------------------------------------------------------- + */ +extern int NsfObjWrongArgs(Tcl_Interp *interp, CONST char *msg, Tcl_Obj *cmdName, Tcl_Obj *methodName, char *arglist) { int need_space = 0; @@ -176,7 +207,7 @@ * *---------------------------------------------------------------------- */ -int +extern int NsfArgumentError(Tcl_Interp *interp, CONST char *errorMsg, Nsf_Param CONST *paramPtr, Tcl_Obj *cmdNameObj, Tcl_Obj *methodObj) { Tcl_Obj *argStringObj = NsfParamDefsSyntax(paramPtr); @@ -202,14 +233,51 @@ * *---------------------------------------------------------------------- */ -int +extern int NsfDispatchClientDataError(Tcl_Interp *interp, ClientData clientData, CONST char *what, CONST char *methodName) { return NsfPrintError(interp, "Method %s not dispatched on valid %s%s", methodName, what, clientData ? "" : " ; don't call aliased methods via namespace paths!"); } +/* + *---------------------------------------------------------------------- + * + * NsfNoDispatchObjectError -- + * + * Produce a error message when method was not dispatched on an object + * + * Results: + * TCL_ERROR + * + * Side effects: + * Sets the result message. + * + *---------------------------------------------------------------------- + */ extern int +NsfNoCurrentObjectError(Tcl_Interp *interp, CONST char *what) { + return NsfPrintError(interp, "No current object; %s called outside the context of a Next Scripting method", + what ? what : "command"); +} + +/* + *---------------------------------------------------------------------- + * + * NsfObjErrType -- + * + * Produce a general error message when a nsf method is called with an + * invalid value for some argument. + * + * Results: + * TCL_ERROR + * + * Side effects: + * Sets the result message. + * + *---------------------------------------------------------------------- + */ +extern int NsfObjErrType(Tcl_Interp *interp, CONST char *context, Tcl_Obj *value,