📄 vxwsymtab.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/VXWSymTab.html - generated by refgen from /vobs/wpwr/docs/vxworks/ref/VXWSymTab.i --> <title> VXWSymTab </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.html"><i>VxWorks Reference Manual : Wind Foundation Classes</i></a></p></blockquote><h1>VXWSymTab</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>VXWSymTab</strong> - symbol table class</p></blockquote><h4>METHODS</h4><blockquote><p><p><b><i><a href="./VXWSymTab.html#VXWSymTab::VXWSymTab">VXWSymTab::VXWSymTab</a></i>( )</b> - create a symbol table<br><b><i><a href="./VXWSymTab.html#VXWSymTab::VXWSymTab_1">VXWSymTab::VXWSymTab</a></i>( )</b> - create a symbol-table object <br><b><i><a href="./VXWSymTab.html#VXWSymTab::~VXWSymTab">VXWSymTab::~VXWSymTab</a></i>( )</b> - delete a symbol table<br><b><i><a href="./VXWSymTab.html#VXWSymTab::add">VXWSymTab::add</a></i>( )</b> - create and add a symbol to a symbol table, including a group number<br><b><i><a href="./VXWSymTab.html#VXWSymTab::each">VXWSymTab::each</a></i>( )</b> - call a routine to examine each entry in a symbol table<br><b><i><a href="./VXWSymTab.html#VXWSymTab::findByName">VXWSymTab::findByName</a></i>( )</b> - look up a symbol by name<br><b><i><a href="./VXWSymTab.html#VXWSymTab::findByNameAndType">VXWSymTab::findByNameAndType</a></i>( )</b> - look up a symbol by name and type<br><b><i><a href="./VXWSymTab.html#VXWSymTab::findByValue">VXWSymTab::findByValue</a></i>( )</b> - look up a symbol by value<br><b><i><a href="./VXWSymTab.html#VXWSymTab::findByValueAndType">VXWSymTab::findByValueAndType</a></i>( )</b> - look up a symbol by value and type<br><b><i><a href="./VXWSymTab.html#VXWSymTab::remove">VXWSymTab::remove</a></i>( )</b> - remove a symbol from a symbol table<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This class library provides facilities for managing symbol tables. A symboltable associates a name and type with a value. A name is simply anarbitrary, null-terminated string. A symbol type is a small integer(typedef <b>SYM_TYPE</b>), and its value is a character pointer. Though commonlyused as the basis for object loaders, symbol tables may be used wheneverefficient association of a value with a name is needed.<p>If you use the VXWSymTab class to manage symbol tables local toyour own applications, the values for <b>SYM_TYPE</b> objects are completelyarbitrary; you can use whatever one-byte integers are appropriate foryour application.<p>If the VxWorks system symbol table is configured into your targetsystem, you can use the VXWSymTab class to manipulate it based onits symbol-table ID, recorded in the global <b>sysSymTbl</b>; see<b><i><a href="./VXWSymTab.html#VXWSymTab::VXWSymTab">VXWSymTab::VXWSymTab</a></i>( )</b> to construct an object based on this global.In the VxWorks target-resident global symbol table, the values for<b>SYM_TYPE</b> are <b>N_ABS</b>, <b>N_TEXT</b>, <b>N_DATA</b>, and <b>N_BSS</b> (defined in <b>a_out.h</b>);these are all even numbers, and any of them may be combined (viaboolean or) with <b>N_EXT</b> (1). These values originate in the sectionnames for a.out object code format, but the VxWorks system symboltable uses them as symbol types across all object formats. (TheVxWorks system symbol table also occasionally includes additionaltypes, in some object formats.)<p>All operations on a symbol table are interlocked by means of amutual-exclusion semaphore in the symbol table structure.<p>Symbols are added to a symbol table with <b><i><a href="./VXWSymTab.html#VXWSymTab::add">VXWSymTab::add</a></i>( )</b>. Eachsymbol in the symbol table has a name, a value, and a type.Symbols are removed from a symbol table with <b><i><a href="./VXWSymTab.html#VXWSymTab::remove">VXWSymTab::remove</a></i>( )</b>.<p>Symbols can be accessed by either name or value. The routine<b><i><a href="./VXWSymTab.html#VXWSymTab::findByName">VXWSymTab::findByName</a></i>( )</b> searches the symbol table for a symbol of aspecified name. The routine <b><i><a href="./VXWSymTab.html#VXWSymTab::findByValue">VXWSymTab::findByValue</a></i>( )</b> finds thesymbol with the value closest to a specified value. The routines<b><i><a href="./VXWSymTab.html#VXWSymTab::findByNameAndType">VXWSymTab::findByNameAndType</a></i>( )</b> and <b><i><a href="./VXWSymTab.html#VXWSymTab::findByValueAndType">VXWSymTab::findByValueAndType</a></i>( )</b>allow the symbol type to be used as an additional criterion in thesearches.<p>Symbols in the symbol table are hashed by name into a hash tablefor fast look-up by name, for instance with <b><i><a href="./VXWSymTab.html#VXWSymTab::findByName">VXWSymTab::findByName</a></i>( )</b>. Thesize of the hash table is specified during the creation of a symboltable. Look-ups by value, such as with <b><i><a href="./VXWSymTab.html#VXWSymTab::findByValue">VXWSymTab::findByValue</a></i>( )</b>, mustsearch the table linearly; these look-ups can thus be much slower.<p>The routine <b><i><a href="./VXWSymTab.html#VXWSymTab::each">VXWSymTab::each</a></i>( )</b> allows each symbol in the symboltable to be examined by a user-specified function.<p>Name clashes occur when a symbol added to a table is identical inname and type to a previously added symbol. Whether or not symboltables can accept name clashes is set by a parameter when thesymbol table is created with <b><i><a href="./VXWSymTab.html#VXWSymTab::VXWSymTab">VXWSymTab::VXWSymTab</a></i>( )</b>. If nameclashes are not allowed, <b><i><a href="./VXWSymTab.html#VXWSymTab::add">VXWSymTab::add</a></i>( )</b> returns an error ifthere is an attempt to add a symbol with identical name and type.If name clashes are allowed, adding multiple symbols with the samename and type is not an error. In such cases,<b><i><a href="./VXWSymTab.html#VXWSymTab::findByName">VXWSymTab::findByName</a></i>( )</b> returns the value most recently added,although all versions of the symbol can be found by<b><i><a href="./VXWSymTab.html#VXWSymTab::each">VXWSymTab::each</a></i>( )</b>.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>vxwSymLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./VXWSymTab.html#top">VXWSymTab</a></b>, VXWModule<hr><a name="VXWSymTab::VXWSymTab"></a><p align=right><a href="rtnIndex.html"><i>Wind Foundation Classes : Methods</i></a></p></blockquote><h1><i>VXWSymTab::VXWSymTab</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>VXWSymTab::VXWSymTab</i>( )</strong> - create a symbol table</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>VXWSymTab ( int hashSizeLog2, BOOL sameNameOk, PART_ID symPartId )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This constructor creates and initializes a symbol table with a hash table ofa specified size. The size of the hash table is specified as a power of two.For example, if <i>hashSizeLog2</i> is 6, a 64-entry hash table is created.<p>If <i>sameNameOk</i> is FALSE, attempting to add a symbol withthe same name and type as an already-existing symbol results in an error.<p>Memory for storing symbols as they are added to the symbol table will beallocated from the memory partition <i>symPartId</i>. The ID of the systemmemory partition is stored in the global variable <b>memSysPartId</b>, whichis declared in <b>memLib.h</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./VXWSymTab.html#top">VXWSymTab</a></b><hr><a name="VXWSymTab::VXWSymTab_1"></a><p align=right><a href="rtnIndex.html"><i>Wind Foundation Classes : Methods</i></a></p></blockquote><h1><i>VXWSymTab::VXWSymTab</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>VXWSymTab::VXWSymTab</i>( )</strong> - create a symbol-table object </p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>VXWSymTab ( SYMTAB_ID aSymTabId )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This constructor creates a symbol table object based on an existingsymbol table. For example, the following statement creates asymbol-table object for the VxWorks system symbol table (assumingyou have configured a target-resident symbol table into yourVxWorks system):<pre>VXWSymTab sSym;...sSym = VXWSymTab (sysSymTbl);</pre></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./VXWSymTab.html#top">VXWSymTab</a></b><hr><a name="VXWSymTab::~VXWSymTab"></a><p align=right><a href="rtnIndex.html"><i>Wind Foundation Classes : Methods</i></a></p></blockquote><h1><i>VXWSymTab::~VXWSymTab</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>VXWSymTab::~VXWSymTab</i>( )</strong> - delete a symbol table</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre> ~VXWSymTab ()</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine deletes a symbol table; it deallocates all memoryassociated with its symbol table, including the hash table, andmarks the table as invalid.<p>Deletion of a table that still contains symbols throws an error.Successful deletion includes the deletion of the internal hash table andthe deallocation of memory associated with the table. The table is markedinvalid to prohibit any future references.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the table still contains symbols.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./VXWSymTab.html#top">VXWSymTab</a></b><hr><a name="VXWSymTab::add"></a><p align=right><a href="rtnIndex.html"><i>Wind Foundation Classes : Methods</i></a></p></blockquote><h1><i>VXWSymTab::add</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>VXWSymTab::add</i>( )</strong> - create and add a symbol to a symbol table, including a group number</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS add ( char * name, char * value, SYM_TYPE type, UINT16 group )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -