pfe-dlfcn-ext
Prev? | pfe Forth Wordset List | ?Next

## Name

pfe-dlfcn-ext ? Dynamic-Loading of code modules

## Synopsis

`(LOADM) ?=>? (` | `)`; | ?

`"FORTH"`;
?

`LOADM ( "filename" -- ) ?=>? (` | `)`; | ?

`"FORTH"`;
?

`LOCAL-DLSYM ( [symbol] -- symbol-addr ) ?=>? (` | `)`; | ?

`"FORTH"`;
?

`LOCAL-DLCALL ?=>? (` | `)`; | ?

`"FORTH"`;
?

`CALL-C ?=>? (` | `)`; | ?

`"EXTENSIONS"`;
?

`USELIBRARY ?=>? (` | `)`; | ?

`"EXTENSIONS"`;
?

`lt_dlinit ( -- dlinit-ior# ) ?=>? (` | `)`; | ?

`"EXTENSIONS"`;
?

`lt_dlopenext ( module-ptr module-len -- module-dl-handle*! | 0 ) ?=>? (` | `)`; | ?

`"EXTENSIONS"`;
?

`lt_dlsym ( symbol-ptr symbol-len module-dl-handle* -- symbol*! | 0 ) ?=>? (` | `)`; | ?

`"EXTENSIONS"`;
?

`lt_dlclose ( module-dl-handle* -- module-ior# ) ?=>? (` | `)`; | ?

`"EXTENSIONS"`;
?

`lt_dlerror ( -- dlerror-zstr* ) ?=>? (` | `)`; | ?

`"EXTENSIONS"`;
?

## Description

(LOADM) - no description, sorry

LOADM ( "filename" -- ) [FTH] => "FORTH"

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 ;

LOCAL-DLSYM ( [symbol] -- symbol-addr ) [FTH] [EXEC] => "FORTH"

lookup the symbol that follows and leave the address (or null)

LOCAL-DLCALL - no description, sorry

CALL-C - no description, sorry

USELIBRARY - no description, sorry

lt_dlinit ( -- dlinit-ior# ) [FTH] => "EXTENSIONS"

initialiize library, usually open the program itself so that its handles can be found under "0"

lt_dlopenext ( module-ptr module-len -- module-dl-handle*! | 0 ) [FTH] => "EXTENSIONS"

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.

lt_dlsym ( symbol-ptr symbol-len module-dl-handle* -- symbol*! | 0 ) [FTH] => "EXTENSIONS"

try to find the name in the binary module denoted by its handle .. if handle is null, use the main body of the program

lt_dlclose ( module-dl-handle* -- module-ior# ) [FTH] => "EXTENSIONS"

close handle that was returned by `lt_dlopenext`

lt_dlerror ( -- dlerror-zstr* ) => "EXTENSIONS"

returns string describing the last dlerror as for `lt_dlopenext` and `lt_dlsym`

Prev? | Up | ?Next
pfe-debug-ext? | Home | ?pfe-double-ext