From: lurchi Date: Sun, 20 Aug 2017 23:09:15 +0000 (+0200) Subject: improve documentation about the GNUNET_array_append and GNUNET_array_grow macros X-Git-Tag: gnunet-0.11.0rc0~48^2^2~13 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=863211feb62023e37cad3f57cc72b2bb30262383;p=oweals%2Fgnunet.git improve documentation about the GNUNET_array_append and GNUNET_array_grow macros --- diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h index bda011fb2..950f5cc34 100644 --- a/src/include/gnunet_common.h +++ b/src/include/gnunet_common.h @@ -973,7 +973,8 @@ GNUNET_ntoh_double (double d); * arr is important since size is the number of elements and * not the size in bytes * @param size the number of elements in the existing vector (number - * of elements to copy over) + * of elements to copy over), will be updated with the new + * array size * @param tsize the target size for the resulting vector, use 0 to * free the vector (then, arr will be NULL afterwards). */ @@ -981,8 +982,16 @@ GNUNET_ntoh_double (double d); /** * @ingroup memory - * Append an element to a list (growing the - * list by one). + * Append an element to a list (growing the list by one). + * + * @param arr base-pointer of the vector, may be NULL if size is 0; + * will be updated to reflect the new address. The TYPE of + * arr is important since size is the number of elements and + * not the size in bytes + * @param size the number of elements in the existing vector (number + * of elements to copy over), will be updated with the new + * array size + * @param element the element that will be appended to the array */ #define GNUNET_array_append(arr,size,element) do { GNUNET_array_grow(arr,size,size+1); arr[size-1] = element; } while(0)