From 00e10260c18a854d25ebf608ab62f3b59e262a61 Mon Sep 17 00:00:00 2001 From: alegrand Date: Fri, 26 Aug 2005 01:43:22 +0000 Subject: [PATCH] fixing the doc... git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1667 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- doc/FAQ.doc | 2 +- doc/index.doc | 2 +- doc/module-xbt.doc | 7 ++++-- include/xbt/fifo.h | 55 ++++++++++++++++++++++++++++++++-------------- src/xbt/fifo.c | 11 ---------- 5 files changed, 46 insertions(+), 31 deletions(-) diff --git a/doc/FAQ.doc b/doc/FAQ.doc index efd0684357..04ba62e1f1 100644 --- a/doc/FAQ.doc +++ b/doc/FAQ.doc @@ -147,7 +147,7 @@ You are at the right place... Having a look to these slides may give you some insights on what SimGrid can help you to do and what are its limitations. Then you definitely should read the \ref -MSG_examples. There is also a mailing list: . +MSG_examples. There is also a mailing list: . \subsection faq_generic Building a generic simulator diff --git a/doc/index.doc b/doc/index.doc index 8e8396b2be..fe46817bcb 100644 --- a/doc/index.doc +++ b/doc/index.doc @@ -74,7 +74,7 @@ The base of the whole toolkit is constituted by the \ref XBT_API (eXtended Bundle of Tools). It is a portable library providing some grounding features such as \ref -XBT_log, \ref XBT_ex, \ref XBT_error and \ref XBT_config. XBT also encompass +XBT_log, \ref XBT_ex and \ref XBT_config. XBT also encompass the following convenient datastructures: \ref XBT_dynar, \ref XBT_fifo, \ref XBT_dict, \ref XBT_heap, \ref XBT_set and \ref XBT_swag. diff --git a/doc/module-xbt.doc b/doc/module-xbt.doc index 3619f7b17e..da1989c45a 100644 --- a/doc/module-xbt.doc +++ b/doc/module-xbt.doc @@ -74,8 +74,11 @@ * \brief A data container consisting in \ref XBT_dict and \ref XBT_dynar */ -/** \addtogroup XBT_fifo - \ingroup XBT_API */ + /** \defgroup XBT_fifo A generic workqueue + * \brief This section describes the API to generic workqueue. These functions + * provide the same kind of functionnality as dynamic arrays but in time O(1). + * However these functions use malloc/free way too much often. + */ /** @defgroup XBT_swag A O(1) set datatype * @brief a O(1) set based on linked lists diff --git a/include/xbt/fifo.h b/include/xbt/fifo.h index 8971ab5b62..a06a7e85e2 100644 --- a/include/xbt/fifo.h +++ b/include/xbt/fifo.h @@ -7,45 +7,57 @@ #ifndef _XBT_FIFO_H #define _XBT_FIFO_H +#include "xbt/misc.h" /* BEGIN_DECL */ + +BEGIN_DECL() + +/** \addtogroup XBT_fifo + * @{ */ + +/** @name 1. Constructor/destructor + * @{ + */ /** \brief Bucket structure - * \ingroup XBT_fifo */ typedef struct xbt_fifo_item *xbt_fifo_item_t; /** \brief FIFO structure - * \ingroup XBT_fifo */ typedef struct xbt_fifo *xbt_fifo_t; -/* API */ xbt_fifo_t xbt_fifo_new(void); void xbt_fifo_free(xbt_fifo_t); +/** @} */ +/** @name 2. Perl-like functions + * @{ + */ xbt_fifo_item_t xbt_fifo_push(xbt_fifo_t, void *); void *xbt_fifo_pop(xbt_fifo_t); xbt_fifo_item_t xbt_fifo_unshift(xbt_fifo_t, void *); void *xbt_fifo_shift(xbt_fifo_t); - -void xbt_fifo_push_item(xbt_fifo_t, xbt_fifo_item_t); -xbt_fifo_item_t xbt_fifo_pop_item(xbt_fifo_t); -void xbt_fifo_unshift_item(xbt_fifo_t, xbt_fifo_item_t); -xbt_fifo_item_t xbt_fifo_shift_item(xbt_fifo_t); - -void xbt_fifo_remove(xbt_fifo_t, void *); -void xbt_fifo_remove_item(xbt_fifo_t, xbt_fifo_item_t); - +int xbt_fifo_size(xbt_fifo_t); int xbt_fifo_is_in(xbt_fifo_t, void *); +/** @} */ -void **xbt_fifo_to_array(xbt_fifo_t); -xbt_fifo_t xbt_fifo_copy(xbt_fifo_t); +/** @name 3. Manipulating directly items + * + * @{ + */ xbt_fifo_item_t xbt_fifo_newitem(void); void xbt_fifo_set_item_content(xbt_fifo_item_t, void *); void *xbt_fifo_get_item_content(xbt_fifo_item_t); void xbt_fifo_freeitem(xbt_fifo_item_t); -int xbt_fifo_size(xbt_fifo_t); +void xbt_fifo_push_item(xbt_fifo_t, xbt_fifo_item_t); +xbt_fifo_item_t xbt_fifo_pop_item(xbt_fifo_t); +void xbt_fifo_unshift_item(xbt_fifo_t, xbt_fifo_item_t); +xbt_fifo_item_t xbt_fifo_shift_item(xbt_fifo_t); + +void xbt_fifo_remove(xbt_fifo_t, void *); +void xbt_fifo_remove_item(xbt_fifo_t, xbt_fifo_item_t); xbt_fifo_item_t xbt_fifo_getFirstItem(xbt_fifo_t l); xbt_fifo_item_t xbt_fifo_getNextItem(xbt_fifo_item_t i); @@ -53,7 +65,6 @@ xbt_fifo_item_t xbt_fifo_getPrevItem(xbt_fifo_item_t i); /** * \brief List iterator - * \ingroup XBT_fifo * asserts and stuff * \param f a list (#xbt_fifo_t) * \param i a bucket (#xbt_fifo_item_t) @@ -67,5 +78,17 @@ xbt_fifo_item_t xbt_fifo_getPrevItem(xbt_fifo_item_t i); ((i)?(n=(type)(xbt_fifo_get_item_content(i))):(NULL)); \ i=xbt_fifo_getNextItem(i)) +/** @} */ + +/** @name 4. Miscanaleous + * + * @{ + */ +void **xbt_fifo_to_array(xbt_fifo_t); +xbt_fifo_t xbt_fifo_copy(xbt_fifo_t); +/** @} */ + +END_DECL() +/** @} */ #endif /* _XBT_FIFO_H */ diff --git a/src/xbt/fifo.c b/src/xbt/fifo.c index ed8b30e599..80922f1a77 100644 --- a/src/xbt/fifo.c +++ b/src/xbt/fifo.c @@ -10,17 +10,6 @@ /*XBT_LOG_NEW_DEFAULT_SUBCATEGORY(fifo,xbt,"FIFO"); UNUSED SO FAR */ -/** \defgroup XBT_fifo A generic workqueue - * \brief This section describes the API to generic workqueue. These functions - * provide the same kind of functionnality as dynamic arrays but in time O(1). - * However these functions use malloc/free a way too much often. - */ - -/** \name Functions - * \ingroup XBT_fifo - */ -/* @{ */ - /** Constructor * \return a new fifo */ -- 2.20.1