1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
'\"
'\" Copyright (c) 1995-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\" RCS: @(#) $Id: load.n,v 1.25 2010/01/13 12:08:30 dkf Exp $
'\" RCS: @(#) $Id: load.n,v 1.26 2010/01/20 13:42:17 dkf Exp $
'\"
.so man.macros
.TH load n 7.5 Tcl "Tcl Built-In Commands"
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
load \- Load machine code and initialize new commands
|
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
|
+
+
|
type
.QW "dumpbin -imports <dllname>"
in a DOS console to see what the library must import.
When loading a DLL in the current directory, Windows will ignore
.QW ./
as a path specifier and use a search heuristic to find the DLL instead.
To avoid this, load the DLL with:
.RS
.PP
.CS
\fBload\fR [file join [pwd] mylib.DLL]
.CE
.RE
.SH BUGS
.PP
If the same file is \fBload\fRed by different \fIfileName\fRs, it will
be loaded into the process's address space multiple times. The
behavior of this varies from system to system (some systems may
detect the redundant loads, others may not).
.SH EXAMPLE
|
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
|
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
|
-
-
-
-
-
-
+
+
+
+
+
+
|
When built into a shared/dynamic library with a suitable name
(e.g. \fBfoo.dll\fR on Windows, \fBlibfoo.so\fR on Solaris and Linux)
it can then be loaded into Tcl with the following:
.PP
.CS
# Load the extension
switch $tcl_platform(platform) {
windows {
\fBload\fR [file join [pwd] foo.dll]
}
unix {
\fBload\fR [file join [pwd] libfoo[info sharedlibextension]]
}
windows {
\fBload\fR [file join [pwd] foo.dll]
}
unix {
\fBload\fR [file join [pwd] libfoo[info sharedlibextension]]
}
}
# Now execute the command defined by the extension
foo
.CE
.SH "SEE ALSO"
info sharedlibextension, package(n), Tcl_StaticPackage(3), safe(n)
.SH KEYWORDS
binary code, dynamic library, load, safe interpreter, shared library
'\"Local Variables:
'\"mode: nroff
'\"End:
|