StaticPkg.3
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:3k
- '"
- '" 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: StaticPkg.3,v 1.4 2002/01/09 19:09:28 kennykb Exp $
- '"
- .so man.macros
- .TH Tcl_StaticPackage 3 7.5 Tcl "Tcl Library Procedures"
- .BS
- .SH NAME
- Tcl_StaticPackage - make a statically linked package available via the fBloadfR command
- .SH SYNOPSIS
- .nf
- fB#include <tcl.h>fR
- .sp
- fBTcl_StaticPackagefR(fIinterp, pkgName, initProc, safeInitProcfR)
- .SH ARGUMENTS
- .AS Tcl_PackageInitProc *safeInitProc
- .AP Tcl_Interp *interp in
- 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
- hasn't yet been incorporated into any interpreter.
- .AP "CONST char" *pkgName in
- Name of the package; should be properly capitalized (first letter
- upper-case, all others lower-case).
- .AP Tcl_PackageInitProc *initProc in
- Procedure to invoke to incorporate this package into a trusted
- interpreter.
- .AP Tcl_PackageInitProc *safeInitProc in
- Procedure to call to incorporate this package into a safe interpreter
- (one that will execute untrusted scripts). NULL means the package
- can't be used in safe interpreters.
- .BE
- .SH DESCRIPTION
- .PP
- 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 fBTcl_StaticPackagefR has been invoked for a package, it
- may be loaded into interpreters using the fBloadfR command.
- fBTcl_StaticPackagefR is normally invoked only by the fBTcl_AppInitfR
- procedure for the application, not by packages for themselves
- (fBTcl_StaticPackagefR 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).
- .PP
- When the fBloadfR command is used later to load the package into
- an interpreter, one of fIinitProcfR and fIsafeInitProcfR will
- be invoked, depending on whether the target interpreter is safe
- or not.
- fIinitProcfR and fIsafeInitProcfR must both match the
- following prototype:
- .CS
- typedef int Tcl_PackageInitProc(Tcl_Interp *fIinterpfR);
- .CE
- The fIinterpfR argument identifies the interpreter in which the package
- is to be loaded. The initialization procedure must return fBTCL_OKfR or
- fBTCL_ERRORfR to indicate whether or not it completed successfully; in
- the event of an error it should set the interpreter's result to point to an
- error message. The result or error from the initialization procedure will
- be returned as the result of the fBloadfR command that caused the
- initialization procedure to be invoked.
- .SH KEYWORDS
- initialization procedure, package, static linking