summaryrefslogtreecommitdiffstats
path: root/doc/unload.n
diff options
context:
space:
mode:
Diffstat (limited to 'doc/unload.n')
-rw-r--r--doc/unload.n55
1 files changed, 22 insertions, 33 deletions
diff --git a/doc/unload.n b/doc/unload.n
index 00b709b..82c4f4a 100644
--- a/doc/unload.n
+++ b/doc/unload.n
@@ -3,7 +3,7 @@
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-'\"
+'\"
.TH unload n 8.5 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
@@ -13,9 +13,9 @@ unload \- Unload machine code
.SH SYNOPSIS
\fBunload \fR?\fIswitches\fR? \fIfileName\fR
.br
-\fBunload \fR?\fIswitches\fR? \fIfileName prefix\fR
+\fBunload \fR?\fIswitches\fR? \fIfileName packageName\fR
.br
-\fBunload \fR?\fIswitches\fR? \fIfileName prefix interp\fR
+\fBunload \fR?\fIswitches\fR? \fIfileName packageName interp\fR
.BE
.SH DESCRIPTION
.PP
@@ -24,7 +24,7 @@ with \fBload\fR from the application's address space. \fIfileName\fR
is the name of the file containing the library file to be unload; it
must be the same as the filename provided to \fBload\fR for
loading the library.
-The \fIprefix\fR argument is the prefix (as
+The \fIpackageName\fR argument is the name of the package (as
determined by or passed to \fBload\fR), and is used to
compute the name of the unload procedure; if not supplied, it is
computed from \fIfileName\fR in the same manner as \fBload\fR.
@@ -45,7 +45,7 @@ never report an error.
\fB\-keeplibrary\fR
.
This switch will prevent \fBunload\fR from issuing the operating system call
-that will unload the library from the process.
+that will unload the library from the process.
.TP
\fB\-\|\-\fR
.
@@ -66,12 +66,12 @@ proper reference count.
\fBunload\fR works in the opposite direction. As a first step, \fBunload\fR
will check whether the library is unloadable: an unloadable library exports
a special unload procedure. The name of the unload procedure is determined by
-\fIprefix\fR and whether or not the target interpreter
+\fIpackageName\fR and whether or not the target interpreter
is a safe one. For normal interpreters the name of the initialization
-procedure will have the form \fIpfx\fB_Unload\fR, where \fIpfx\fR
-is the same as \fIprefix\fR except that the first letter is
+procedure will have the form \fIpkg\fB_Unload\fR, where \fIpkg\fR
+is the same as \fIpackageName\fR except that the first letter is
converted to upper case and all other letters
-are converted to lower case. For example, if \fIprefix\fR is
+are converted to lower case. For example, if \fIpackageName\fR is
\fBfoo\fR or \fBFOo\fR, the initialization procedure's name will
be \fBFoo_Unload\fR.
If the target interpreter is a safe interpreter, then the name
@@ -88,11 +88,8 @@ detached from the process.
.SS "UNLOAD HOOK PROTOTYPE"
.PP
The unload procedure must match the following prototype:
-.PP
.CS
-typedef int \fBTcl_LibraryUnloadProc\fR(
- Tcl_Interp *\fIinterp\fR,
- int \fIflags\fR);
+typedef int Tcl_PackageUnloadProc(Tcl_Interp *\fIinterp\fR, int \fIflags\fR);
.CE
.PP
The \fIinterp\fR argument identifies the interpreter from which the
@@ -109,25 +106,24 @@ the library is used by other interpreters),
\fBTCL_UNLOAD_DETACH_FROM_INTERPRETER\fR will be defined. However, if the
library is used only by the target interpreter and the library will be
detached from the application as soon as the unload procedure returns,
-the \fIflags\fR argument will be set to \fBTCL_UNLOAD_DETACH_FROM_PROCESS\fR.
+the \fIflags\fR argument will be set to \fBTCL_UNLOAD_DETACH_FROM_PROCESS\fR.
.SS NOTES
.PP
The \fBunload\fR command cannot unload libraries that are statically
linked with the application.
-If \fIfileName\fR is an empty string, then the \fIprefix\fR argument must
+If \fIfileName\fR is an empty string, then the \fIpackageName\fR argument must
be specified.
.PP
-If \fIprefix\fR is omitted or specified as an empty string,
-Tcl tries to guess the prefix. This may be done differently on
-different platforms. The default guess, which is used on most
-UNIX platforms, is to take the last element of
-\fIfileName\fR, strip off the first three characters if they
-are \fBlib\fR, then strip off the next three characters if they
-are \fBtcl\fR, and use any following alphabetic and
-underline characters, converted to titlecase as the prefix.
-For example, the command \fBunload libxyz4.2.so\fR uses the prefix
-\fBXyz\fR and the command \fBunload bin/last.so {}\fR uses the
-prefix \fBLast\fR.
+If \fIpackageName\fR is omitted or specified as an empty string,
+Tcl tries to guess the name of the package.
+This may be done differently on different platforms.
+The default guess, which is used on most UNIX platforms, is to
+take the last element of \fIfileName\fR, strip off the first
+three characters if they are \fBlib\fR, and use any following
+alphabetic and underline characters as the module name.
+For example, the command \fBunload libxyz4.2.so\fR uses the module
+name \fBxyz\fR and the command \fBunload bin/last.so {}\fR uses the
+module name \fBlast\fR.
.SH "PORTABILITY ISSUES"
.TP
\fBUnix\fR\0\0\0\0\0
@@ -146,16 +142,12 @@ library is still loaded), it may be dangerous to use
\fBunload\fR on such a library (as the library will be completely detached
from the application while some interpreters will continue to use it).
.SH EXAMPLE
-.PP
If an unloadable module in the file \fBfoobar.dll\fR had been loaded
using the \fBload\fR command like this (on Windows):
-.PP
.CS
load c:/some/dir/foobar.dll
.CE
-.PP
then it would be unloaded like this:
-.PP
.CS
\fBunload\fR c:/some/dir/foobar.dll
.CE
@@ -168,6 +160,3 @@ without having to shut down the overall Tcl process.
info sharedlibextension, load(n), safe(n)
.SH KEYWORDS
binary code, unloading, safe interpreter, shared library
-.\" Local Variables:
-.\" mode: nroff
-.\" End: