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

📄 distnamelib.html

📁 Vxworks API操作系统和驱动程序设计API。压缩的HTML文件
💻 HTML
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/distNameLib.html - generated by refgen from distNameLib.c --> <title> distNameLib </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>distNameLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>distNameLib</strong> - distributed name database library (VxFusion option) </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./distNameLib.html#distNameAdd">distNameAdd</a>(&nbsp;)</b>  -  add an entry to the distributed name database (VxFusion option)<br><b><a href="./distNameLib.html#distNameFind">distNameFind</a>(&nbsp;)</b>  -  find an object by name in the local database (VxFusion option)<br><b><a href="./distNameLib.html#distNameFindByValueAndType">distNameFindByValueAndType</a>(&nbsp;)</b>  -  look up the name of an object by value and type (VxFusion option)<br><b><a href="./distNameLib.html#distNameRemove">distNameRemove</a>(&nbsp;)</b>  -  remove an entry from the distributed name database (VxFusion option)<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library contains the distributed objects distributed name database androutines for manipulating it.  Symbolic names are bound to values, such asmessage queue identifiers or simple integers. Entries can be found by nameor by value and type.  The distributed name database is replicatedthroughout the system, with a copy sitting on each node.<p>The distributed name database library is initialized by calling<b><a href="./distLib.html#distInit">distInit</a>(&nbsp;)</b> in <b><a href="./distLib.html#top">distLib</a></b>.<p></blockquote><h4>AVAILABILITY</h4><blockquote><p>This module is distributed as a component of the unbundled distributedmessage queues option, VxFusion.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>distNameLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./distLib.html#top">distLib</a></b>, <b><a href="./distNameShow.html#top">distNameShow</a></b><hr><a name="distNameAdd"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>distNameAdd(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>distNameAdd(&nbsp;)</strong> - add an entry to the distributed name database (VxFusion option)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS distNameAdd    (    char *         name,      /* name to enter in database */    void *         value,     /* ptr to value to associate with name */    int            valueLen,  /* size of value in bytes */    DIST_NAME_TYPE type       /* type associated with name */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine adds the name of a specified object, along with its type and value, to the distributed objects distributed name database. All copies of the distributed name database within the system are updated.<p>The <i>name</i> parameter is an arbitrary, null-terminated string with amaximum of 20 characters, including the null terminator.<p>The value associated with <i>name</i> is located at <i>value</i> and is of length<i>valueLen</i>, currently limited to 8 bytes.<p>By convention, <i>type</i> values of less than 0x1000 are reserved by VxWorks;all other values are user definable.  The following types are pre-definedin <b>distNameLib.h</b> :<p><table><tr valign=top><th align=left>Type Name </th><th align=left> Value </th><th align=left> Datum</tr><tr><td colspan="3"><hr></tr><tr valign=top><td align=left>    <b>T_DIST_MSG_Q</b> </td><td align=left>  =  0 </td><td align=left> distributed message queue </tr><tr valign=top><td align=left>    <b>T_DIST_NODE</b> </td><td align=left> = 16 </td><td align=left> node ID</tr><tr valign=top><td align=left>    <b>T_DIST_UINT8</b> </td><td align=left> = 64 </td><td align=left> 8-bit unsigned integer</tr><tr valign=top><td align=left>    <b>T_DIST_UINT16</b> </td><td align=left> = 65 </td><td align=left> 16-bit unsigned integer</tr><tr valign=top><td align=left>    <b>T_DIST_UINT32</b> </td><td align=left> = 66 </td><td align=left> 32-bit unsigned integer</tr><tr valign=top><td align=left>    <b>T_DIST_UINT64</b> </td><td align=left> = 67 </td><td align=left> 64-bit unsigned integer</tr><tr valign=top><td align=left>    <b>T_DIST_FLOAT</b> </td><td align=left> = 68 </td><td align=left> float (32-bit)</tr><tr valign=top><td align=left>    <b>T_DIST_DOUBLE</b> </td><td align=left> = 69 </td><td align=left> double (64-bit)</tr><tr valign=top><td align=left></tr></tr></table>The byte-order of pre-defined types is preserved in abyte-order-heterogeneous network.<p>The value (and type!) bound to a symbolic name can be changed by calling<b><a href="./distNameLib.html#distNameAdd">distNameAdd</a>(&nbsp;)</b> with a new value (and type).<p>This routine returns OK, even if some nodes on the system do notrespond to the add request broadcast. A node that does not acknowledgea transmission is assumed to have crashed. You can use the <b><a href="./distLib.html#distCtl">distCtl</a>(&nbsp;)</b> routinein <b><a href="./distLib.html#top">distLib</a></b> to set a routine to be called in the event that a node crashes.<p></blockquote><h4>NOTE</h4><blockquote><p><p>If you add a distributed object ID (<b>T_DIST_MSG_Q</b>) to the database,another reference to the object is built. This reference is storedin the database. After the return of <b><a href="./distNameLib.html#distNameAdd">distNameAdd</a>(&nbsp;)</b>, <i>value</i> holds thereference (a new object ID). Use the ID returned by<b><a href="./distNameLib.html#distNameAdd">distNameAdd</a>(&nbsp;)</b> each time you want to address the global object boundto <i>name</i>. Subsequent updates of the binding in the database aretransparent. The original object ID specifies exactly thelocally created object.<p></blockquote><h4>AVAILABILITY</h4><blockquote><p>This routine is distributed as a component of the unbundled distributedmessage queues option, VxFusion.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the operation fails.<p></blockquote><h4>ERRNO</h4><blockquote><p><p><dl><dt><b>S_distNameLib_NAME_TOO_LONG</b><dd>The name being added to the database is too long.<dt><b>S_distNameLib_ILLEGAL_LENGTH</b><dd>The argument <i>valueLen</i> is not in the range 1 to 8.<dt><b>S_distNameLib_DATABASE_FULL</b><dd>The database is full.<dt><b>S_distNameLib_INCORRECT_LENGTH</b><dd>The argument <i>valueLen</i> is incorrect for the pre-defined <i>type</i>.</dl></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./distNameLib.html#top">distNameLib</a></b>, <b><a href="./distLib.html#top">distLib</a></b><hr><a name="distNameFind"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>distNameFind(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>distNameFind(&nbsp;)</strong> - find an object by name in the local database (VxFusion option)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS distNameFind    (    char *           name,    /* name to search for */    void * *         pValue,  /* where to return ptr to value */    DIST_NAME_TYPE * pType,   /* where to return type */    int              waitType /* NO_WAIT or WAIT_FOREVER */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine searches the distributed name database for an object matchinga specified <i>name</i>. If the object is found, a pointer to the value and itstype are copied to the address pointed to by <i>pValue</i> and <i>pType</i>.If the type is <b>T_DIST_MSG_Q</b>, the identifier returned can be used withgeneric message queue handling routines in <b><a href="./msgQLib.html#top">msgQLib</a></b>, such as <b><a href="./msgQLib.html#msgQSend">msgQSend</a>(&nbsp;)</b>, <b><a href="./msgQLib.html#msgQReceive">msgQReceive</a>(&nbsp;)</b>, and <b><a href="./msgQLib.html#msgQNumMsgs">msgQNumMsgs</a>(&nbsp;)</b>.<p></blockquote><h4>AVAILABILITY</h4><blockquote><p>This routine is distributed as a component of the unbundled distributedmessage queues option, VxFusion.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the search fails.<p></blockquote><h4>ERRNO</h4><blockquote><p><p><dl><dt><b>S_distNameLib_NAME_TOO_LONG</b><dd>The name to be found in the database is too long.<dt><b>S_distNameLib_INVALID_WAIT_TYPE</b><dd>The wait type should be either <b>NO_WAIT</b> or <b>WAIT_FOREVER</b> .</dl></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./distNameLib.html#top">distNameLib</a></b><hr><a name="distNameFindByValueAndType"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>distNameFindByValueAndType(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>distNameFindByValueAndType(&nbsp;)</strong> - look up the name of an object by value and type (VxFusion option)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS distNameFindByValueAndType    (    void *         value,     /* value to search for */    DIST_NAME_TYPE type,      /* type of object for which to search */    char *         name,      /* where to return name */    int            waitType   /* NO_WAIT or WAIT_FOREVER */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine searches the distributed name database for an object matchinga specified <i>value</i> and <i>type</i>. If the object is found, its name is copied to the address pointed to by <i>name</i>.<p></blockquote><h4>NOTE</h4><blockquote><p><p>Unlike the <b><a href="./smNameLib.html#smNameFindByValue">smNameFindByValue</a>(&nbsp;)</b> routine, used with the shared-memory objects name database, this routine must know the type of the objectbeing searched for. Searching on the value only might not return aunique object.<p></blockquote><h4>AVAILABILITY</h4><blockquote><p>This routine is distributed as a component of the unbundled distributedmessage queues option, VxFusion.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the search fails.<p></blockquote><h4>ERRNO</h4><blockquote><p><p><dl><dt><b>S_distNameLib_INVALID_WAIT_TYPE</b><dd>The wait type should be either <b>NO_WAIT</b> or <b>WAIT_FOREVER</b> .</dl></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./distNameLib.html#top">distNameLib</a></b><hr><a name="distNameRemove"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>distNameRemove(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>distNameRemove(&nbsp;)</strong> - remove an entry from the distributed name database (VxFusion option)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS distNameRemove    (    char * name               /* name of object to remove */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine removes an object, that is bound to <i>name</i>, from thedistributed name database.  All copies of the distributed name database get updated.<p>This routine returns OK, even if some nodes on the system do notrespond to the remove request broadcast.  A node that does not acknowledgea transmission is assumed to have crashed.You can use the <b><a href="./distLib.html#distCtl">distCtl</a>(&nbsp;)</b> routinein <b><a href="./distLib.html#top">distLib</a></b> to set a routine to be called in the event that a node crashes.<p>Removing the name of a distributed object ID (<b>T_DIST_MSG_Q</b>) does notinvalidate the object ID.<p></blockquote><h4>AVAILABILITY</h4><blockquote><p>This routine is distributed as a component of the unbundled distributedmessage queues option, VxFusion.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the operation fails.<p></blockquote><h4>ERRNO</h4><blockquote><p><p><dl><dt><b>S_distNameLib_NAME_TOO_LONG</b><dd>The name to be removed from the database is too long.</dl></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./distNameLib.html#top">distNameLib</a></b>, <b><a href="./distLib.html#top">distLib</a></b></body></html>

⌨️ 快捷键说明

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