Tcl_Namespace
NAMESYNOPSIS
ARGUMENTS
DESCRIPTION
SEE ALSO
KEYWORDS
___________________________
NAME
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
SYNOPSIS
#include <tcl.h>
Tcl_Namespace *
Tcl_CreateNamespace(interp, name, clientData,
deleteProc)
Tcl_DeleteNamespace(nsPtr)
int
Tcl_AppendExportList(interp, nsPtr, objPtr)
int
Tcl_Export(interp, nsPtr, pattern,
resetListFirst)
int
Tcl_Import(interp, nsPtr, pattern,
allowOverwrite)
int
Tcl_ForgetImport(interp, nsPtr, pattern)
Tcl_Namespace *
Tcl_GetCurrentNamespace(interp)
Tcl_Namespace *
Tcl_GetGlobalNamespace(interp)
Tcl_Namespace *
Tcl_FindNamespace(interp, name, contextNsPtr,
flags)
Tcl_Command
Tcl_FindCommand(interp, name, contextNsPtr,
flags)
Tcl_Obj *
Tcl_GetNamespaceUnknownHandler(interp, nsPtr)
int
Tcl_SetNamespaceUnknownHandler(interp, nsPtr,
handlerPtr)
ARGUMENTS
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. | ||
const char *name (in) |
The name of the namespace or command to be created or accessed. | ||
ClientData clientData (in) |
A context pointer by the creator of the namespace. Not interpreted by Tcl at all. | ||
Tcl_NamespaceDeleteProc *deleteProc (in) |
A pointer to function to call when the namespace is deleted, or NULL if no such callback is to be performed. | ||
Tcl_Namespace *nsPtr (in) |
The namespace to be manipulated, or NULL (for other than Tcl_DeleteNamespace) to manipulate the current namespace. | ||
Tcl_Obj *objPtr (out) |
A reference to an unshared object to which the function output will be written. | ||
const char *pattern (in) |
The glob-style pattern (see Tcl_StringMatch) that describes the commands to be imported or exported. | ||
int resetListFirst (in) |
Whether the list of export patterns should be reset before adding the current pattern to it. | ||
int allowOverwrite (in) |
Whether new commands created by this import action can overwrite existing commands. | ||
Tcl_Namespace *contextNsPtr (in) |
The location in the namespace hierarchy where the search for a namespace or command should be conducted relative to when the search term is not rooted at the global namespace. NULL indicates the current namespace. | ||
int flags (in) |
OR-ed combination of bits controlling how the search is to be performed. The following flags are supported: TCL_GLOBAL_ONLY (indicates that the search is always to be conducted relative to the global namespace), TCL_NAMESPACE_ONLY (just for Tcl_FindCommand; indicates that the search is always to be conducted relative to the context namespace), and TCL_LEAVE_ERR_MSG (indicates that an error message should be left in the interpreter if the search fails.) | ||
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. |
______________
DESCRIPTION
Namespaces are hierarchic naming contexts that can contain commands and variables. They also maintain a list of patterns that describes what commands are exported, and can import commands that have been exported by other namespaces. Namespaces can also be manipulated through the Tcl command namespace.
The Tcl_Namespace structure encapsulates a namespace, and is guaranteed to have the following fields in it: name (the local name of the namespace, with no namespace separator characters in it, with empty denoting the global namespace), fullName (the fully specified name of the namespace), clientData, deleteProc (the values specified in the call to Tcl_CreateNamespace), and parentPtr (a pointer to the containing namespace, or NULL for the global namespace.)
Tcl_CreateNamespace creates a new namespace. The deleteProc will have the following type signature:
typedef void (Tcl_NamespaceDeleteProc) (ClientData clientData);
Tcl_DeleteNamespace deletes a namespace.
Tcl_AppendExportList retrieves the export patterns for a namespace given namespace and appends them (as list items) to objPtr.
Tcl_Export sets and appends to the export patterns for a namespace. Patterns are appended unless the resetListFirst flag is true.
Tcl_Import 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 an error if an attempt to import a command over an existing command is made, unless the allowOverwrite flag has been set.
Tcl_ForgetImport removes imports matching a pattern.
Tcl_GetCurrentNamespace returns the current namespace for an interpreter.
Tcl_GetGlobalNamespace returns the global namespace for an interpreter.
Tcl_FindNamespace searches for a namespace named name within the context of the namespace contextNsPtr. If the namespace cannot be found, NULL is returned.
Tcl_FindCommand searches for a command named name within the context of the namespace contextNsPtr. If the command cannot be found, NULL is returned.
Tcl_GetNamespaceUnknownHandler returns the unknown command handler for the namespace, or NULL if none is set.
Tcl_SetNamespaceUnknownHandler sets the unknown command handler for the namespace. If handlerPtr is NULL, then the handler is reset to its default.
SEE ALSO
Tcl_CreateCommand, Tcl_ListObjAppendElements, Tcl_SetVar
KEYWORDS
namespace, command
More Linux Commands
manpages/tdbbackup.8.html
tdbbackup(8) - tool for backing up and for validating the in
This tool is part of the samba(1) suite. tdbbackup is a tool that may be used to backup samba .tdb files. This tool may also be used to verify the integrity of
manpages/mlock.2.html
mlock(2) - lock and unlock memory - Linux manual page.......
mlock() and mlockall() respectively lock part or all of the calling processs virtual address space into RAM, preventing that memory from being paged to the swap
manpages/j1l.3.html
j1l(3) - Bessel functions of the first kind - Linux man page
The j0() and j1() functions return Bessel functions of x of the first kind of orders 0 and 1, respectively. The jn() function returns the Bessel function of x o
manpages/configbody.n.html
configbody(n) - change the "config" code for a public variab
The configbody command is used outside of an [incr Tcl] class definition to define or redefine the configuration code associated with a public variable. Public
manpages/getaliasbyname_r.3.html
getaliasbyname_r(3) - read an alias entry - Linux man page
One of the databases available with the Name Service Switch (NSS) is the aliases database, that contains mail aliases. (To find out which databases are supporte
manpages/git-push.1.html
git-push(1) - Update remote refs along with associated objec
Updates remote refs using local refs, while sending objects necessary to complete the given refs. You can make interesting things happen to a repository every t
manpages/FcConfigSubstituteWithPat.3.html
FcConfigSubstituteWithPat(3) - Execute substitutions........
Performs the sequence of pattern modification operations, if kind is FcMatchPattern, then those tagged as pattern operations are applied, else if kind is FcMatc
manpages/ulimit.3.html
ulimit(3) - get and set user limits - Linux manual page.....
Warning: This routine is obsolete. Use getrlimit(2), setrlimit(2), and sysconf(3) instead. For the shell command ulimit(), see bash(1). The ulimit() call will g
manpages/XMaskEvent.3.html
XMaskEvent(3) - select events by type - Linux manual page...
XMaskEvent.3 - The XNextEvent function copies the first event from the event queue into the specified XEvent structure and then removes it from the queue. If th
manpages/glMultiTexCoord2ivARB.3gl.html
glMultiTexCoord2ivARB(3gl) - set the current texture coordin
glMultiTexCoordARB specifies texture coordinates in one, two, three, or four dimensions. glMultiTexCoord1ARB sets the current texture coordinates to (s, 0, 0, 1
manpages/ground_panel.3ncurses.html
ground_panel(3ncurses) - curses screen-pointer extension....
This implementation can be configured to provide a set of functions which improve the ability to manage multiple screens. This feature can be added to any of th
manpages/isdigit_l.3.html
isdigit_l(3) character classification functions (Man Page)
These functions check whether c, which must have the value of an unsigned char or EOF, falls into a certain character class according to the specified locale. T
