X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/669623b3892d9a80c9fda5c3058929f66d6cf177..bd28fd4f9bcab896e194b4d853c0db02136bd683:/include/xbt/dynar.h diff --git a/include/xbt/dynar.h b/include/xbt/dynar.h index ae89b0248c..85dc88edde 100644 --- a/include/xbt/dynar.h +++ b/include/xbt/dynar.h @@ -11,18 +11,13 @@ #define _XBT_DYNAR_H #include "xbt/misc.h" /* SG_BEGIN_DECL */ +#include "xbt/function_types.h" SG_BEGIN_DECL() /** @addtogroup XBT_dynar * @brief DynArr are dynamically sized vector which may contain any type of variables. * - *
Up [\ref index]::[\ref XBT_API] - *
Prev [\ref XBT_config] - *
Next [\ref XBT_dict] - *
Down \ref XBT_dynar_cons\n\ref XBT_dynar_array\n\ref XBT_dynar_perl\n\ref XBT_dynar_ctn\n\ref XBT_dynar_speed\n\ref XBT_dynar_cursor - *
- * * These are the SimGrid version of the dynamically size arrays, which all C programmer recode one day or another. * * For performance concerns, the content of DynArr must be homogeneous (in @@ -31,7 +26,7 @@ SG_BEGIN_DECL() * structure creation (of type void_f_ppvoid_t or void_f_pvoid_t). * * \section XBT_dynar_exscal Example with scalar - * \dontinclude dynar_int.c + * \dontinclude dynar.c * * \skip Vars_decl * \skip dyn @@ -44,17 +39,16 @@ SG_BEGIN_DECL() * \until xbt_dynar_free * * \section XBT_dynar_exptr Example with pointed data - * \dontinclude dynar_string.c * - * \skip doxygen_first_cruft - * \skip f - * \until xbt_init + * \skip doxygen_string_cruft + * \skip function + * \until s2 * \skip Populate_str * \skip dyn * \until } * \skip macro * \until dynar_free - * \skip xbt_exit + * \skip end_of_doxygen * \until } * */ @@ -62,10 +56,6 @@ SG_BEGIN_DECL() /** @defgroup XBT_dynar_cons Dynar constructor and destructor * @ingroup XBT_dynar * - *
Up [\ref index]::[\ref XBT_API]::[\ref XBT_dynar] - *
Jump to --\>\ref XBT_dynar_cons\<--\n\ref XBT_dynar_array\n\ref XBT_dynar_perl\n\ref XBT_dynar_ctn\n\ref XBT_dynar_speed\n\ref XBT_dynar_cursor - *
- * * @{ */ /** \brief Dynar data type (opaque type) */ @@ -75,6 +65,7 @@ SG_BEGIN_DECL() xbt_dynar_t xbt_dynar_new(unsigned long elm_size, void_f_pvoid_t *free_func); void xbt_dynar_free(xbt_dynar_t *dynar); + void xbt_dynar_free_voidp(void *dynar); void xbt_dynar_free_container(xbt_dynar_t *dynar); unsigned long xbt_dynar_length(const xbt_dynar_t dynar); @@ -86,10 +77,6 @@ SG_BEGIN_DECL() /** @defgroup XBT_dynar_array Dynar as a regular array * @ingroup XBT_dynar * - *
Up [\ref index]::[\ref XBT_API]::[\ref XBT_dynar] - *
Jump to \ref XBT_dynar_cons\n--\>\ref XBT_dynar_array\<--\n\ref XBT_dynar_perl\n\ref XBT_dynar_ctn\n\ref XBT_dynar_speed\n\ref XBT_dynar_cursor - *
- * * @{ */ @@ -101,14 +88,12 @@ SG_BEGIN_DECL() void xbt_dynar_insert_at(xbt_dynar_t dynar, int idx, const void *src); void xbt_dynar_remove_at(xbt_dynar_t dynar, int idx, void * const dst); + int xbt_dynar_search(xbt_dynar_t dynar, void *elem); + int xbt_dynar_member(xbt_dynar_t dynar, void *elem); /** @} */ /** @defgroup XBT_dynar_perl Perl-like use of dynars * @ingroup XBT_dynar * - *
Up [\ref index]::[\ref XBT_API]::[\ref XBT_dynar] - *
Jump to \ref XBT_dynar_cons\n\ref XBT_dynar_array\n--\>\ref XBT_dynar_perl\<--\n\ref XBT_dynar_ctn\n\ref XBT_dynar_speed\n\ref XBT_dynar_cursor - *
- * * @{ */ @@ -122,11 +107,7 @@ SG_BEGIN_DECL() /** @defgroup XBT_dynar_ctn Direct manipulation to the dynars content * @ingroup XBT_dynar * - *
Up [\ref index]::[\ref XBT_API]::[\ref XBT_dynar] - *
Jump to \ref XBT_dynar_cons\n\ref XBT_dynar_array\n\ref XBT_dynar_perl\n--\>\ref XBT_dynar_ctn\<--\n\ref XBT_dynar_speed\n\ref XBT_dynar_cursor - *
- * - * Those functions do not retrive the content, but only their address. + * Those functions do not retrieve the content, but only their address. * * @{ */ @@ -140,11 +121,7 @@ SG_BEGIN_DECL() /** @defgroup XBT_dynar_speed Speed optimized access to dynars of scalars * @ingroup XBT_dynar * - *
Up [\ref index]::[\ref XBT_API]::[\ref XBT_dynar] - *
Jump to \ref XBT_dynar_cons\n\ref XBT_dynar_array\n\ref XBT_dynar_perl\n\ref XBT_dynar_ctn\n--\>\ref XBT_dynar_speed\<--\n\ref XBT_dynar_cursor - *
- * - * While the other functions use a memcpy to retrive the content into the + * While the other functions use a memcpy to retrieve the content into the * user provided area, those ones use a regular affectation. It only works * for scalar values, but should be a little faster. * @@ -180,10 +157,6 @@ SG_BEGIN_DECL() /** @defgroup XBT_dynar_cursor Cursors on dynar * @ingroup XBT_dynar * - *
Up [\ref index]::[\ref XBT_API]::[\ref XBT_dynar] - *
Jump to \ref XBT_dynar_cons\n\ref XBT_dynar_array\n\ref XBT_dynar_perl\n\ref XBT_dynar_ctn\n\ref XBT_dynar_speed\n--\>\ref XBT_dynar_cursor\<-- - *
- * * Cursors are used to iterate over the structure. Never add elements to the * DynArr during the traversal. To remove elements, use the * xbt_dynar_cursor_rm() function