PLDelphi
view release on metacpan or search on metacpan
basiclib/DynaLoader.pm-txt view on Meta::CPAN
To support these systems a dl_expandspec() function can be implemented
either in the F<dl_*.xs> file or code can be added to the autoloadable
dl_expandspec() function in F<DynaLoader.pm>. See F<DynaLoader.pm> for
more information.
=item dl_load_file()
Syntax:
$libref = dl_load_file($filename, $flags)
Dynamically load $filename, which must be the path to a shared object
or library. An opaque 'library reference' is returned as a handle for
the loaded object. Returns undef on error.
The $flags argument to alters dl_load_file behaviour.
Assigned bits:
0x01 make symbols available for linking later dl_load_file's.
(only known to work on Solaris 2 using dlopen(RTLD_GLOBAL))
(ignored under VMS; this is a normal part of image linking)
(On systems that provide a handle for the loaded object such as SunOS
and HPUX, $libref will be that handle. On other systems $libref will
typically be $filename or a pointer to a buffer containing $filename.
The application should not examine or alter $libref in any way.)
This is the function that does the real work. It should use the
current values of @dl_require_symbols and @dl_resolve_using if required.
SunOS: dlopen($filename)
HP-UX: shl_load($filename)
Linux: dld_create_reference(@dl_require_symbols); dld_link($filename)
NeXT: rld_load($filename, @dl_resolve_using)
VMS: lib$find_image_symbol($filename,$dl_require_symbols[0])
(The dlopen() function is also used by Solaris and some versions of
Linux, and is a common choice when providing a "wrapper" on other
mechanisms as is done in the OS/2 port.)
=item dl_unload_file()
Syntax:
$status = dl_unload_file($libref)
Dynamically unload $libref, which must be an opaque 'library reference' as
returned from dl_load_file. Returns one on success and zero on failure.
This function is optional and may not necessarily be provided on all platforms.
If it is defined, it is called automatically when the interpreter exits for
every shared object or library loaded by DynaLoader::bootstrap. All such
library references are stored in @dl_librefs by DynaLoader::Bootstrap as it
loads the libraries. The files are unloaded in last-in, first-out order.
This unloading is usually necessary when embedding a shared-object perl (e.g.
one configured with -Duseshrplib) within a larger application, and the perl
interpreter is created and destroyed several times within the lifetime of the
application. In this case it is possible that the system dynamic linker will
unload and then subsequently reload the shared libperl without relocating any
references to it from any files DynaLoaded by the previous incarnation of the
interpreter. As a result, any shared objects opened by DynaLoader may point to
a now invalid 'ghost' of the libperl shared object, causing apparently random
memory corruption and crashes. This behaviour is most commonly seen when using
Apache and mod_perl built with the APXS mechanism.
SunOS: dlclose($libref)
HP-UX: ???
Linux: ???
NeXT: ???
VMS: ???
(The dlclose() function is also used by Solaris and some versions of
Linux, and is a common choice when providing a "wrapper" on other
mechanisms as is done in the OS/2 port.)
=item dl_loadflags()
Syntax:
$flags = dl_loadflags $modulename;
Designed to be a method call, and to be overridden by a derived class
(i.e. a class which has DynaLoader in its @ISA). The definition in
DynaLoader itself returns 0, which produces standard behavior from
dl_load_file().
=item dl_find_symbol()
Syntax:
$symref = dl_find_symbol($libref, $symbol)
Return the address of the symbol $symbol or C<undef> if not found. If the
target system has separate functions to search for symbols of different
types then dl_find_symbol() should search for function symbols first and
then other types.
The exact manner in which the address is returned in $symref is not
currently defined. The only initial requirement is that $symref can
be passed to, and understood by, dl_install_xsub().
SunOS: dlsym($libref, $symbol)
HP-UX: shl_findsym($libref, $symbol)
Linux: dld_get_func($symbol) and/or dld_get_symbol($symbol)
NeXT: rld_lookup("_$symbol")
VMS: lib$find_image_symbol($libref,$symbol)
=item dl_find_symbol_anywhere()
Syntax:
$symref = dl_find_symbol_anywhere($symbol)
Applies dl_find_symbol() to the members of @dl_librefs and returns
the first match found.
=item dl_undef_symbols()
( run in 2.022 seconds using v1.01-cache-2.11-cpan-71847e10f99 )