[Spice-devel] [PATCH server v2 06/13] channel: document pipes_create_batch() function

Marc-André Lureau marcandre.lureau at gmail.com
Fri Jan 15 04:32:56 PST 2016


Hi

On Fri, Jan 15, 2016 at 11:46 AM, Frediano Ziglio <fziglio at redhat.com> wrote:
>>
>> Rename callback to pipe_add, and document the arguments.
>>
>> Signed-off-by: Marc-André Lureau <marcandre.lureau at gmail.com>
>> ---
>>  server/red-channel.c | 16 ++++++++++++----
>>  1 file changed, 12 insertions(+), 4 deletions(-)
>>
>> diff --git a/server/red-channel.c b/server/red-channel.c
>> index b33c91d..7296820 100644
>> --- a/server/red-channel.c
>> +++ b/server/red-channel.c
>> @@ -2240,21 +2240,29 @@ int red_client_during_migrate_at_target(RedClient
>> *client)
>>  typedef void (*rcc_item_t)(RedChannelClient *rcc, PipeItem *item);
>>  typedef int (*rcc_item_cond_t)(RedChannelClient *rcc, PipeItem *item);
>>
>> +/**
>> + * red_channel_pipes_create_batch:
>> + * @channel: a channel
>> + * @creator: a callback to create pipe item (not null)
>> + * @data: the data to pass to the creator
>> + * @pipe_add: a callback to add pipe items (not null)
>> + **/
>>  static void red_channel_pipes_create_batch(RedChannel *channel,
>>                                  new_pipe_item_t creator, void *data,
>> -                                rcc_item_t callback)
>> +                                rcc_item_t pipe_add)
>>  {
>>      RingItem *link, *next;
>>      RedChannelClient *rcc;
>>      PipeItem *item;
>>      int num = 0;
>>
>> +    spice_assert(creator != NULL);
>> +    spice_assert(pipe_add != NULL);
>> +
>>      RING_FOREACH_SAFE(link, next, &channel->clients) {
>>          rcc = SPICE_CONTAINEROF(link, RedChannelClient, channel_link);
>>          item = (*creator)(rcc, data, num++);
>> -        if (callback) {
>> -            (*callback)(rcc, item);
>> -        }
>> +        (*pipe_add)(rcc, item);
>>      }
>>  }
>>
>
> Looks fine however is not clear which documentation format is this.
> Doesn't seem Doxygen.
>

It's gtkdoc (I have editor macros to generate the docs).
Since we are moving to gobject, I suppose that's the proper format to
use these days?

> Reviewed-by: Frediano Ziglio <fziglio at redhat.com>
>
> Frediano



-- 
Marc-André Lureau


More information about the Spice-devel mailing list