⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dynaloader.3

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 3
📖 第 1 页 / 共 2 页
字号:
Error message text from the last failed DynaLoader function.  Notethat, similar to errno in unix, a successful function call does notreset this message..SpImplementations should detect the error as soon as it occurs in any ofthe other functions and save the corresponding message for laterretrieval.  This will avoid problems on some platforms (such as SunOS)where the error message is very temporary (e.g., \fIdlerror()\fR)..ie n .IP "$dl_debug" 4.el .IP "\f(CW$dl_debug\fR" 4.IX Item "$dl_debug"Internal debugging messages are enabled when \f(CW$dl_debug\fR is set true.Currently setting \f(CW$dl_debug\fR only affects the Perl side of theDynaLoader.  These messages should help an application developer toresolve any DynaLoader usage problems..Sp\&\f(CW$dl_debug\fR is set to \f(CW$ENV{\*(AqPERL_DL_DEBUG\*(Aq}\fR if defined..SpFor the DynaLoader developer/porter there is a similar debuggingvariable added to the C code (see dlutils.c) and enabled if Perl wasbuilt with the \fB\-DDEBUGGING\fR flag.  This can also be set via the\&\s-1PERL_DL_DEBUG\s0 environment variable.  Set to 1 for minimal information orhigher for more..IP "\fIdl_findfile()\fR" 4.IX Item "dl_findfile()"Syntax:.Sp.Vb 1\&    @filepaths = dl_findfile(@names).Ve.SpDetermine the full paths (including file suffix) of one or moreloadable files given their generic names and optionally one or moredirectories.  Searches directories in \f(CW@dl_library_path\fR by default andreturns an empty list if no files were found..SpNames can be specified in a variety of platform independent forms.  Anynames in the form \fB\-lname\fR are converted into \fIlibname.*\fR, where \fI.*\fR isan appropriate suffix for the platform..SpIf a name does not already have a suitable prefix and/or suffix thenthe corresponding file will be searched for by trying combinations ofprefix and suffix appropriate to the platform: \*(L"$name.o\*(R", \*(L"lib$name.*\*(R"and \*(L"$name\*(R"..SpIf any directories are included in \f(CW@names\fR they are searched before\&\f(CW@dl_library_path\fR.  Directories may be specified as \fB\-Ldir\fR.  Any othernames are treated as filenames to be searched for..SpUsing arguments of the form \f(CW\*(C`\-Ldir\*(C'\fR and \f(CW\*(C`\-lname\*(C'\fR is recommended..SpExample:.Sp.Vb 1\&    @dl_resolve_using = dl_findfile(qw(\-L/usr/5lib \-lposix));.Ve.IP "\fIdl_expandspec()\fR" 4.IX Item "dl_expandspec()"Syntax:.Sp.Vb 1\&    $filepath = dl_expandspec($spec).Ve.SpSome unusual systems, such as \s-1VMS\s0, require special filename handling inorder to deal with symbolic names for files (i.e., \s-1VMS\s0's Logical Names)..SpTo support these systems a \fIdl_expandspec()\fR function can be implementedeither in the \fIdl_*.xs\fR file or code can be added to the autoloadable\&\fIdl_expandspec()\fR function in \fIDynaLoader.pm\fR.  See \fIDynaLoader.pm\fR formore information..IP "\fIdl_load_file()\fR" 4.IX Item "dl_load_file()"Syntax:.Sp.Vb 1\&    $libref = dl_load_file($filename, $flags).Ve.SpDynamically load \f(CW$filename\fR, which must be the path to a shared objector library.  An opaque 'library reference' is returned as a handle forthe loaded object.  Returns undef on error..SpThe \f(CW$flags\fR argument to alters dl_load_file behaviour.  Assigned bits:.Sp.Vb 3\& 0x01  make symbols available for linking later dl_load_file\*(Aqs.\&       (only known to work on Solaris 2 using dlopen(RTLD_GLOBAL))\&       (ignored under VMS; this is a normal part of image linking).Ve.Sp(On systems that provide a handle for the loaded object such as SunOSand \s-1HPUX\s0, \f(CW$libref\fR will be that handle.  On other systems \f(CW$libref\fR willtypically be \f(CW$filename\fR or a pointer to a buffer containing \f(CW$filename\fR.The application should not examine or alter \f(CW$libref\fR in any way.).SpThis is the function that does the real work.  It should use thecurrent values of \f(CW@dl_require_symbols\fR and \f(CW@dl_resolve_using\fR if required..Sp.Vb 5\&    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]).Ve.Sp(The \fIdlopen()\fR function is also used by Solaris and some versions ofLinux, and is a common choice when providing a \*(L"wrapper\*(R" on othermechanisms as is done in the \s-1OS/2\s0 port.).IP "\fIdl_unload_file()\fR" 4.IX Item "dl_unload_file()"Syntax:.Sp.Vb 1\&    $status = dl_unload_file($libref).Ve.SpDynamically unload \f(CW$libref\fR, which must be an opaque 'library reference' asreturned from dl_load_file.  Returns one on success and zero on failure..SpThis function is optional and may not necessarily be provided on all platforms.If it is defined, it is called automatically when the interpreter exits forevery shared object or library loaded by DynaLoader::bootstrap.  All suchlibrary references are stored in \f(CW@dl_librefs\fR by DynaLoader::Bootstrap as itloads the libraries.  The files are unloaded in last-in, first-out order..SpThis unloading is usually necessary when embedding a shared-object perl (e.g.one configured with \-Duseshrplib) within a larger application, and the perlinterpreter is created and destroyed several times within the lifetime of theapplication.  In this case it is possible that the system dynamic linker willunload and then subsequently reload the shared libperl without relocating anyreferences to it from any files DynaLoaded by the previous incarnation of theinterpreter.  As a result, any shared objects opened by DynaLoader may point toa now invalid 'ghost' of the libperl shared object, causing apparently randommemory corruption and crashes.  This behaviour is most commonly seen when usingApache and mod_perl built with the \s-1APXS\s0 mechanism..Sp.Vb 5\&    SunOS: dlclose($libref)\&    HP\-UX: ???\&    Linux: ???\&    NeXT:  ???\&    VMS:   ???.Ve.Sp(The \fIdlclose()\fR function is also used by Solaris and some versions ofLinux, and is a common choice when providing a \*(L"wrapper\*(R" on othermechanisms as is done in the \s-1OS/2\s0 port.).IP "\fIdl_load_flags()\fR" 4.IX Item "dl_load_flags()"Syntax:.Sp.Vb 1\&    $flags = dl_load_flags $modulename;.Ve.SpDesigned to be a method call, and to be overridden by a derived class(i.e. a class which has DynaLoader in its \f(CW@ISA\fR).  The definition inDynaLoader itself returns 0, which produces standard behavior from\&\fIdl_load_file()\fR..IP "\fIdl_find_symbol()\fR" 4.IX Item "dl_find_symbol()"Syntax:.Sp.Vb 1\&    $symref = dl_find_symbol($libref, $symbol).Ve.SpReturn the address of the symbol \f(CW$symbol\fR or \f(CW\*(C`undef\*(C'\fR if not found.  If thetarget system has separate functions to search for symbols of differenttypes then \fIdl_find_symbol()\fR should search for function symbols first andthen other types..SpThe exact manner in which the address is returned in \f(CW$symref\fR is notcurrently defined.  The only initial requirement is that \f(CW$symref\fR canbe passed to, and understood by, \fIdl_install_xsub()\fR..Sp.Vb 5\&    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).Ve.IP "\fIdl_find_symbol_anywhere()\fR" 4.IX Item "dl_find_symbol_anywhere()"Syntax:.Sp.Vb 1\&    $symref = dl_find_symbol_anywhere($symbol).Ve.SpApplies \fIdl_find_symbol()\fR to the members of \f(CW@dl_librefs\fR and returnsthe first match found..IP "\fIdl_undef_symbols()\fR" 4.IX Item "dl_undef_symbols()"Example.Sp.Vb 1\&    @symbols = dl_undef_symbols().Ve.SpReturn a list of symbol names which remain undefined after \fIload_file()\fR.Returns \f(CW\*(C`()\*(C'\fR if not known.  Don't worry if your platform does not providea mechanism for this.  Most do not need it and hence do not provide it,they just return an empty list..IP "\fIdl_install_xsub()\fR" 4.IX Item "dl_install_xsub()"Syntax:.Sp.Vb 1\&    dl_install_xsub($perl_name, $symref [, $filename]).Ve.SpCreate a new Perl external subroutine named \f(CW$perl_name\fR using \f(CW$symref\fR asa pointer to the function which implements the routine.  This is simplya direct call to \fInewXSUB()\fR.  Returns a reference to the installedfunction..SpThe \f(CW$filename\fR parameter is used by Perl to identify the source file forthe function if required by \fIdie()\fR, \fIcaller()\fR or the debugger.  If\&\f(CW$filename\fR is not defined then \*(L"DynaLoader\*(R" will be used..IP "\fIbootstrap()\fR" 4.IX Item "bootstrap()"Syntax:.Spbootstrap($module).SpThis is the normal entry point for automatic dynamic loading in Perl..SpIt performs the following actions:.RS 4.IP "\(bu" 8locates an auto/$module directory by searching \f(CW@INC\fR.IP "\(bu" 8uses \fIdl_findfile()\fR to determine the filename to load.IP "\(bu" 8sets \f(CW@dl_require_symbols\fR to \f(CW\*(C`("boot_$module")\*(C'\fR.IP "\(bu" 8executes an \fIauto/$module/$module.bs\fR file if it exists(typically used to add to \f(CW@dl_resolve_using\fR any files whichare required to load the module on the current platform).IP "\(bu" 8calls \fIdl_load_flags()\fR to determine how to load the file..IP "\(bu" 8calls \fIdl_load_file()\fR to load the file.IP "\(bu" 8calls \fIdl_undef_symbols()\fR and warns if any symbols are undefined.IP "\(bu" 8calls \fIdl_find_symbol()\fR for \*(L"boot_$module\*(R".IP "\(bu" 8calls \fIdl_install_xsub()\fR to install it as \*(L"${module}::bootstrap\*(R".IP "\(bu" 8calls &{\*(L"${module}::bootstrap\*(R"} to bootstrap the module (actuallyit uses the function reference returned by dl_install_xsub for speed).RE.RS 4.RE.SH "AUTHOR".IX Header "AUTHOR"Tim Bunce, 11 August 1994..PPThis interface is based on the work and comments of (in no particularorder): Larry Wall, Robert Sanders, Dean Roehrich, Jeff Okamoto, AnnoSiegel, Thomas Neumann, Paul Marquess, Charles Bailey, myself and others..PPLarry Wall designed the elegant inherited bootstrap mechanism andimplemented the first Perl 5 dynamic loader using it..PPSolaris global loading added by Nick Ing-Simmons with design/codingassistance from Tim Bunce, January 1996.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -