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

📄 symlib.html

📁 vxworks相关论文
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/symLib.html - generated by refgen from symLib.c --> <title> symLib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.html"><i>VxWorks Reference Manual :  Libraries</i></a></p></blockquote><h1>symLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>symLib</strong> - symbol table subroutine library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./symLib.html#symLibInit">symLibInit</a></i>(&nbsp;)</b>  -  initialize the symbol table library<br><b><i><a href="./symLib.html#symTblCreate">symTblCreate</a></i>(&nbsp;)</b>  -  create a symbol table<br><b><i><a href="./symLib.html#symTblDelete">symTblDelete</a></i>(&nbsp;)</b>  -  delete a symbol table<br><b><i><a href="./symLib.html#symAdd">symAdd</a></i>(&nbsp;)</b>  -  create and add a symbol to a symbol table, including a group number<br><b><i><a href="./symLib.html#symRemove">symRemove</a></i>(&nbsp;)</b>  -  remove a symbol from a symbol table<br><b><i><a href="./symLib.html#symFindByName">symFindByName</a></i>(&nbsp;)</b>  -  look up a symbol by name<br><b><i><a href="./symLib.html#symFindByNameAndType">symFindByNameAndType</a></i>(&nbsp;)</b>  -  look up a symbol by name and type<br><b><i><a href="./symLib.html#symFindByValue">symFindByValue</a></i>(&nbsp;)</b>  -  look up a symbol by value<br><b><i><a href="./symLib.html#symFindByValueAndType">symFindByValueAndType</a></i>(&nbsp;)</b>  -  look up a symbol by value and type<br><b><i><a href="./symLib.html#symEach">symEach</a></i>(&nbsp;)</b>  -  call a routine to examine each entry in a symbol table<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This 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 <b><a href="./symLib.html#top">symLib</a></b> subroutines 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 you use the <b><a href="./symLib.html#top">symLib</a></b> subroutines to manipulate the VxWorks systemsymbol table (whose ID is recorded in the global <b>sysSymTbl</b>), thevalues 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(via boolean or) with <b>N_EXT</b> (1).  These values originate in thesection names for a.out object code format, but the VxWorks systemsymbol table uses them as symbol types across all object formats.(The VxWorks system symbol table also occasionally includes additionaltypes, in some object formats.)<p>Tables are created with <b><i><a href="./symLib.html#symTblCreate">symTblCreate</a></i>(&nbsp;)</b>, which returns a symbol table ID.This ID serves as a handle for symbol table operations, including theadding to, removing from, and searching of tables.  All operations on asymbol table are interlocked by means of a mutual-exclusion semaphorein the symbol table structure.  Tables are deleted with <b><i><a href="./symLib.html#symTblDelete">symTblDelete</a></i>(&nbsp;)</b>.<p>Symbols are added to a symbol table with <b><i><a href="./symLib.html#symAdd">symAdd</a></i>(&nbsp;)</b>.  Each symbol in thesymbol table has a name, a value, and a type.  Symbols are removed from asymbol table with <b><i><a href="./symLib.html#symRemove">symRemove</a></i>(&nbsp;)</b>.<p>Symbols can be accessed by either name or value.  The routine <b><i><a href="./symLib.html#symFindByName">symFindByName</a></i>(&nbsp;)</b>searches the symbol table for a symbol of a specified name.  The routine<b><i><a href="./symLib.html#symFindByValue">symFindByValue</a></i>(&nbsp;)</b> finds the symbol with the value closest to a specifiedvalue.  The routines <b><i><a href="./symLib.html#symFindByNameAndType">symFindByNameAndType</a></i>(&nbsp;)</b> and <b><i><a href="./symLib.html#symFindByValueAndType">symFindByValueAndType</a></i>(&nbsp;)</b>allow the symbol type to be used as an additional criterion in the searches.<p>Symbols in the symbol table are hashed by name into a hash table for fastlook-up by name, e.g., by <b><i><a href="./symLib.html#symFindByName">symFindByName</a></i>(&nbsp;)</b>.  The size of the hash table isspecified during the creation of a symbol table.  Look-ups by value, e.g.,<b><i><a href="./symLib.html#symFindByValue">symFindByValue</a></i>(&nbsp;)</b>, must search the table linearly; these look-ups can thus bemuch slower.<p>The routine <b><i><a href="./symLib.html#symEach">symEach</a></i>(&nbsp;)</b> allows each symbol in the symbol table to be examinedby a user-specified function.<p>Name clashes occur when a symbol added to a table is identical in name andtype to a previously added symbol.  Whether or not symbol tables can acceptname clashes is set by a parameter when the symbol table is created with<b><i><a href="./symLib.html#symTblCreate">symTblCreate</a></i>(&nbsp;)</b>.  If name clashes are not allowed, <b><i><a href="./symLib.html#symAdd">symAdd</a></i>(&nbsp;)</b> will return anerror if there is an attempt to add a symbol with identical name and type.If name clashes are allowed, adding multiple symbols with the same name andtype will be permitted.  In such cases, <b><i><a href="./symLib.html#symFindByName">symFindByName</a></i>(&nbsp;)</b> will return thevalue most recently added, although all versions of the symbol can be foundby <b><i><a href="./symLib.html#symEach">symEach</a></i>(&nbsp;)</b>.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>symLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./symLib.html#top">symLib</a></b>, <b><a href="./loadLib.html#top">loadLib</a></b><hr><a name="symLibInit"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>symLibInit</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>symLibInit</i>(&nbsp;)</strong> - initialize the symbol table library</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS symLibInit (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine initializes the symbol table package.  If the configurationmacro <b>INCLUDE_SYM_TBL</b> is defined, <b><i><a href="./symLib.html#symLibInit">symLibInit</a></i>(&nbsp;)</b> is called by the root task,<b><i><a href="./usrConfig.html#usrRoot">usrRoot</a></i>(&nbsp;)</b>, in <b>usrConfig.c</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the library could not be initialized.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./symLib.html#top">symLib</a></b><hr><a name="symTblCreate"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>symTblCreate</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>symTblCreate</i>(&nbsp;)</strong> - create a symbol table</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>SYMTAB_ID symTblCreate    (    int     hashSizeLog2, /* size of hash table as a power of 2 */    BOOL    sameNameOk,   /* allow 2 symbols of same name & type */    PART_ID symPartId     /* memory part ID for symbol allocation */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine creates and initializes a symbol table with a hash table of aspecified 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>Symbol table ID, or NULL if memory is insufficient.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./symLib.html#top">symLib</a></b><hr><a name="symTblDelete"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>symTblDelete</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>symTblDelete</i>(&nbsp;)</strong> - delete a symbol table</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS symTblDelete    (    SYMTAB_ID symTblId /* ID of symbol table to delete */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine deletes a specified symbol table.  It deallocates allassociated memory, including the hash table, and marks the table asinvalid.<p>Deletion of a table that still contains symbols results in 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 symbol table ID is invalid.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./symLib.html#top">symLib</a></b><hr><a name="symAdd"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>symAdd</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>symAdd</i>(&nbsp;)</strong> - create and add a symbol to a symbol table, including a group number</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS symAdd    (    SYMTAB_ID symTblId, /* symbol table to add symbol to */    char *    name,     /* pointer to symbol name string */    char *    value,    /* symbol address */    SYM_TYPE  type,     /* symbol type */    UINT16    group     /* symbol group */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine allocates a symbol <i>name</i> and adds it to a specified symboltable <i>symTblId</i> with the specified parameters <i>value</i>, <i>type</i>, and <i>group</i>.The <i>group</i> parameter specifies the group number assigned to a module whenit is loaded; see the manual entry for moduleLib.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the symbol table is invalidor there is insufficient memory for the symbol to be allocated.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./symLib.html#top">symLib</a></b>, <b><a href="./moduleLib.html#top">moduleLib</a></b><hr><a name="symRemove"></a><p align=right>

⌨️ 快捷键说明

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