VirtualBox

Changeset 30468 in vbox for trunk/include/iprt


Ignore:
Timestamp:
Jun 28, 2010 1:58:04 PM (15 years ago)
Author:
vboxsync
Message:

IPRT:

  • Corrected RTSGBUF member names.
  • Corrected RTSgBufInit parameter names.
  • Don't use AssertReturnVoid (and variations) in RTSgBuf* as there the result is that we use uninitialized structures. Better to crash and burn in IPRT then.
  • Added RTSocketSgWriteL/LV and RTTcpSgWriteL/LV for lazy guys like me.
  • RTSocketSgWrite doesn't need a do {} while (0).
Location:
trunk/include/iprt
Files:
3 edited

Legend:

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

    r28800 r30468  
    5656{
    5757    /** Pointer to the scatter/gather array. */
    58     PCRTSGSEG pcaSeg;
     58    PCRTSGSEG paSegs;
    5959    /** Number of segments. */
    60     unsigned  cSeg;
     60    unsigned  cSegs;
    6161    /** Current segment we are in. */
    6262    unsigned  idxSeg;
    6363    /** Pointer to the current segment start. */
    64     void     *pvSegCurr;
     64    void     *pvSegCur;
    6565    /** Number of bytes left in the current buffer. */
    6666    size_t    cbSegLeft;
     
    7878 * @returns nothing.
    7979 * @param   pSgBuf    Pointer to the S/G buffer to initialize.
    80  * @param   pcaSeg    Pointer to the start of the segment array.
    81  * @param   cSeg      Number of segments in the array.
    82  */
    83 RTDECL(void) RTSgBufInit(PRTSGBUF pSgBuf, PCRTSGSEG pcaSeg, unsigned cSeg);
     80 * @param   paSegs    Pointer to the start of the segment array.
     81 * @param   cSegs     Number of segments in the array.
     82 */
     83RTDECL(void) RTSgBufInit(PRTSGBUF pSgBuf, PCRTSGSEG paSegs, unsigned cSegs);
    8484
    8585/**
  • trunk/include/iprt/socket.h

    r30270 r30468  
    188188RTDECL(int) RTSocketSgWrite(RTSOCKET hSocket, PCRTSGBUF pSgBuf);
    189189
     190/**
     191 * Send data from multiple buffers to a socket.
     192 *
     193 * This is convenience wrapper around the RTSocketSgWrite and RTSgBufInit calls
     194 * for lazy coders.  The "L" in the function name is short for "list" just like
     195 * in the execl libc API.
     196 *
     197 * @returns IPRT status code.
     198 * @retval  VERR_INTERRUPTED if interrupted before anything was written.
     199 *
     200 * @param   hSocket         The socket handle.
     201 * @param   cSegs           The number of data segments in the following
     202 *                          ellipsis.
     203 * @param   ...             Pairs of buffer pointers (void const *) and buffer
     204 *                          sizes (size_t).  Make 101% sure the pointer is
     205 *                          really size_t.
     206 */
     207RTDECL(int) RTSocketSgWriteL(RTSOCKET hSocket, size_t cSegs, ...);
     208
     209/**
     210 * Send data from multiple buffers to a socket.
     211 *
     212 * This is convenience wrapper around the RTSocketSgWrite and RTSgBufInit calls
     213 * for lazy coders.  The "L" in the function name is short for "list" just like
     214 * in the execl libc API.
     215 *
     216 * @returns IPRT status code.
     217 * @retval  VERR_INTERRUPTED if interrupted before anything was written.
     218 *
     219 * @param   hSocket         The socket handle.
     220 * @param   cSegs           The number of data segments in the following
     221 *                          argument list.
     222 * @param   va              Pairs of buffer pointers (void const *) and buffer
     223 *                          sizes (size_t).  Make 101% sure the pointer is
     224 *                          really size_t.
     225 */
     226RTDECL(int) RTSocketSgWriteLV(RTSOCKET hSocket, size_t cSegs, va_list va);
     227
    190228/** @} */
    191229RT_C_DECLS_END
  • trunk/include/iprt/tcp.h

    r30270 r30468  
    292292RTR3DECL(int)  RTTcpSgWrite(RTSOCKET Sock, PCRTSGBUF pSgBuf);
    293293
     294
     295/**
     296 * Send data from multiple buffers to a socket.
     297 *
     298 * This is convenience wrapper around the RTSocketSgWrite and RTSgBufInit calls
     299 * for lazy coders.  The "L" in the function name is short for "list" just like
     300 * in the execl libc API.
     301 *
     302 * @returns IPRT status code.
     303 * @retval  VERR_INTERRUPTED if interrupted before anything was written.
     304 *
     305 * @param   hSocket         The socket handle.
     306 * @param   cSegs           The number of data segments in the following
     307 *                          ellipsis.
     308 * @param   ...             Pairs of buffer pointers (void const *) and buffer
     309 *                          sizes (size_t).  Make 101% sure the pointer is
     310 *                          really size_t.
     311 */
     312RTR3DECL(int) RTTcpSgWriteL(RTSOCKET hSocket, size_t cSegs, ...);
     313
     314/**
     315 * Send data from multiple buffers to a socket.
     316 *
     317 * This is convenience wrapper around the RTSocketSgWrite and RTSgBufInit calls
     318 * for lazy coders.  The "L" in the function name is short for "list" just like
     319 * in the execl libc API.
     320 *
     321 * @returns IPRT status code.
     322 * @retval  VERR_INTERRUPTED if interrupted before anything was written.
     323 *
     324 * @param   hSocket         The socket handle.
     325 * @param   cSegs           The number of data segments in the following
     326 *                          argument list.
     327 * @param   va              Pairs of buffer pointers (void const *) and buffer
     328 *                          sizes (size_t). Make 101% sure the pointer is
     329 *                          really size_t.
     330 */
     331RTR3DECL(int) RTTcpSgWriteLV(RTSOCKET hSocket, size_t cSegs, va_list va);
     332
    294333/** @} */
    295334RT_C_DECLS_END
Note: See TracChangeset for help on using the changeset viewer.

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