Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Doc update.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Fri, 22 Nov 2013 06:58:22 +0000 (07:58 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Fri, 22 Nov 2013 07:00:10 +0000 (08:00 +0100)
src/xbt/dynar.c

index 247a834..b7ed051 100644 (file)
@@ -687,10 +687,13 @@ XBT_PUBLIC(void) xbt_dynar_three_way_partition(xbt_dynar_t const dynar,
 }
 
 /** @brief Transform a dynar into a NULL terminated array. 
- *  The dynar won't be usable afterwards.
- * \param dynar the dynar to transform
+ *
+ *  \param dynar the dynar to transform
+ *  \return pointer to the first element of the array
+ *
+ *  Note: The dynar won't be usable afterwards.
  */
-XBT_INLINE void * xbt_dynar_to_array (xbt_dynar_t dynar)
+XBT_INLINE void *xbt_dynar_to_array(xbt_dynar_t dynar)
 {
   void *res;
   xbt_dynar_shrink(dynar, 1);
@@ -700,8 +703,17 @@ XBT_INLINE void * xbt_dynar_to_array (xbt_dynar_t dynar)
   return res;
 }
 
-/*
- * Return 0 if d1 and d2 are equal and 1 if not equal
+/** @brief Compare two dynars
+ *
+ *  \param d1 first dynar to compare
+ *  \param d2 second dynar to compare
+ *  \param compar function to use to compare elements
+ *  \return 0 if d1 and d2 are equal and 1 if not equal
+ *
+ *  d1 and d2 should be dynars of pointers. The compar function takes two
+ *  elements and returns 0 when they are considered equal, and a value different
+ *  of zero when they are considered different. Finally, d2 is destroyed
+ *  afterwards.
  */
 int xbt_dynar_compare(xbt_dynar_t d1, xbt_dynar_t d2,
           int(*compar)(const void *, const void *))