VirtualBox

Changeset 38539 in vbox


Ignore:
Timestamp:
Aug 25, 2011 10:06:11 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
73687
Message:

Runtime/SgBuf: Add new method to get the next segment from the S/G buffer

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/mangling.h

    r38515 r38539  
    11221122# define RTSgBufSegArrayCreate                          RT_MANGLER(RTSgBufSegArrayCreate)
    11231123# define RTSgBufSet                                     RT_MANGLER(RTSgBufSet)
     1124# define RTSgBufGetNextSegment                          RT_MANGLER(RTSgBufGetNextSegment)
    11241125# define RTSha1                                         RT_MANGLER(RTSha1)
    11251126# define RTSha1Digest                                   RT_MANGLER(RTSha1Digest)
  • trunk/include/iprt/sg.h

    r31583 r38539  
    102102 */
    103103RTDECL(void) RTSgBufClone(PRTSGBUF pSgBufNew, PCRTSGBUF pSgBufOld);
     104
     105/**
     106 * Returns the next segment in the S/G buffer or NULL if no segment is left.
     107 *
     108 * @returns Pointer to the next segment in the S/G buffer.
     109 * @param   pSgBuf       The S/G buffer.
     110 * @param   pcbSeg       Where to store the size of the returned segment.
     111 *                       Holds the number of bytes requested initially or 0 to
     112 *                       indicate that the size doesn't matter.
     113 *                       This may contain fewer bytes on success if the current segment
     114 *                       is smaller than the amount of bytes requested.
     115 *
     116 * @note This operation advances the internal buffer pointer of both S/G buffers.
     117 */
     118RTDECL(void *) RTSgBufGetNextSegment(PRTSGBUF pSgBuf, size_t *pcbSeg);
    104119
    105120/**
  • trunk/src/VBox/Runtime/common/misc/sg.cpp

    r36312 r38539  
    111111
    112112
     113RTDECL(void *) RTSgBufGetNextSegment(PRTSGBUF pSgBuf, size_t *pcbSeg)
     114{
     115    AssertPtrReturn(pSgBuf, NULL);
     116    AssertPtrReturn(pcbSeg, NULL);
     117
     118    if (!*pcbSeg)
     119        *pcbSeg = pSgBuf->cbSegLeft;
     120
     121    return sgBufGet(pSgBuf, pcbSeg);
     122}
     123
     124
    113125RTDECL(size_t) RTSgBufCopy(PRTSGBUF pSgBufDst, PRTSGBUF pSgBufSrc, size_t cbCopy)
    114126{
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette