zbuflib.html

来自「Vxworks API操作系统和驱动程序设计API。压缩的HTML文件」· HTML 代码 · 共 776 行 · 第 1/3 页

HTML
776
字号
The zbuf segment ID for the first inserted segment,or NULL if the operation fails.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./zbufLib.html#top">zbufLib</a></b><hr><a name="zbufInsertBuf"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>zbufInsertBuf(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>zbufInsertBuf(&nbsp;)</strong> - create a zbuf segment from a buffer and insert into a zbuf</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>ZBUF_SEG zbufInsertBuf    (    ZBUF_ID     zbufId,       /* zbuf in which buffer is inserted */    ZBUF_SEG    zbufSeg,      /* zbuf segment base for <i>offset</i> */    int         offset,       /* relative byte offset */    caddr_t     buf,          /* application buffer for segment */    int         len,          /* number of bytes to insert */    VOIDFUNCPTR freeRtn,      /* free-routine callback */    int         freeArg       /* argument to free routine */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine creates a zbuf segment from the application buffer <i>buf</i>and inserts it at the specified byte location in <i>zbufId</i>.<p>The location of insertion is specified by <i>zbufSeg</i> and <i>offset</i>.  Seethe <b><a href="./zbufLib.html#top">zbufLib</a></b> manual page for more information on specifyinga byte location within a zbuf.  In particular, insertion withina zbuf occurs before the byte location specified by <i>zbufSeg</i> and <i>offset</i>.Additionally, <i>zbufSeg</i> and <i>offset</i> must be NULL and 0,respectively, when inserting into an empty zbuf.<p>The parameter <i>freeRtn</i> specifies a free-routine callback that runs whenthe data buffer <i>buf</i> is no longer referenced by any zbuf segments.  If<i>freeRtn</i> is NULL, the zbuf functions normally, except that theapplication is not notified when no more zbufs segments reference <i>buf</i>.The free-routine callback runs from the context of the task that lastdeletes reference to the buffer.  Declare the <i>freeRtn</i> callback asfollows (using whatever routine name suits your application):<pre>      void freeCallback          (          caddr_t     buf,    /* pointer to application buffer */          int         freeArg /* argument to free routine */          )</pre></blockquote><h4>VXWORKS AE PROTECTION DOMAINS</h4><blockquote><p>Under VxWorks AE, you can call this function from within the kernel protection domain only.  In addition, all arguments to this function can  reference only that data which is valid in the kernel protection domain. This restriction does not apply under non-AE versions of VxWorks.  <p></blockquote><h4>RETURNS</h4><blockquote><p><p>The zbuf segment ID of the inserted segment,or NULL if the operation fails.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./zbufLib.html#top">zbufLib</a></b><hr><a name="zbufInsertCopy"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>zbufInsertCopy(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>zbufInsertCopy(&nbsp;)</strong> - copy buffer data into a zbuf</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>ZBUF_SEG zbufInsertCopy    (    ZBUF_ID  zbufId,          /* zbuf into which data is copied */    ZBUF_SEG zbufSeg,         /* zbuf segment base for <i>offset</i> */    int      offset,          /* relative byte offset */    caddr_t  buf,             /* buffer from which data is copied */    int      len              /* number of bytes to copy */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine copies <i>len</i> bytes of data from the application buffer <i>buf</i>and inserts it at the specified byte location in <i>zbufId</i>.  Theapplication buffer is in no way tied to the zbuf after this operation;a separate copy of the data is made.<p>The location of insertion is specified by <i>zbufSeg</i> and <i>offset</i>.  Seethe <b><a href="./zbufLib.html#top">zbufLib</a></b> manual page for more information on specifyinga byte location within a zbuf.  In particular, insertion withina zbuf occurs before the byte location specified by <i>zbufSeg</i> and <i>offset</i>.Additionally, <i>zbufSeg</i> and <i>offset</i> must be NULL and 0,respectively, when inserting into an empty zbuf.<p></blockquote><h4>VXWORKS AE PROTECTION DOMAINS</h4><blockquote><p>Under VxWorks AE, you can call this function from within the kernel protection domain only.  In addition, all arguments to this function can  reference only that data which is valid in the kernel protection domain. Likewise, the returned value is valid in the protection domain only.This restriction does not apply under non-AE versions of VxWorks.  <p></blockquote><h4>RETURNS</h4><blockquote><p><p>The zbuf segment ID of the first inserted segment,or NULL if the operation fails.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./zbufLib.html#top">zbufLib</a></b><hr><a name="zbufExtractCopy"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>zbufExtractCopy(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>zbufExtractCopy(&nbsp;)</strong> - copy data from a zbuf to a buffer</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int zbufExtractCopy    (    ZBUF_ID  zbufId,          /* zbuf from which data is copied */    ZBUF_SEG zbufSeg,         /* zbuf segment base for <i>offset</i> */    int      offset,          /* relative byte offset */    caddr_t  buf,             /* buffer into which data is copied */    int      len              /* number of bytes to copy */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine copies <i>len</i> bytes of data from <i>zbufId</i> to the applicationbuffer <i>buf</i>.<p>The starting location of the copy is specified by <i>zbufSeg</i> and <i>offset</i>.See the <b><a href="./zbufLib.html#top">zbufLib</a></b> manual page for more information onspecifying a byte location within a zbuf.  In particular, the firstbyte copied is the exact byte specified by <i>zbufSeg</i> and <i>offset</i>.<p>The number of bytes to copy is given by <i>len</i>.  If this parameteris negative, or is larger than the number of bytes in the zbuf after thespecified byte location, the rest of the zbuf is copied.The bytes copied may span more than one segment.<p></blockquote><h4>VXWORKS AE PROTECTION DOMAINS</h4><blockquote><p>Under VxWorks AE, you can call this function from within the kernel protection domain only.  In addition, all arguments to this function can  reference only that data which is valid in the kernel protection domain. This restriction does not apply under non-AE versions of VxWorks.  <p></blockquote><h4>RETURNS</h4><blockquote><p><p>The number of bytes copied from the zbuf to the buffer,or ERROR if the operation fails.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./zbufLib.html#top">zbufLib</a></b><hr><a name="zbufCut"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>zbufCut(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>zbufCut(&nbsp;)</strong> - delete bytes from a zbuf</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>ZBUF_SEG zbufCut    (    ZBUF_ID  zbufId,          /* zbuf from which bytes are cut */    ZBUF_SEG zbufSeg,         /* zbuf segment base for <i>offset</i> */    int      offset,          /* relative byte offset */    int      len              /* number of bytes to cut */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine deletes <i>len</i> bytes from <i>zbufId</i> starting at the specifiedbyte location.<p>The starting location of deletion is specified by <i>zbufSeg</i> and <i>offset</i>.See the <b><a href="./zbufLib.html#top">zbufLib</a></b> manual page for more information onspecifying a byte location within a zbuf.  In particular, the firstbyte deleted is the exact byte specified by <i>zbufSeg</i> and <i>offset</i>.<p>The number of bytes to delete is given by <i>len</i>.  If this parameteris negative, or is larger than the number of bytes in the zbuf after thespecified byte location, the rest of the zbuf is deleted.The bytes deleted may span more than one segment.<p>If all the bytes in any one segment are deleted, then the segment isdeleted, and the data buffer that it referenced will be freed if noother zbuf segments reference it.  No segment may survive with zero bytesreferenced.<p>Deleting bytes out of the middle of a segment splits the segmentinto two.  The first segment contains the portion of the data bufferbefore the deleted bytes, while the other segment contains the endportion that remains after deleting <i>len</i> bytes.<p>This routine returns the zbuf segment ID of the segment justafter the deleted bytes.  In the case where bytes are cut off the endof a zbuf, a value of <b>ZBUF_NONE</b> is returned.<p></blockquote><h4>VXWORKS AE PROTECTION DOMAINS</h4><blockquote><p>Under VxWorks AE, you can call this function from within the kernel protection domain only.  In addition, all arguments to this function can  reference only that data which is valid in the kernel protection domain. Likewise, the returned value is valid in the protection domain only.This restriction does not apply under non-AE versions of VxWorks.  <p></blockquote><h4>RETURNS</h4><blockquote><p><p>The zbuf segment ID of the segment following the deleted bytes,or NULL if the operation fails.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./zbufLib.html#top">zbufLib</a></b><hr><a name="zbufSplit"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>zbufSplit(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>zbufSplit(&nbsp;)</strong> - split a zbuf into two separate zbufs</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>ZBUF_ID zbufSplit    (    ZBUF_ID  zbufId,          /* zbuf to split into two */    ZBUF_SEG zbufSeg,         /* zbuf segment base for <i>offset</i> */    int      offset           /* relative byte offset */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine splits <i>zbufId</i> into two separate zbufs at the specifiedbyte location.  The first portion remains in <i>zbufId</i>, while the endportion is returned in a newly created zbuf.<p>The location of the split is specified by <i>zbufSeg</i> and <i>offset</i>.  Seethe <b><a href="./zbufLib.html#top">zbufLib</a></b> manual page for more information on specifyinga byte location within a zbuf.  In particular, after the splitoperation, the first byte of the returned zbuf is the exact bytespecified by <i>zbufSeg</i> and <i>offset</i>.<p></blockquote><h4>VXWORKS AE PROTECTION DOMAINS</h4><blockquote><p>Under VxWorks AE, you can call this function from within the kernel protection domain only.  In addition, all arguments to this function can  reference only that data which is valid in the kernel protection domain. Likewise, the returned value is valid in the protection domain only.This restriction does not apply under non-AE versions of VxWorks.  <p></blockquote><h4>RETURNS</h4><blockquote><p><p>The zbuf ID of a newly created zbuf containing the end portion of <i>zbufId</i>,or NULL if the operation fails.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./zbufLib.html#top">zbufLib</a></b><hr>

⌨️ 快捷键说明

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