Re: [PATCH/RFC v1 2/5] add strbuf_set operations documentation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 9, 2014 at 4:36 AM, Jeremiah Mahler <jmmahler@xxxxxxxxx> wrote:
> Add documentation of the strbuf_set operations to
> technical/api-strbuf.txt.

Since this patch is concise and so closely related to patch 1/5, it
probably should be squashed into that one.

More below.

> Signed-off-by: Jeremiah Mahler <jmmahler@xxxxxxxxx>
> ---
>  Documentation/technical/api-strbuf.txt | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
>
> diff --git a/Documentation/technical/api-strbuf.txt b/Documentation/technical/api-strbuf.txt
> index 077a709..ab430d9 100644
> --- a/Documentation/technical/api-strbuf.txt
> +++ b/Documentation/technical/api-strbuf.txt
> @@ -149,6 +149,24 @@ Functions
>         than zero if the first buffer is found, respectively, to be less than,
>         to match, or be greater than the second buffer.
>
> +* Setting the buffer
> +
> +`strbuf_set`::
> +
> +    Set the buffer to some data up to a given length.

I personally find this slightly ambiguous. Upon reading it, the first
question that pops into my mind is whether or not the existing strbuf
content is replaced (even though "set" should imply that it is). I
wonder if it would make sense to rewrite as:

    Set the buffer to [...], replacing the old content
    of the buffer.

Alternately:

    Replace the buffer content with [...].

Ditto for the others.

> +`strbuf_setstr`::
> +
> +       Set the buffer to a NUL-terminated string.
> +
> +`strbuf_setf`::
> +
> +       Set the buffer to a formatted string.
> +
> +`strbuf_setbuf`::
> +
> +       Set the current buffer to the contents of some other buffer.
> +
>  * Adding data to the buffer
>
>  NOTE: All of the functions in this section will grow the buffer as necessary.
> --
> 2.0.0.573.ged771ce.dirty
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]