{"id":7304,"date":"2022-12-20T19:37:38","date_gmt":"2022-12-20T22:37:38","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/tcl_staticpackage-man3\/"},"modified":"2022-12-20T19:37:38","modified_gmt":"2022-12-20T22:37:38","slug":"tcl_staticpackage-man3","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/tcl_staticpackage-man3\/","title":{"rendered":"Tcl_StaticPackage (man3)"},"content":{"rendered":"<h1 align=\"center\">Tcl_StaticPackage<\/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=\"#KEYWORDS\">KEYWORDS<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/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_StaticPackage \u2212 make a statically linked package available via the \u2019load\u2019 command<\/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\"><b>Tcl_StaticPackage<\/b>(<i>interp, pkgName, initProc, safeInitProc<\/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=\"58%\">\n<p style=\"margin-top: 1em\">Tcl_Interp <i>*interp<\/i> (in)<\/p>\n<\/td>\n<td width=\"16%\"><\/td>\n<td width=\"15%\">\n<p style=\"margin-top: 1em\">If not NULL, points to an interpreter into which the package has already been loaded (i.e., the caller has already invoked the appropriate initialization procedure). NULL means the package has not yet been incorporated into any interpreter.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"58%\">\n<p>const char <i>*pkgName<\/i> (in)<\/p>\n<\/td>\n<td width=\"16%\"><\/td>\n<td width=\"15%\">\n<p>Name of the package; should be properly capitalized (first letter upper-case, all others lower-case).<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"58%\">\n<p>Tcl_PackageInitProc <i>*initProc<\/i> (in)<\/p>\n<\/td>\n<td width=\"16%\"><\/td>\n<td width=\"15%\">\n<p>Procedure to invoke to incorporate this package into a trusted interpreter.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"58%\">\n<p>Tcl_PackageInitProc <i>*safeInitProc<\/i> (in)<\/p>\n<\/td>\n<td width=\"16%\"><\/td>\n<td width=\"15%\">\n<p>Procedure to call to incorporate this package into a safe interpreter (one that will execute untrusted scripts). NULL means the package cannot be used in safe interpreters.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:85%;\">______________________________________________________________________________<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This procedure may be invoked to announce that a package has been linked statically with a Tcl application and, optionally, that it has already been loaded into an interpreter. Once <b>Tcl_StaticPackage<\/b> has been invoked for a package, it may be loaded into interpreters using the <b>load<\/b> command. <b>Tcl_StaticPackage<\/b> is normally invoked only by the <b>Tcl_AppInit<\/b> procedure for the application, not by packages for themselves (<b>Tcl_StaticPackage<\/b> should only be invoked for statically loaded packages, and code in the package itself should not need to know whether the package is dynamically or statically loaded).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">When the <b>load<\/b> command is used later to load the package into an interpreter, one of <i>initProc<\/i> and <i>safeInitProc<\/i> will be invoked, depending on whether the target interpreter is safe or not. <i>initProc<\/i> and <i>safeInitProc<\/i> must both match the following prototype:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">typedef int <b>Tcl_PackageInitProc<\/b>( <br \/> Tcl_Interp *<i>interp<\/i>);<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>interp<\/i> argument identifies the interpreter in which the package is to be loaded. The initialization procedure must return <b>TCL_OK<\/b> or <b>TCL_ERROR<\/b> to indicate whether or not it completed successfully; in the event of an error it should set the interpreter\u2019s result to point to an error message. The result or error from the initialization procedure will be returned as the result of the <b>load<\/b> command that caused the initialization procedure to be invoked.<\/p>\n<h2>KEYWORDS <a name=\"KEYWORDS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">initialization procedure, package, static linking<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">load(n), package(n), Tcl_PkgRequire(3)<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  Tcl_StaticPackage \u2212 make a statically linked package available via the \u2019load\u2019 command <\/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,3625],"class_list":["post-7304","post","type-post","status-publish","format-standard","hentry","category-3-llamadas-de-bibliotecas","tag-2538","tag-man3","tag-tcl_staticpackage"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7304","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=7304"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7304\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=7304"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=7304"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=7304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}