Re: [Patch v3] string-list: Document STRING_LIST_INIT_* macros.
On Sun, Sep 5, 2010 at 9:22 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 15 quoted lines
>> @@ -34,10 +39,9 @@ member (you need this if you add things later) and you should set the
>> Example:
>>
>> ----
>> -struct string_list list;
>> +struct string_list list = STRING_LIST_DUP;
>> int i;
>>
>> -memset(&list, 0, sizeof(struct string_list));
>> string_list_append(&list, "foo");
>> string_list_append(&list, "bar");
>> for (i = 0; i < list.nr; i++)
>
> Probably worth copying and pasting this code to another file and
> trying it to make sure it works for the final draft.
I already done in the test-string-list.c patch I sent. :-)