📄 pkgrequire.3
字号:
'\"'\" Copyright (c) 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: PkgRequire.3,v 1.6 2002/02/26 02:22:20 hobbs Exp $'\" .so man.macros.TH Tcl_PkgRequire 3 7.5 Tcl "Tcl Library Procedures".BS.SH NAMETcl_PkgRequire, Tcl_PkgRequireEx, Tcl_PkgPresent, Tcl_PkgPresentEx, Tcl_PkgProvide, Tcl_PkgProvideEx \- package version control.SH SYNOPSIS.nf\fB#include <tcl.h>\fR.spCONST char *\fBTcl_PkgRequire\fR(\fIinterp, name, version, exact\fR).spCONST char *\fBTcl_PkgRequireEx\fR(\fIinterp, name, version, exact, clientDataPtr\fR).spCONST char *\fBTcl_PkgPresent\fR(\fIinterp, name, version, exact\fR).spCONST char *\fBTcl_PkgPresentEx\fR(\fIinterp, name, version, exact, clientDataPtr\fR).spint\fBTcl_PkgProvide\fR(\fIinterp, name, version\fR).spint\fBTcl_PkgProvideEx\fR(\fIinterp, name, version, clientData\fR).SH ARGUMENTS.AS ClientData clientDataPtr.AP Tcl_Interp *interp inInterpreter where package is needed or available..AP "CONST char" *name inName of package..AP "CONST char" *version inA version string consisting of one or more decimal numbersseparated by dots..AP int exact inNon-zero means that only the particular version specified by\fIversion\fR is acceptable.Zero means that newer versions than \fIversion\fR are alsoacceptable as long as they have the same major version numberas \fIversion\fR..AP ClientData clientData inArbitrary value to be associated with the package..AP ClientData *clientDataPtr outPointer to place to store the value associated with the matchingpackage. It is only changed if the pointer is not NULL and thefunction completed successfully..BE.SH DESCRIPTION.PPThese procedures provide C-level interfaces to Tcl's package andversion management facilities..PP\fBTcl_PkgRequire\fR is equivalent to the \fBpackage require\fRcommand, \fBTcl_PkgPresent\fR is equivalent to the \fBpackage present\fRcommand, and \fBTcl_PkgProvide\fR is equivalent to the\fBpackage provide\fR command..PPSee the documentation for the Tcl commands for details on what theseprocedures do..PPIf \fBTcl_PkgPresent\fR or \fBTcl_PkgRequire\fR complete successfullythey return a pointer to the version string for the version of the packagethat is provided in the interpreter (which may be different than \fIversion\fR); if an error occurs they return NULL and leave an error message in the interpreter's result..PP\fBTcl_PkgProvide\fR returns TCL_OK if it completes successfully;if an error occurs it returns TCL_ERROR and leaves an error messagein the interpreter's result..PP\fBTcl_PkgProvideEx\fR, \fBTcl_PkgPresentEx\fR and \fBTcl_PkgRequireEx\fRallow the setting and retrieving of the client data associated withthe package. In all other respects they are equivalent to the matchingfunctions..SH KEYWORDSpackage, present, provide, require, version
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -