ucx/buffer.h

changeset 168
24a012440dee
parent 166
350a0e3898bd
child 169
279dd3ca7a77
     1.1 --- a/ucx/buffer.h	Tue May 06 10:56:54 2014 +0200
     1.2 +++ b/ucx/buffer.h	Tue May 06 12:03:16 2014 +0200
     1.3 @@ -120,8 +120,7 @@
     1.4   * 
     1.5   * @param src the source buffer
     1.6   * @param start the start position of extraction
     1.7 - * @param length the count of bytes to extract or 0 if all of the remaining
     1.8 - * bytes shall be extracted
     1.9 + * @param length the count of bytes to extract (must not be zero)
    1.10   * @param flags feature mask for the new buffer
    1.11   * @return a new buffer containing the extraction
    1.12   */
    1.13 @@ -136,7 +135,7 @@
    1.14   * @return a new buffer with the extracted content
    1.15   */
    1.16  #define ucx_buffer_clone(src,flags) \
    1.17 -    ucx_buffer_extract(src, 0, 0, flags)
    1.18 +    ucx_buffer_extract(src, 0, (src)->capacity, flags)
    1.19  
    1.20  /**
    1.21   * Moves the position of the buffer.
    1.22 @@ -186,12 +185,12 @@
    1.23   * the buffer capacity is doubled, as long as it would not hold the current
    1.24   * content plus the additional required bytes.
    1.25   * 
    1.26 - * <b>Attention:</b> the argument provided is the count of <i>additional</i>
    1.27 - * bytes the buffer shall hold. It is <b>NOT</b> the total count of bytes the
    1.28 + * <b>Attention:</b> the argument provided is the number of <i>additional</i>
    1.29 + * bytes the buffer shall hold. It is <b>NOT</b> the total number of bytes the
    1.30   * buffer shall hold.
    1.31   * 
    1.32   * @param buffer the buffer to extend
    1.33 - * @param additional_bytes the count of additional bytes the buffer shall
    1.34 + * @param additional_bytes the number of additional bytes the buffer shall
    1.35   * <i>at least</i> hold
    1.36   * @return 0 on success or a non-zero value on failure
    1.37   */

mercurial