Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

added tcl to libs

File size: 3.3 KB
Line 
1'\"
2'\" Copyright (c) 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: PkgRequire.3,v 1.11 2006/10/18 18:46:59 dgp Exp $
8'\"
9.so man.macros
10.TH Tcl_PkgRequire 3 7.5 Tcl "Tcl Library Procedures"
11.BS
12.SH NAME
13Tcl_PkgRequire, Tcl_PkgRequireEx, Tcl_PkgRequireProc, Tcl_PkgPresent, Tcl_PkgPresentEx, Tcl_PkgProvide, Tcl_PkgProvideEx \- package version control
14.SH SYNOPSIS
15.nf
16\fB#include <tcl.h>\fR
17.sp
18const char *
19\fBTcl_PkgRequire\fR(\fIinterp, name, version, exact\fR)
20.sp
21const char *
22\fBTcl_PkgRequireEx\fR(\fIinterp, name, version, exact, clientDataPtr\fR)
23.sp
24int
25\fBTcl_PkgRequireProc\fR(\fIinterp, name, objc, objv, clientDataPtr\fR)
26.sp
27const char *
28\fBTcl_PkgPresent\fR(\fIinterp, name, version, exact\fR)
29.sp
30const char *
31\fBTcl_PkgPresentEx\fR(\fIinterp, name, version, exact, clientDataPtr\fR)
32.sp
33int
34\fBTcl_PkgProvide\fR(\fIinterp, name, version\fR)
35.sp
36int
37\fBTcl_PkgProvideEx\fR(\fIinterp, name, version, clientData\fR)
38.SH ARGUMENTS
39.AS ClientData clientDataPtr out
40.AP Tcl_Interp *interp in
41Interpreter where package is needed or available.
42.AP "const char" *name in
43Name of package.
44.AP "const char" *version in
45A version string consisting of one or more decimal numbers
46separated by dots.
47.AP int exact in
48Non-zero means that only the particular version specified by
49\fIversion\fR is acceptable.
50Zero means that newer versions than \fIversion\fR are also
51acceptable as long as they have the same major version number
52as \fIversion\fR.
53.AP ClientData clientData in
54Arbitrary value to be associated with the package.
55.AP ClientData *clientDataPtr out
56Pointer to place to store the value associated with the matching
57package. It is only changed if the pointer is not NULL and the
58function completed successfully.
59.AP int objc in
60Number of requirements.
61.AP Tcl_Obj* objv[] in
62Array of requirements.
63.BE
64
65.SH DESCRIPTION
66.PP
67These procedures provide C-level interfaces to Tcl's package and
68version management facilities.
69.PP
70\fBTcl_PkgRequire\fR is equivalent to the \fBpackage require\fR
71command, \fBTcl_PkgPresent\fR is equivalent to the \fBpackage present\fR
72command, and \fBTcl_PkgProvide\fR is equivalent to the
73\fBpackage provide\fR command.
74.PP
75See the documentation for the Tcl commands for details on what these
76procedures do.
77.PP
78If \fBTcl_PkgPresent\fR or \fBTcl_PkgRequire\fR complete successfully
79they return a pointer to the version string for the version of the package
80that is provided in the interpreter (which may be different than
81\fIversion\fR); if an error occurs they return NULL and leave an error
82message in the interpreter's result.
83.PP
84\fBTcl_PkgProvide\fR returns \fBTCL_OK\fR if it completes successfully;
85if an error occurs it returns \fBTCL_ERROR\fR and leaves an error message
86in the interpreter's result.
87.PP
88\fBTcl_PkgProvideEx\fR, \fBTcl_PkgPresentEx\fR and \fBTcl_PkgRequireEx\fR
89allow the setting and retrieving of the client data associated with
90the package. In all other respects they are equivalent to the matching
91functions.
92.PP
93\fBTcl_PkgRequireProc\fR is the form of \fBpackage require\fR handling
94multiple requirements. The other forms are present for backward
95compatibility and translate their invokations to this form.
96
97.SH KEYWORDS
98package, present, provide, require, version
Note: See TracBrowser for help on using the repository browser.