-- Words for dynmaic loading of code modules
Copyright (C) Tektronix, Inc. 1998 - 2001. All rights reserved.
description: This file exports a set of system words for dynamic loading of code modules.
FORTH
(LOADM)
 ( .. )();
as:"paren-loadm";
ordinary primitive (LOADM)
an executable word (no special usage info)
or wrapper call around p4_paren_loadm
FORTH
LOADM
 ( 'filename' -- )();
p4:"loadm";
dlmap the shared object (or share an already mapped object) and run the per-thread initialization code. This is the user-convenient function, otherwise use (LOADM)
 simulate:
   : LOADM  BL WORD   
     ((IS_MODULE_LOADED)) IF EXIT THEN 
     HERE (LOADM)  0= IF ." -- load failed: " HERE COUNT TYPE CR THEN ;
 FORTH
| LOCAL-DLSYM
 ( [symbolname] -- address )exec-only( | ); | 
| ; | 
lookup the symbol that follows and leave the address (or null)
FORTH
| LOCAL-DLCALL
 ( .. )( | ); | 
| ; | 
immediate primitive LOCAL-DLCALL
an executable word (no special usage info)
or wrapper call around p4_local_dlcall
FORTH
DLSYM
 ( .. )();
as:"dlsym";
obsolete immediate DLSYM
is doing the same as LOCAL-DLSYM
This word should be replaced. It will be deleted in the near future. Instead use the (newer) synonym word given above.
FORTH
DLCALL
 ( .. )();
as:"dlcall";
obsolete immediate DLCALL
is doing the same as LOCAL-DLCALL
This word should be replaced. It will be deleted in the near future. Instead use the (newer) synonym word given above.
EXTENSIONS
CALL-C
 ( .. )();
as:"call-minus-c";
ordinary primitive CALL-C
an executable word (no special usage info)
or wrapper call around p4_call_c
EXTENSIONS
USELIBRARY
 ( .. )();
as:"uselibrary";
ordinary primitive USELIBRARY
an executable word (no special usage info)
or wrapper call around p4_uselibrary
EXTENSIONS
lt_dlinit
 ( -- ior )();
p4:"lt-dlinit";
initialiize library, usually open the program itself so that its handles can be found under "0"
EXTENSIONS
| lt_dlopenext
 ( name-ptr,len -- handle-ptr|0 )( | ); | 
| ; | 
walk the searchpath for dlopen and try to open a binary module under the given name with the usual file extension for the current system.
EXTENSIONS
| lt_dlsym
 ( name-ptr,len handle -- symbol-addr|0)( | ); | 
| ; | 
try to find the name in the binary module denoted by its handle .. if handle is null, use the main body of the program
EXTENSIONS
| lt_dlclose
 ( handle -- ior )( | ); | 
| ; | 
close handle that was returned by lt_dlopenext
EXTENSIONS
| lt_dlerror
 ( -- z-string* )( | ); | 
| ; | 
returns string describing the last dlerror as for lt_dlopenext and lt_dlsym