X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2539fff313cbd67c45b8490f7961e45e358d9ba2..1a15a58a833bf3c852c54ae51645aece0bd72cfa:/include/xbt/dynar.h diff --git a/include/xbt/dynar.h b/include/xbt/dynar.h index c95e61920c..062e9442d6 100644 --- a/include/xbt/dynar.h +++ b/include/xbt/dynar.h @@ -1,26 +1,24 @@ /* $Id$ */ -/* dynar - a generic dynamic array */ +/* dynar - a generic dynamic array */ -/* Authors: Martin Quinson */ -/* Copyright (C) 2003 the OURAGAN project. */ +/* Copyright (c) 2003, 2004 Martin Quinson. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it - under the terms of the license (GNU LGPL) which comes with this package. */ + * under the terms of the license (GNU LGPL) which comes with this package. */ #ifndef _XBT_DYNAR_H #define _XBT_DYNAR_H #include "xbt/misc.h" /* BEGIN_DECL */ -BEGIN_DECL +BEGIN_DECL() +/** \brief Dictionnary data type + \ingroup XBT_dynar +*/ typedef struct xbt_dynar_s *xbt_dynar_t; -/* pointer to a function freeing something */ -typedef void (void_f_ppvoid_t)(void**); -typedef void (void_f_pvoid_t) (void*); - xbt_dynar_t xbt_dynar_new(unsigned long elm_size, void_f_pvoid_t *free_func); void xbt_dynar_free(xbt_dynar_t *dynar); @@ -69,21 +67,25 @@ void xbt_dynar_cursor_first (const xbt_dynar_t dynar, int *cursor); void xbt_dynar_cursor_step (const xbt_dynar_t dynar, int *cursor); int xbt_dynar_cursor_get (const xbt_dynar_t dynar, int *cursor, void *whereto); + /** + \brief Dynar iterator + \ingroup XBT_dynar * xbt_dynar_foreach: - * @_dynar: what to iterate over - * @_cursor: an integer used as cursor - * @_data: - * - * Iterates over the whole dynar. Example: + * \param _dynar what to iterate over + * \param _cursor an integer used as cursor + * \param _data * - * - * xbt_dynar_t *dyn; - * int cpt; - * string *str; - * xbt_dynar_foreach (dyn,cpt,str) { - * printf("Seen %s\n",str); - * } + * Iterates over the whole dynar. + * \note An example of usage: + * \code +xbt_dynar_t dyn; +int cpt; +string *str; +xbt_dynar_foreach (dyn,cpt,str) { + printf("Seen %s\n",str); +} +\endcode */ #define xbt_dynar_foreach(_dynar,_cursor,_data) \ for (xbt_dynar_cursor_first(_dynar,&(_cursor)) ; \ @@ -98,5 +100,5 @@ int xbt_dynar_cursor_get (const xbt_dynar_t dynar, int *cursor, void *whereto void xbt_dynar_cursor_rm(xbt_dynar_t dynar, int *const cursor); -END_DECL +END_DECL() #endif /* _XBT_DYNAR_H */