1Tcl_PkgRequire(3) Tcl Library Procedures Tcl_PkgRequire(3)
2
3
4
5______________________________________________________________________________
6
8 Tcl_PkgRequire, Tcl_PkgRequireEx, Tcl_PkgPresent, Tcl_PkgPresentEx,
9 Tcl_PkgProvide, Tcl_PkgProvideEx - package version control
10
12 #include <tcl.h>
13
14 CONST char *
15 Tcl_PkgRequire(interp, name, version, exact)
16
17 CONST char *
18 Tcl_PkgRequireEx(interp, name, version, exact, clientDataPtr)
19
20 CONST char *
21 Tcl_PkgPresent(interp, name, version, exact)
22
23 CONST char *
24 Tcl_PkgPresentEx(interp, name, version, exact, clientDataPtr)
25
26 int
27 Tcl_PkgProvide(interp, name, version)
28
29 int
30 Tcl_PkgProvideEx(interp, name, version, clientData)
31
33 Tcl_Interp *interp (in) Interpreter where package is
34 needed or available.
35
36 CONST char *name (in) Name of package.
37
38 CONST char *version (in) A version string consisting of
39 one or more decimal numbers sep‐
40 arated by dots.
41
42 int exact (in) Non-zero means that only the
43 particular version specified by
44 version is acceptable. Zero
45 means that newer versions than
46 version are also acceptable as
47 long as they have the same major
48 version number as version.
49
50 ClientData clientData (in) Arbitrary value to be associated
51 with the package.
52
53 ClientData *clientDataPtr (out) Pointer to place to store the
54 value associated with the match‐
55 ing package. It is only changed
56 if the pointer is not NULL and
57 the function completed success‐
58 fully.
59_________________________________________________________________
60
61
63 These procedures provide C-level interfaces to Tcl's package and ver‐
64 sion management facilities.
65
66 Tcl_PkgRequire is equivalent to the package require command, Tcl_PkgP‐
67 resent is equivalent to the package present command, and Tcl_PkgProvide
68 is equivalent to the package provide command.
69
70 See the documentation for the Tcl commands for details on what these
71 procedures do.
72
73 If Tcl_PkgPresent or Tcl_PkgRequire complete successfully they return a
74 pointer to the version string for the version of the package that is
75 provided in the interpreter (which may be different than version); if
76 an error occurs they return NULL and leave an error message in the
77 interpreter's result.
78
79 Tcl_PkgProvide returns TCL_OK if it completes successfully; if an error
80 occurs it returns TCL_ERROR and leaves an error message in the inter‐
81 preter's result.
82
83 Tcl_PkgProvideEx, Tcl_PkgPresentEx and Tcl_PkgRequireEx allow the set‐
84 ting and retrieving of the client data associated with the package. In
85 all other respects they are equivalent to the matching functions.
86
87
89 package, present, provide, require, version
90
91
92
93Tcl 7.5 Tcl_PkgRequire(3)