Go to main content

man pages section 3: Extended Library Functions, Volume 1

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

Tcl_LoadFile (3tcl)

Name

Tcl_LoadFile - independent dynamic library loading

Synopsis

#include <tcl.h>

int
Tcl_LoadFile(interp, pathPtr, symbols, flags, procPtrs, loadHandlePtr)

void *
Tcl_FindSymbol(interp, loadHandle, symbol)

Description

Load(3tcl)                  Tcl Library Procedures                  Load(3tcl)



______________________________________________________________________________

NAME
       Tcl_LoadFile,  Tcl_FindSymbol  -  platform-independent  dynamic library
       loading

SYNOPSIS
       #include <tcl.h>

       int
       Tcl_LoadFile(interp, pathPtr, symbols, flags, procPtrs, loadHandlePtr)

       void *
       Tcl_FindSymbol(interp, loadHandle, symbol)

ARGUMENTS
       Tcl_Interp *interp (in)                 Interpreter to use for  report-
                                               ing error messages.

       Tcl_Obj *pathPtr (in)                   The  name  of the file to load.
                                               If it is  a  single  name,  the
                                               library search path of the cur-
                                               rent environment will  be  used
                                               to resolve it.

       const char *const symbols[] (in)        Array of names of symbols to be
                                               resolved during the load of the
                                               library,  or NULL if no symbols
                                               are to be resolved. If an array
                                               is given, the last entry in the
                                               array must be NULL.

       int flags (in)                          The value should normally be 0,
                                               but      TCL_LOAD_GLOBAL     or
                                               TCL_LOAD_LAZY or a  combination
                                               of  those  two  is  allowed  as
                                               well.

       void *procPtrs (out)                    Points to an  array  that  will
                                               hold the addresses of the func-
                                               tions described in the  symbols
                                               argument.  Should be NULL if no
                                               symbols are to be resolved.

       Tcl_LoadHandle *loadHandlePtr (out)     Points to a variable that  will
                                               hold the handle to the abstract
                                               token  describing  the  library
                                               that has been loaded.

       Tcl_LoadHandle loadHandle (in)          Abstract  token  describing the
                                               library to look up a symbol in.

       const char *symbol (in)                 The name of the symbol to  look
                                               up.
______________________________________________________________________________

DESCRIPTION
       Tcl_LoadFile  loads  a  file from the filesystem (including potentially
       any virtual filesystem that has been installed) and provides  a  handle
       to  it  that  may  be used in further operations. The symbols array, if
       non-NULL, supplies a set of names of symbols (typically functions) that
       must be resolved from the library and which will be stored in the array
       indicated by procPtrs. If any of the symbols is not resolved, the load-
       ing of the file will fail with an error message left in the interpreter
       (if that is non-NULL).  The result of Tcl_LoadFile is  a  standard  Tcl
       error code. The library may be unloaded with Tcl_FSUnloadFile.

       Tcl_FindSymbol  locates a symbol in a loaded library and returns it. If
       the symbol cannot be found, it returns NULL and sets an  error  message
       in  the  given  interp (if that is non-NULL). Note that it is unsafe to
       use this operation on a handle that has been  passed  to  Tcl_FSUnload-
       File.


ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:


       +---------------+------------------+
       |ATTRIBUTE TYPE | ATTRIBUTE VALUE  |
       +---------------+------------------+
       |Availability   | runtime/tcl-8    |
       +---------------+------------------+
       |Stability      | Uncommitted      |
       +---------------+------------------+

SEE ALSO
       Tcl_FSLoadFile(3), Tcl_FSUnloadFile(3), load(n), unload(n)

KEYWORDS
       binary code, loading, shared library



NOTES
       Source  code  for open source software components in Oracle Solaris can
       be found at https://www.oracle.com/downloads/opensource/solaris-source-
       code-downloads.html.

       This     software     was    built    from    source    available    at
       https://github.com/oracle/solaris-userland.   The  original   community
       source was downloaded from  http://prdownloads.sourceforge.net/tcl/tcl-
       core8.6.7-src.tar.gz.

       Further information about this software can be found on the open source
       community website at https://www.tcl.tk/.



Tcl                                   8.6                           Load(3tcl)