summaryrefslogtreecommitdiffstats
path: root/doc/Load.3
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2010-04-04 15:03:07 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2010-04-04 15:03:07 (GMT)
commit89b9cfbb6ef818bf151a6edeb87edb4c2d2d9a50 (patch)
treef178ce9d572549a3c460ec4bbd1efea432c48ae1 /doc/Load.3
parente153b47292aeb4f64d8272684422c487e06d125d (diff)
downloadtcl-89b9cfbb6ef818bf151a6edeb87edb4c2d2d9a50.zip
tcl-89b9cfbb6ef818bf151a6edeb87edb4c2d2d9a50.tar.gz
tcl-89b9cfbb6ef818bf151a6edeb87edb4c2d2d9a50.tar.bz2
Added a first crack at documentation for TIP #357's Tcl_LoadFile et al.
Diffstat (limited to 'doc/Load.3')
-rw-r--r--doc/Load.371
1 files changed, 71 insertions, 0 deletions
diff --git a/doc/Load.3 b/doc/Load.3
new file mode 100644
index 0000000..a8e8910
--- /dev/null
+++ b/doc/Load.3
@@ -0,0 +1,71 @@
+'\"
+'\" Copyright (c) 2009-2010 Kevin B. Kenny
+'\" Copyright (c) 2010 Donal K. Fellows
+'\"
+'\" See the file "license.terms" for information on usage and redistribution
+'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+'\"
+'\" RCS: @(#) $Id: Load.3,v 1.1 2010/04/04 15:03:07 dkf Exp $
+'\"
+.so man.macros
+.TH Load 3 8.6 Tcl "Tcl Library Procedures"
+.BS
+.SH NAME
+Tcl_LoadFile, Tcl_FindSymbol \- platform-independent dynamic library loading
+.SH SYNOPSIS
+.nf
+\fB#include <tcl.h>\fR
+.sp
+int
+Tcl_LoadFile(interp, pathPtr, symbols, flags, procPtrs, loadHandlePtr)
+.sp
+void *
+Tcl_FindSymbol(interp, loadHandle, symbol)
+.SH ARGUMENTS
+.AS Tcl_LoadHandle *loadHandlePtr out
+.AP Tcl_Interp *interp in
+Interpreter to use for reporting error messages.
+.AP Tcl_Obj *pathPtr in
+The name of the file to load. If it is a single name, the library search path
+of the current environment will be used to resolve it.
+.AP "const char" *symbols[] in
+Array of names of symbols to be resolved during the load of the library, or
+NULL if no symbols are to be resolved. If an array is given, the last entry in
+the array must be NULL.
+.AP int flags in
+Reserved for future expansion. Must be 0.
+.AP void *procPtrs out
+Points to an array that will hold the addresses of the functions described in
+the \fIsymbols\fR argument. Should be NULL if no symbols are to be resolved.
+.AP Tcl_LoadHandle *loadHandlePtr out
+Points to a variable that will hold the handle to the abstract token
+describing the library that has been loaded.
+.AP Tcl_LoadHandle loadHandle
+Abstract token describing the library to look up a symbol in.
+.AP "const char" *symbol in
+The name of the symbol to look up.
+.BE
+.SH DESCRIPTION
+.PP
+\fBTcl_LoadFile\fR loads a file from the filesystem (including potentially any
+virtual filesystem that has been installed) and provides a handle to it that
+may be used in further operations. The \fIsymbols\fR array, if non-NULL,
+supplies a set of names of symbols (typically functions) that must be resolved
+from the library and which will be stored in the array indicated by
+\fIprocPtrs\fR. If any of the symbols is not resolved, the loading of the file
+will fail with an error message left in the interpreter (if that is non-NULL).
+The result of \fBTcl_LoadFile\fR is a standard Tcl error code. The library may
+be unloaded with \fBTcl_FSUnloadFile\fR.
+.PP
+\fBTcl_FindSymbol\fR locates a symbol in a loaded library and returns it. If
+the symbol cannot be found, it returns NULL and sets an error message in the
+given \fIinterp\fR (if that is non-NULL). Note that it is unsafe to use this
+operation on a handle that has been passed to \fBTcl_FSUnloadFile\fR.
+.SH "SEE ALSO"
+Tcl_FSLoad(3), Tcl_FSUnload(3), load(n), unload(n)
+.SH KEYWORDS
+binary code, loading, shared library
+'\" Local Variables:
+'\" mode: nroff
+'\" fill-column: 78
+'\" End: