📄 modulelib.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/moduleLib.html - generated by refgen from moduleLib.c --> <title> moduleLib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.htm"><i>VxWorks API Reference : OS Libraries</i></a></p></blockquote><h1>moduleLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>moduleLib</strong> - object module management library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./moduleLib.html#moduleCreate">moduleCreate</a>( )</b> - create and initialize a module<br><b><a href="./moduleLib.html#moduleDelete">moduleDelete</a>( )</b> - delete module ID information (use <b><a href="./unldLib.html#unld">unld</a>( )</b> to reclaim space)<br><b><a href="./moduleLib.html#moduleShow">moduleShow</a>( )</b> - show the current status for all the loaded modules<br><b><a href="./moduleLib.html#moduleSegGet">moduleSegGet</a>( )</b> - get (delete and return) the first segment from a module<br><b><a href="./moduleLib.html#moduleSegFirst">moduleSegFirst</a>( )</b> - find the first segment in a module<br><b><a href="./moduleLib.html#moduleSegNext">moduleSegNext</a>( )</b> - find the next segment in a module<br><b><a href="./moduleLib.html#moduleCreateHookAdd">moduleCreateHookAdd</a>( )</b> - add a routine to be called when a module is added<br><b><a href="./moduleLib.html#moduleCreateHookDelete">moduleCreateHookDelete</a>( )</b> - delete a previously added module create hook routine<br><b><a href="./moduleLib.html#moduleFindByName">moduleFindByName</a>( )</b> - find a module by name<br><b><a href="./moduleLib.html#moduleFindByNameAndPath">moduleFindByNameAndPath</a>( )</b> - find a module by file name and path<br><b><a href="./moduleLib.html#moduleFindByGroup">moduleFindByGroup</a>( )</b> - find a module by group number<br><b><a href="./moduleLib.html#moduleIdListGet">moduleIdListGet</a>( )</b> - get a list of loaded modules<br><b><a href="./moduleLib.html#moduleInfoGet">moduleInfoGet</a>( )</b> - get information about an object module<br><b><a href="./moduleLib.html#moduleCheck">moduleCheck</a>( )</b> - verify checksums on all modules<br><b><a href="./moduleLib.html#moduleNameGet">moduleNameGet</a>( )</b> - get the name associated with a module ID<br><b><a href="./moduleLib.html#moduleFlagsGet">moduleFlagsGet</a>( )</b> - get the flags associated with a module ID<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library is a class manager, using the standard VxWorks class/objectfacilities. The library is used to keep track of which object moduleshave been loaded into VxWorks, to maintain information about objectmodule segments associated with each module, and to track whichsymbols belong to which module. Tracking modules makes it possible tolist which modules are currently loaded, and to unload them whenthey are no longer needed.<p>The module object contains the following information:<p> - name<br> - linked list of segments, including base addresses<br> and sizes<br> - symbol group number<br> - format of the object module (a.out, COFF, ECOFF, etc.)<br> - the <i>symFlag</i> passed to <b><a href="./usrLib.html#ld">ld</a>( )</b> when the module was<br> loaded. (For more information about <i>symFlag</i> and the<br> loader, see the manual entry for <b><a href="./loadLib.html#top">loadLib</a></b>.)<p>Multiple modules with the same name are allowed (the same module maybe loaded without first being unloaded) but "find" functions find themost recently created module.<p>The symbol group number is a unique number for each module, used toidentify the module's symbols in the symbol table. This number isassigned by <b><a href="./moduleLib.html#top">moduleLib</a></b> when a module is created.<p>In general, users will not access these routines directly, with theexception of <b><a href="./moduleLib.html#moduleShow">moduleShow</a>( )</b>, which displays information about currentlyloaded modules. Most calls to this library will be from routines in<b><a href="./loadLib.html#top">loadLib</a></b> and <b><a href="./unldLib.html#top">unldLib</a></b>.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>moduleLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./loadLib.html#top">loadLib</a></b>,<i>Tornado User's Guide: Cross-Development </i><hr><a name="moduleCreate"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>moduleCreate( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>moduleCreate( )</strong> - create and initialize a module</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>MODULE_ID moduleCreate ( char * name, /* module name */ int format, /* object module format */ int flags /* <i>symFlag</i> as passed to loader (see */ /* loadModuleAt()) */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine creates an object module descriptor.<p>The arguments specify the name of the object module file, the object module format, and an argument specifying which symbolsto add to the symbol table. See the <b><a href="./loadLib.html#loadModuleAt">loadModuleAt</a>( )</b> description of <i>symFlag</i>for possibles <i>flags</i> values.<p>Space for the new module is dynamically allocated.<p></blockquote><h4>RETURNS</h4><blockquote><p><b>MODULE_ID</b>, or NULL if there is an error.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./moduleLib.html#top">moduleLib</a></b>, <b><a href="./loadLib.html#loadModuleAt">loadModuleAt</a>( )</b><hr><a name="moduleDelete"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>moduleDelete( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>moduleDelete( )</strong> - delete module ID information (use <b><a href="./unldLib.html#unld">unld</a>( )</b> to reclaim space)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS moduleDelete ( MODULE_ID moduleId /* module to delete */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine deletes a module descriptor, freeing any space that wasallocated for the use of the module ID.<p>This routine does not free space allocated for the object module itself --this is done by <b><a href="./unldLib.html#unld">unld</a>( )</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./moduleLib.html#top">moduleLib</a></b><hr><a name="moduleShow"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>moduleShow( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>moduleShow( )</strong> - show the current status for all the loaded modules</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS moduleShow ( char * moduleNameOrId, /* name or ID of the module to show */ int options /* display options */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine displays a list of the currently loaded modules andsome information about where the modules are loaded.<p>The specific information displayed depends on the format of the objectmodules. In the case of a.out and ECOFF object modules, <b><a href="./moduleLib.html#moduleShow">moduleShow</a>( )</b> displaysthe start of the text, data, and BSS segments.<p>If <b><a href="./moduleLib.html#moduleShow">moduleShow</a>( )</b> is called with no arguments, a summary list of allloaded modules is displayed. It can also be called with an argument,<i>moduleNameOrId</i>, which can be either the name of a loaded module or amodule ID. If it is called with either of these, more informationabout the specified module will be displayed.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./moduleLib.html#top">moduleLib</a></b>, <i>VxWorks Programmer's Guide: Target Shell, </i><b><a href="../../tornado/tools/windsh.html#top" >windsh</a></b>, <i>Tornado User's Guide: Shell</i><hr><a name="moduleSegGet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>moduleSegGet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>moduleSegGet( )</strong> - get (delete and return) the first segment from a module</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>SEGMENT_ID moduleSegGet ( MODULE_ID moduleId /* module to get segment from */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine returns information about the first segment of a moduledescriptor, and then deletes the segment from the module.<p></blockquote><h4>RETURNS</h4><blockquote><p>A pointer to the segment ID, or NULL if the segment list is empty.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./moduleLib.html#top">moduleLib</a></b>, <b><a href="./moduleLib.html#moduleSegFirst">moduleSegFirst</a>( )</b><hr><a name="moduleSegFirst"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>moduleSegFirst( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>moduleSegFirst( )</strong> - find the first segment in a module</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>SEGMENT_ID moduleSegFirst ( MODULE_ID moduleId /* module to get segment from */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine returns information about the first segment of a moduledescriptor.<p></blockquote><h4>RETURNS</h4><blockquote><p>A pointer to the segment ID, or NULL if the segment list is empty.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./moduleLib.html#top">moduleLib</a></b>, <b><a href="./moduleLib.html#moduleSegGet">moduleSegGet</a>( )</b><hr><a name="moduleSegNext"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>moduleSegNext( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>moduleSegNext( )</strong> - find the next segment in a module</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>SEGMENT_ID moduleSegNext ( SEGMENT_ID segmentId /* segment whose successor is to be found */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine returns the segment in the list immediately following<i>segmentId</i>.<p></blockquote><h4>RETURNS</h4><blockquote><p>A pointer to the segment ID, or NULL if there is no next segment.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./moduleLib.html#top">moduleLib</a></b><hr><a name="moduleCreateHookAdd"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>moduleCreateHookAdd( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>moduleCreateHookAdd( )</strong> - add a routine to be called when a module is added</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS moduleCreateHookAdd ( FUNCPTR moduleCreateHookRtn /* routine called when module is added */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine adds a specified routine to a list of routines to becalled when a module is created. The specified routine should bedeclared as follows:<pre> void moduleCreateHook ( MODULE_ID moduleId /* the module ID */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -