{"id":7261,"date":"2022-12-20T19:36:02","date_gmt":"2022-12-20T22:36:02","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/tcl_namespace-man3-4\/"},"modified":"2022-12-20T19:36:02","modified_gmt":"2022-12-20T22:36:02","slug":"tcl_namespace-man3-4","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/tcl_namespace-man3-4\/","title":{"rendered":"Tcl_Namespace (man3)"},"content":{"rendered":"<h1 align=\"center\">Tcl_Namespace<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#ARGUMENTS\">ARGUMENTS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#KEYWORDS\">KEYWORDS<\/a> <\/p>\n<hr>\n<p>______________________________________________________________________________<\/p>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Tcl_AppendExportList, Tcl_CreateNamespace, Tcl_DeleteNamespace, Tcl_Export, Tcl_FindCommand, Tcl_FindNamespace, Tcl_ForgetImport, Tcl_GetCurrentNamespace, Tcl_GetGlobalNamespace, Tcl_GetNamespaceUnknownHandler, Tcl_Import, Tcl_SetNamespaceUnknownHandler \u2212 manipulate namespaces<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>#include <tcl.h><\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Tcl_Namespace bodies manpages.csv script_extrae_body.sh script.sh usr <b><br \/> Tcl_CreateNamespace<\/b>(<i>interp, name, clientData, deleteProc<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Tcl_DeleteNamespace<\/b>(<i>nsPtr<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">int <b><br \/> Tcl_AppendExportList<\/b>(<i>interp, nsPtr, objPtr<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">int <b><br \/> Tcl_Export<\/b>(<i>interp, nsPtr, pattern, resetListFirst<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">int <b><br \/> Tcl_Import<\/b>(<i>interp, nsPtr, pattern, allowOverwrite<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">int <b><br \/> Tcl_ForgetImport<\/b>(<i>interp, nsPtr, pattern<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Tcl_Namespace bodies manpages.csv script_extrae_body.sh script.sh usr <b><br \/> Tcl_GetCurrentNamespace<\/b>(<i>interp<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Tcl_Namespace bodies manpages.csv script_extrae_body.sh script.sh usr <b><br \/> Tcl_GetGlobalNamespace<\/b>(<i>interp<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Tcl_Namespace bodies manpages.csv script_extrae_body.sh script.sh usr <b><br \/> Tcl_FindNamespace<\/b>(<i>interp, name, contextNsPtr, flags<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Tcl_Command <b><br \/> Tcl_FindCommand<\/b>(<i>interp, name, contextNsPtr, flags<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Tcl_Obj bodies manpages.csv script_extrae_body.sh script.sh usr <b><br \/> Tcl_GetNamespaceUnknownHandler(<\/b><i>interp, nsPtr<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">int <b><br \/> Tcl_SetNamespaceUnknownHandler(<\/b><i>interp, nsPtr, handlerPtr<\/i>)<\/p>\n<h2>ARGUMENTS <a name=\"ARGUMENTS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"61%\">\n<p style=\"margin-top: 1em\">Tcl_Interp <i>*interp<\/i> (in\/out)<\/p>\n<\/td>\n<td width=\"20%\"><\/td>\n<td width=\"8%\">\n<p style=\"margin-top: 1em\">The interpreter in which the namespace exists and where name lookups are performed. Also where error result messages are written.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"61%\">\n<p>const char <i>*name<\/i> (in)<\/p>\n<\/td>\n<td width=\"20%\"><\/td>\n<td width=\"8%\">\n<p>The name of the namespace or command to be created or accessed.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"61%\">\n<p>ClientData <i>clientData<\/i> (in)<\/p>\n<\/td>\n<td width=\"20%\"><\/td>\n<td width=\"8%\">\n<p>A context pointer by the creator of the namespace. Not interpreted by Tcl at all.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"61%\">\n<p>Tcl_NamespaceDeleteProc <i>*deleteProc<\/i> (in)<\/p>\n<\/td>\n<td width=\"20%\"><\/td>\n<td width=\"8%\">\n<p>A pointer to function to call when the namespace is deleted, or NULL if no such callback is to be performed.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"61%\">\n<p>Tcl_Namespace <i>*nsPtr<\/i> (in)<\/p>\n<\/td>\n<td width=\"20%\"><\/td>\n<td width=\"8%\">\n<p>The namespace to be manipulated, or NULL (for other than <b>Tcl_DeleteNamespace<\/b>) to manipulate the current namespace.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"61%\">\n<p>Tcl_Obj <i>*objPtr<\/i> (out)<\/p>\n<\/td>\n<td width=\"20%\"><\/td>\n<td width=\"8%\">\n<p>A reference to an unshared value to which the function output will be written.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"61%\">\n<p>const char <i>*pattern<\/i> (in)<\/p>\n<\/td>\n<td width=\"20%\"><\/td>\n<td width=\"8%\">\n<p>The glob-style pattern (see <b>Tcl_StringMatch<\/b>) that describes the commands to be imported or exported.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"61%\">\n<p>int <i>resetListFirst<\/i> (in)<\/p>\n<\/td>\n<td width=\"20%\"><\/td>\n<td width=\"8%\">\n<p>Whether the list of export patterns should be reset before adding the current pattern to it.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"61%\">\n<p>int <i>allowOverwrite<\/i> (in)<\/p>\n<\/td>\n<td width=\"20%\"><\/td>\n<td width=\"8%\">\n<p>Whether new commands created by this import action can overwrite existing commands.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"61%\">\n<p>Tcl_Namespace <i>*contextNsPtr<\/i> (in)<\/p>\n<\/td>\n<td width=\"20%\"><\/td>\n<td width=\"8%\">\n<p>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.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"61%\">\n<p>int <i>flags<\/i> (in)<\/p>\n<\/td>\n<td width=\"20%\"><\/td>\n<td width=\"8%\">\n<p>OR-ed combination of bits controlling how the search is to be performed. The following flags are supported: <b>TCL_GLOBAL_ONLY<\/b> (indicates that the search is always to be conducted relative to the global namespace), <b>TCL_NAMESPACE_ONLY<\/b> (just for <b>Tcl_FindCommand<\/b>; indicates that the search is always to be conducted relative to the context namespace), and <b>TCL_LEAVE_ERR_MSG<\/b> (indicates that an error message should be left in the interpreter if the search fails.)<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"61%\">\n<p>Tcl_Obj <i>*handlerPtr<\/i> (in)<\/p>\n<\/td>\n<td width=\"20%\"><\/td>\n<td width=\"8%\">\n<p>A script fragment to be installed as the unknown command handler for the namespace, or NULL to reset the handler to its default.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:92%;\">______________________________________________________________________________<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">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 <b>namespace<\/b>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>Tcl_Namespace<\/i> structure encapsulates a namespace, and is guaranteed to have the following fields in it: <i>name<\/i> (the local name of the namespace, with no namespace separator characters in it, with empty denoting the global namespace), <i>fullName<\/i> (the fully specified name of the namespace), <i>clientData<\/i>, <i>deleteProc<\/i> (the values specified in the call to <b>Tcl_CreateNamespace<\/b>), and <i>parentPtr<\/i> (a pointer to the containing namespace, or NULL for the global namespace.)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Tcl_CreateNamespace<\/b> creates a new namespace. The <i>deleteProc<\/i> will have the following type signature:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">typedef void <b>Tcl_NamespaceDeleteProc<\/b>( <br \/> ClientData <i>clientData<\/i>);<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Tcl_DeleteNamespace<\/b> deletes a namespace, calling the <i>deleteProc<\/i> defined for the namespace (if any).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Tcl_AppendExportList<\/b> retrieves the export patterns for a namespace given namespace and appends them (as list items) to <i>objPtr<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Tcl_Export<\/b> sets and appends to the export patterns for a namespace. Patterns are appended unless the <i>resetListFirst<\/i> flag is true.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Tcl_Import<\/b> 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 <i>allowOverwrite<\/i> flag has been set.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Tcl_ForgetImport<\/b> removes imports matching a pattern.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Tcl_GetCurrentNamespace<\/b> returns the current namespace for an interpreter.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Tcl_GetGlobalNamespace<\/b> returns the global namespace for an interpreter.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Tcl_FindNamespace<\/b> searches for a namespace named <i>name<\/i> within the context of the namespace <i>contextNsPtr<\/i>. If the namespace cannot be found, NULL is returned.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Tcl_FindCommand<\/b> searches for a command named <i>name<\/i> within the context of the namespace <i>contextNsPtr<\/i>. If the command cannot be found, NULL is returned.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Tcl_GetNamespaceUnknownHandler<\/b> returns the unknown command handler for the namespace, or NULL if none is set.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Tcl_SetNamespaceUnknownHandler<\/b> sets the unknown command handler for the namespace. If <i>handlerPtr<\/i> is NULL, then the handler is reset to its default.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Tcl_CreateCommand(3), Tcl_ListObjAppendList(3), Tcl_SetVar(3)<\/p>\n<h2>KEYWORDS <a name=\"KEYWORDS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">namespace, command<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  Tcl_AppendExportList, Tcl_CreateNamespace, Tcl_DeleteNamespace, Tcl_Export, Tcl_FindCommand, Tcl_FindNamespace, Tcl_ForgetImport, Tcl_GetCurrentNamespace, Tcl_GetGlobalNamespace, Tcl_GetNamespaceUnknownHandler, Tcl_Import, Tcl_SetNamespaceUnknownHandler \u2212 manipulate namespaces <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2536],"tags":[2538,3007,3586],"class_list":["post-7261","post","type-post","status-publish","format-standard","hentry","category-3-llamadas-de-bibliotecas","tag-2538","tag-man3","tag-tcl_import"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7261","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=7261"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7261\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=7261"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=7261"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=7261"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}