Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/tcl8.5.2/doc/StaticPkg.3 @ 25

Last change on this file since 25 was 25, checked in by landauf, 16 years ago

added tcl to libs

File size: 2.8 KB
Line 
1'\"
2'\" Copyright (c) 1995-1996 Sun Microsystems, Inc.
3'\"
4'\" See the file "license.terms" for information on usage and redistribution
5'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
6'\"
7'\" RCS: @(#) $Id: StaticPkg.3,v 1.9 2007/12/13 15:22:32 dgp Exp $
8'\"
9.so man.macros
10.TH Tcl_StaticPackage 3 7.5 Tcl "Tcl Library Procedures"
11.BS
12.SH NAME
13Tcl_StaticPackage \- make a statically linked package available via the 'load' command
14.SH SYNOPSIS
15.nf
16\fB#include <tcl.h>\fR
17.sp
18\fBTcl_StaticPackage\fR(\fIinterp, pkgName, initProc, safeInitProc\fR)
19.SH ARGUMENTS
20.AS Tcl_PackageInitProc *safeInitProc
21.AP Tcl_Interp *interp in
22If not NULL, points to an interpreter into which the package has
23already been loaded (i.e., the caller has already invoked the
24appropriate initialization procedure).  NULL means the package
25has not yet been incorporated into any interpreter.
26.AP "const char" *pkgName in
27Name of the package;  should be properly capitalized (first letter
28upper-case, all others lower-case).
29.AP Tcl_PackageInitProc *initProc in
30Procedure to invoke to incorporate this package into a trusted
31interpreter.
32.AP Tcl_PackageInitProc *safeInitProc in
33Procedure to call to incorporate this package into a safe interpreter
34(one that will execute untrusted scripts).   NULL means the package
35cannot be used in safe interpreters.
36.BE
37
38.SH DESCRIPTION
39.PP
40This procedure may be invoked to announce that a package has been
41linked statically with a Tcl application and, optionally, that it
42has already been loaded into an interpreter.
43Once \fBTcl_StaticPackage\fR has been invoked for a package, it
44may be loaded into interpreters using the \fBload\fR command.
45\fBTcl_StaticPackage\fR is normally invoked only by the \fBTcl_AppInit\fR
46procedure for the application, not by packages for themselves
47(\fBTcl_StaticPackage\fR should only be invoked for statically
48loaded packages, and code in the package itself should not need
49to know whether the package is dynamically or statically loaded).
50.PP
51When the \fBload\fR command is used later to load the package into
52an interpreter, one of \fIinitProc\fR and \fIsafeInitProc\fR will
53be invoked, depending on whether the target interpreter is safe
54or not.
55\fIinitProc\fR and \fIsafeInitProc\fR must both match the
56following prototype:
57.CS
58typedef int Tcl_PackageInitProc(Tcl_Interp *\fIinterp\fR);
59.CE
60The \fIinterp\fR argument identifies the interpreter in which the package
61is to be loaded.  The initialization procedure must return \fBTCL_OK\fR or
62\fBTCL_ERROR\fR to indicate whether or not it completed successfully; in
63the event of an error it should set the interpreter's result to point to an
64error message.  The result or error from the initialization procedure will
65be returned as the result of the \fBload\fR command that caused the
66initialization procedure to be invoked.
67
68.SH KEYWORDS
69initialization procedure, package, static linking
Note: See TracBrowser for help on using the repository browser.