1Load(3)                     Tcl Library Procedures                     Load(3)
2
3
4
5______________________________________________________________________________
6

NAME

8       Tcl_LoadFile,  Tcl_FindSymbol  -  platform-independent  dynamic library
9       loading
10

SYNOPSIS

12       #include <tcl.h>
13
14       int
15       Tcl_LoadFile(interp, pathPtr, symbols, flags, procPtrs, loadHandlePtr)
16
17       void *
18       Tcl_FindSymbol(interp, loadHandle, symbol)
19

ARGUMENTS

21       Tcl_Interp *interp (in)                 Interpreter to use for  report‐
22                                               ing error messages.
23
24       Tcl_Obj *pathPtr (in)                   The  name  of the file to load.
25                                               If it is a single name, the li‐
26                                               brary  search  path of the cur‐
27                                               rent environment will  be  used
28                                               to resolve it.
29
30       const char *const symbols[] (in)        Array of names of symbols to be
31                                               resolved during the load of the
32                                               library,  or NULL if no symbols
33                                               are to be resolved. If an array
34                                               is given, the last entry in the
35                                               array must be NULL.
36
37       int flags (in)                          The value should normally be 0,
38                                               but      TCL_LOAD_GLOBAL     or
39                                               TCL_LOAD_LAZY or a  combination
40                                               of  those  two  is  allowed  as
41                                               well.
42
43       void *procPtrs (out)                    Points to an  array  that  will
44                                               hold the addresses of the func‐
45                                               tions described in the  symbols
46                                               argument.  Should be NULL if no
47                                               symbols are to be resolved.
48
49       Tcl_LoadHandle *loadHandlePtr (out)     Points to a variable that  will
50                                               hold the handle to the abstract
51                                               token  describing  the  library
52                                               that has been loaded.
53
54       Tcl_LoadHandle loadHandle (in)          Abstract  token  describing the
55                                               library to look up a symbol in.
56
57       const char *symbol (in)                 The name of the symbol to  look
58                                               up.
59______________________________________________________________________________
60

DESCRIPTION

62       Tcl_LoadFile  loads  a  file from the filesystem (including potentially
63       any virtual filesystem that has been installed) and provides  a  handle
64       to  it  that  may  be used in further operations. The symbols array, if
65       non-NULL, supplies a set of names of symbols (typically functions) that
66       must be resolved from the library and which will be stored in the array
67       indicated by procPtrs. If any of the symbols is not resolved, the load‐
68       ing of the file will fail with an error message left in the interpreter
69       (if that is non-NULL).  The result of Tcl_LoadFile is  a  standard  Tcl
70       error code. The library may be unloaded with Tcl_FSUnloadFile.
71
72       Tcl_FindSymbol  locates a symbol in a loaded library and returns it. If
73       the symbol cannot be found, it returns NULL and sets an  error  message
74       in  the  given  interp (if that is non-NULL). Note that it is unsafe to
75       use this operation on a handle that has been  passed  to  Tcl_FSUnload‐
76       File.
77

SEE ALSO

79       Tcl_FSLoadFile(3), Tcl_FSUnloadFile(3), load(n), unload(n)
80

KEYWORDS

82       binary code, loading, shared library
83
84
85
86Tcl                                   8.6                              Load(3)
Impressum