From afd4d17b3c5167c365d4072b61c93a80aacafad1 Mon Sep 17 00:00:00 2001 From: dkf Date: Tue, 16 Jul 2013 14:12:40 +0000 Subject: Changed subcommand name following community feedback. --- doc/CrtObjCmd.3 | 10 ++++----- doc/info.n | 60 +++++++++++++++++++++++++++--------------------------- generic/tclCmdIL.c | 14 ++++++------- 3 files changed, 42 insertions(+), 42 deletions(-) diff --git a/doc/CrtObjCmd.3 b/doc/CrtObjCmd.3 index 16e7c92..149d2f6 100644 --- a/doc/CrtObjCmd.3 +++ b/doc/CrtObjCmd.3 @@ -43,13 +43,13 @@ void Tcl_Command \fBTcl_GetCommandFromObj\fR(\fIinterp, objPtr\fR) .sp -.VS "info type feature" +.VS "info cmdtype feature" void \fBTcl_RegisterCommandTypeName\fR(\fIproc, typeName\fR) .sp const char * \fBTcl_GetCommandTypeName\fR(\fItoken\fR) -.VE "info type feature" +.VE "info cmdtype feature" .SH ARGUMENTS .AS Tcl_CmdDeleteProc *deleteProc in/out .AP Tcl_Interp *interp in @@ -308,21 +308,21 @@ specified by the name in a \fBTcl_Obj\fR. The command name is resolved relative to the current namespace. Returns NULL if the command is not found. .PP -.VS "info type feature" +.VS "info cmdtype feature" \fBTcl_RegisterCommandTypeName\fR is used to associate a name (the \fItypeName\fR argument) with a particular implementation function so that it can then be looked up with \fBTcl_GetCommandTypeName\fR, which in turn is called with a command token that information is wanted for and which returns the name of the type that was registered for the implementation function used for that command. (The lookup functionality is surfaced virtually directly in Tcl via -\fBinfo type\fR.) If there is no function registered for a particular +\fBinfo cmdtype\fR.) If there is no function registered for a particular function, the result will be the string literal .QW \fBnative\fR . The registration of a name can be undone by registering a mapping to NULL instead. The result from \fBTcl_GetCommandTypeName\fR will be exactly that string which was registered, and not a copy; use of a compile-time constant string is \fIstrongly recommended\fR. -.VE "info type feature" +.VE "info cmdtype feature" .SH "SEE ALSO" Tcl_CreateCommand(3), Tcl_ResetResult(3), Tcl_SetObjResult(3) .SH KEYWORDS diff --git a/doc/info.n b/doc/info.n index 59ee1a2..42fe6c3 100644 --- a/doc/info.n +++ b/doc/info.n @@ -45,6 +45,36 @@ described in \fBCLASS INTROSPECTION\fR below. Returns a count of the total number of commands that have been invoked in this interpreter. .TP +\fBinfo cmdtype \fIcommandName\fR +.VS "info cmdtype feature" +Returns a description of the kind of command named by \fIcommandName\fR. The +supported types are: +.RS +.IP \fBalias\fR +Indicates that \fIcommandName\fR was created by \fBinterp alias\fR. +.IP \fBensemble\fR +Indicates that \fIcommandName\fR was created by \fBnamespace ensemble\fR. +.IP \fBimport\fR +Indicates that \fIcommandName\fR was created by \fBnamespace import\fR. +.IP \fBnative\fR +Indicates that \fIcommandName\fR was created by the \fBTcl_CreateObjProc\fR +interface directly without further registration of the type of command. +.IP \fBobject\fR +Indicates that \fIcommandName\fR is the public command that represents an +instance of \fBoo::object\fR or one of its subclasses. +.IP \fBprivateObject\fR +Indicates that \fIcommandName\fR is the private command (\fBmy\fR by default) +that represents an instance of \fBoo::object\fR or one of its subclasses. +.IP \fBproc\fR +Indicates that \fIcommandName\fR was created by \fBproc\fR. +.IP \fBslave\fR +Indicates that \fIcommandName\fR was created by \fBinterp create\fR. +.PP +There may be other registered types as well; this is a set that is extensible +at the implementation level with \fBTcl_RegisterCommandTypeName\fR. +.RE +.VE "info cmdtype feature" +.TP \fBinfo commands \fR?\fIpattern\fR? . If \fIpattern\fR is not specified, @@ -377,36 +407,6 @@ string is returned. Returns the value of the global variable \fBtcl_version\fR; see the \fBtclvars\fR manual entry for more information. .TP -\fBinfo type \fIcommandName\fR -.VS "info type feature" -Returns a description of the kind of command named by \fIcommandName\fR. The -supported types are: -.RS -.IP \fBalias\fR -Indicates that \fIcommandName\fR was created by \fBinterp alias\fR. -.IP \fBensemble\fR -Indicates that \fIcommandName\fR was created by \fBnamespace ensemble\fR. -.IP \fBimport\fR -Indicates that \fIcommandName\fR was created by \fBnamespace import\fR. -.IP \fBnative\fR -Indicates that \fIcommandName\fR was created by the \fBTcl_CreateObjProc\fR -interface directly without further registration of the type of command. -.IP \fBobject\fR -Indicates that \fIcommandName\fR is the public command that represents an -instance of \fBoo::object\fR or one of its subclasses. -.IP \fBprivateObject\fR -Indicates that \fIcommandName\fR is the private command (\fBmy\fR by default) -that represents an instance of \fBoo::object\fR or one of its subclasses. -.IP \fBproc\fR -Indicates that \fIcommandName\fR was created by \fBproc\fR. -.IP \fBslave\fR -Indicates that \fIcommandName\fR was created by \fBinterp create\fR. -.PP -There may be other registered types as well; this is a set that is extensible -at the implementation level with \fBTcl_RegisterCommandTypeName\fR. -.RE -.VE "info type feature" -.TP \fBinfo vars\fR ?\fIpattern\fR? . If \fIpattern\fR is not specified, diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index 1b6f9c1..b99b9e2 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -146,7 +146,7 @@ static int InfoScriptCmd(ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static int InfoSharedlibCmd(ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -static int InfoTypeCmd(ClientData dummy, Tcl_Interp *interp, +static int InfoCmdTypeCmd(ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static int InfoTclVersionCmd(ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); @@ -166,6 +166,7 @@ static const EnsembleImplMap defaultInfoMap[] = { {"args", InfoArgsCmd, TclCompileBasic1ArgCmd, NULL, NULL, 0}, {"body", InfoBodyCmd, TclCompileBasic1ArgCmd, NULL, NULL, 0}, {"cmdcount", InfoCmdCountCmd, TclCompileBasic0ArgCmd, NULL, NULL, 0}, + {"cmdtype", InfoCmdTypeCmd, TclCompileBasic1ArgCmd, NULL, NULL, 0}, {"commands", InfoCommandsCmd, TclCompileInfoCommandsCmd, NULL, NULL, 0}, {"complete", InfoCompleteCmd, TclCompileBasic1ArgCmd, NULL, NULL, 0}, {"coroutine", TclInfoCoroutineCmd, TclCompileInfoCoroutineCmd, NULL, NULL, 0}, @@ -186,7 +187,6 @@ static const EnsembleImplMap defaultInfoMap[] = { {"script", InfoScriptCmd, TclCompileBasic0Or1ArgCmd, NULL, NULL, 0}, {"sharedlibextension", InfoSharedlibCmd, TclCompileBasic0ArgCmd, NULL, NULL, 0}, {"tclversion", InfoTclVersionCmd, TclCompileBasic0ArgCmd, NULL, NULL, 0}, - {"type", InfoTypeCmd, TclCompileBasic1ArgCmd, NULL, NULL, 0}, {"vars", TclInfoVarsCmd, TclCompileBasic0Or1ArgCmd, NULL, NULL, 0}, {NULL, NULL, NULL, NULL, NULL, 0} }; @@ -2144,12 +2144,12 @@ InfoTclVersionCmd( /* *---------------------------------------------------------------------- * - * InfoTypeCmd -- + * InfoCmdTypeCmd -- * - * Called to implement the "info type" command that returns the type of a - * given command. Handles the following syntax: + * Called to implement the "info cmdtype" command that returns the type + * of a given command. Handles the following syntax: * - * info type cmdName + * info cmdtype cmdName * * Results: * Returns TCL_OK if successful and TCL_ERROR if there is an error. @@ -2162,7 +2162,7 @@ InfoTclVersionCmd( */ static int -InfoTypeCmd( +InfoCmdTypeCmd( ClientData dummy, /* Not used. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ -- cgit v0.12