summaryrefslogtreecommitdiffstats
path: root/doc/Namespace.3
diff options
context:
space:
mode:
Diffstat (limited to 'doc/Namespace.3')
-rw-r--r--doc/Namespace.363
1 files changed, 32 insertions, 31 deletions
diff --git a/doc/Namespace.3 b/doc/Namespace.3
index b9af186..be89597 100644
--- a/doc/Namespace.3
+++ b/doc/Namespace.3
@@ -4,16 +4,14 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: Namespace.3,v 1.1 2003/08/31 23:18:02 dkf Exp $
-'\"
'\" Note that some of these functions do not seem to belong, but they
'\" were all introduced with the same TIP (#139)
'\"
-.so man.macros
.TH Tcl_Namespace 3 8.5 Tcl "Tcl Library Procedures"
+.so man.macros
.BS
.SH NAME
-Tcl_AppendExportList, Tcl_CreateNamespace, Tcl_DeleteNamespace, Tcl_Export, Tcl_FindCommand, Tcl_FindNamespace, Tcl_ForgetImport, Tcl_GetCommandFromObj, Tcl_GetCommandFullName, Tcl_GetCurrentNamespace, Tcl_GetGloblaNamespace, Tcl_Import \- manipulate namespaces
+Tcl_AppendExportList, Tcl_CreateNamespace, Tcl_DeleteNamespace, Tcl_Export, Tcl_FindCommand, Tcl_FindNamespace, Tcl_ForgetImport, Tcl_GetCurrentNamespace, Tcl_GetGlobalNamespace, Tcl_GetNamespaceUnknownHandler, Tcl_Import, Tcl_SetNamespaceUnknownHandler \- manipulate namespaces
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -24,7 +22,7 @@ Tcl_Namespace *
\fBTcl_DeleteNamespace\fR(\fInsPtr\fR)
.sp
int
-\fBTcl_AppendExportList\fR(\fIinterp, nsPtr, resultObjPtr\fR)
+\fBTcl_AppendExportList\fR(\fIinterp, nsPtr, objPtr\fR)
.sp
int
\fBTcl_Export\fR(\fIinterp, nsPtr, pattern, resetListFirst\fR)
@@ -47,16 +45,17 @@ Tcl_Namespace *
Tcl_Command
\fBTcl_FindCommand\fR(\fIinterp, name, contextNsPtr, flags\fR)
.sp
-Tcl_Command
-\fBTcl_GetCommandFromObj\fR(\fIinterp, objPtr\fR)
+Tcl_Obj *
+\fBTcl_GetNamespaceUnknownHandler(\fIinterp, nsPtr\fR)
.sp
-\fBTcl_GetCommandFullName\fR(\fIinterp, command, resultObjPtr\fR)
+int
+\fBTcl_SetNamespaceUnknownHandler(\fIinterp, nsPtr, handlerPtr\fR)
.SH ARGUMENTS
-.AS Tcl_NamespaceDeleteProc *resultObjPtr
+.AS Tcl_NamespaceDeleteProc allowOverwrite in/out
.AP Tcl_Interp *interp in/out
The interpreter in which the namespace exists and where name lookups
are performed. Also where error result messages are written.
-.AP "CONST char" *name in
+.AP "const char" *name in
The name of the namespace or command to be created or accessed.
.AP ClientData clientData in
A context pointer by the creator of the namespace. Not interpreted by
@@ -67,10 +66,10 @@ if no such callback is to be performed.
.AP Tcl_Namespace *nsPtr in
The namespace to be manipulated, or NULL (for other than
\fBTcl_DeleteNamespace\fR) to manipulate the current namespace.
-.AP Tcl_Obj *resultObjPtr out
-A reference to an unshared object to which the function output will be
+.AP Tcl_Obj *objPtr out
+A reference to an unshared value to which the function output will be
written.
-.AP "CONST char" *pattern in
+.AP "const char" *pattern in
The glob-style pattern (see \fBTcl_StringMatch\fR) that describes the
commands to be imported or exported.
.AP int resetListFirst in
@@ -81,21 +80,21 @@ Whether new commands created by this import action can overwrite
existing commands.
.AP Tcl_Namespace *contextNsPtr in
The location in the namespace hierarchy where the search for a
-namspace or command should be conducted relative to when the search
+namespace or command should be conducted relative to when the search
term is not rooted at the global namespace. NULL indicates the
current namespace.
.AP int flags in
OR-ed combination of bits controlling how the search is to be
-performed. The following flags are supported: TCL_GLOBAL_ONLY
+performed. The following flags are supported: \fBTCL_GLOBAL_ONLY\fR
(indicates that the search is always to be conducted relative to the
-global namespace), TCL_NAMESPACE_ONLY (just for \fBTcl_FindCommand\fR;
+global namespace), \fBTCL_NAMESPACE_ONLY\fR (just for \fBTcl_FindCommand\fR;
indicates that the search is always to be conducted relative to the
-context namespace), and TCL_LEAVE_ERR_MSG (indicates that an error
+context namespace), and \fBTCL_LEAVE_ERR_MSG\fR (indicates that an error
message should be left in the interpreter if the search fails.)
-.AP Tcl_Obj *objPtr in
-A reference to an object containing the name of a command to look up.
+.AP Tcl_Obj *handlerPtr in
+A script fragment to be installed as the unknown command handler for the
+namespace, or NULL to reset the handler to its default.
.BE
-
.SH DESCRIPTION
.PP
Namespaces are hierarchic naming contexts that can contain commands
@@ -115,15 +114,18 @@ the global namespace.)
.PP
\fBTcl_CreateNamespace\fR creates a new namespace. The
\fIdeleteProc\fR will have the following type signature:
+.PP
.CS
-typedef void (Tcl_NamespaceDeleteProc) (ClientData clientData);
+typedef void \fBTcl_NamespaceDeleteProc\fR(
+ ClientData \fIclientData\fR);
.CE
.PP
-\fBTcl_DeleteNamespace\fR deletes a namespace.
+\fBTcl_DeleteNamespace\fR deletes a namespace, calling the
+\fIdeleteProc\fR defined for the namespace (if any).
.PP
\fBTcl_AppendExportList\fR retrieves the export patterns for a
namespace given namespace and appends them (as list items) to
-\fIresultObjPtr\fR.
+\fIobjPtr\fR.
.PP
\fBTcl_Export\fR sets and appends to the export patterns for a
namespace. Patterns are appended unless the \fIresetListFirst\fR flag
@@ -131,7 +133,7 @@ is true.
.PP
\fBTcl_Import\fR imports commands matching a pattern into a
namespace. Note that the pattern must include the name of the
-namespace to import from. This function returns returns an error if
+namespace to import from. This function returns an error if
an attempt to import a command over an existing command is made,
unless the \fIallowOverwrite\fR flag has been set.
.PP
@@ -151,14 +153,13 @@ namespace cannot be found, NULL is returned.
the context of the namespace \fIcontextNsPtr\fR. If the command
cannot be found, NULL is returned.
.PP
-\fBTcl_GetCommandFromObj\fR gets a command token from \fIobjPtr\fR.
+\fBTcl_GetNamespaceUnknownHandler\fR returns the unknown command handler
+for the namespace, or NULL if none is set.
.PP
-\fBTcl_GetCommandFullName\fR gets the fully qualified name of a
-command given its command token, writing that name into the
-\fIresultObjPtr\fR.
-
+\fBTcl_SetNamespaceUnknownHandler\fR sets the unknown command handler for
+the namespace. If \fIhandlerPtr\fR is NULL, then the handler is reset to
+its default.
.SH "SEE ALSO"
-Tcl_CreateCommand, Tcl_ListObjAppendElements, Tcl_SetVar
-
+Tcl_CreateCommand(3), Tcl_ListObjAppendList(3), Tcl_SetVar(3)
.SH KEYWORDS
namespace, command