aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_common.h
diff options
context:
space:
mode:
authorlurchi <lurchi@strangeplace.net>2017-08-21 01:09:15 +0200
committerlurchi <lurchi@strangeplace.net>2017-08-21 01:09:15 +0200
commit863211feb62023e37cad3f57cc72b2bb30262383 (patch)
treed7836f083c23cd7bdbba23d9b66fd311ee779502 /src/include/gnunet_common.h
parent024beb50aadb8e5a58dbb85cd3e819748dd4de3e (diff)
downloadgnunet-863211feb62023e37cad3f57cc72b2bb30262383.tar.gz
gnunet-863211feb62023e37cad3f57cc72b2bb30262383.zip
improve documentation about the GNUNET_array_append and GNUNET_array_grow macros
Diffstat (limited to 'src/include/gnunet_common.h')
-rw-r--r--src/include/gnunet_common.h15
1 files changed, 12 insertions, 3 deletions
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);
973 * arr is important since size is the number of elements and 973 * arr is important since size is the number of elements and
974 * not the size in bytes 974 * not the size in bytes
975 * @param size the number of elements in the existing vector (number 975 * @param size the number of elements in the existing vector (number
976 * of elements to copy over) 976 * of elements to copy over), will be updated with the new
977 * array size
977 * @param tsize the target size for the resulting vector, use 0 to 978 * @param tsize the target size for the resulting vector, use 0 to
978 * free the vector (then, arr will be NULL afterwards). 979 * free the vector (then, arr will be NULL afterwards).
979 */ 980 */
@@ -981,8 +982,16 @@ GNUNET_ntoh_double (double d);
981 982
982/** 983/**
983 * @ingroup memory 984 * @ingroup memory
984 * Append an element to a list (growing the 985 * Append an element to a list (growing the list by one).
985 * list by one). 986 *
987 * @param arr base-pointer of the vector, may be NULL if size is 0;
988 * will be updated to reflect the new address. The TYPE of
989 * arr is important since size is the number of elements and
990 * not the size in bytes
991 * @param size the number of elements in the existing vector (number
992 * of elements to copy over), will be updated with the new
993 * array size
994 * @param element the element that will be appended to the array
986 */ 995 */
987#define GNUNET_array_append(arr,size,element) do { GNUNET_array_grow(arr,size,size+1); arr[size-1] = element; } while(0) 996#define GNUNET_array_append(arr,size,element) do { GNUNET_array_grow(arr,size,size+1); arr[size-1] = element; } while(0)
988 997