Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
updating the doc
authoralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sat, 29 Jan 2005 05:49:28 +0000 (05:49 +0000)
committeralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sat, 29 Jan 2005 05:49:28 +0000 (05:49 +0000)
+ a minor feature fix in MSG and SURF

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@816 48e7efb5-ca39-0410-a469-dd3cf9ba447f

39 files changed:
include/gras/cond.h
include/gras/core.h
include/gras/datadesc.h
include/gras/messages.h
include/gras/process.h
include/gras/virtu.h
include/msg/datatypes.h
include/msg/msg.h
include/xbt/config.h
include/xbt/context.h
include/xbt/dict.h
include/xbt/dynar.h
include/xbt/error.h
include/xbt/fifo.h
include/xbt/heap.h
include/xbt/log.h
include/xbt/misc.h
include/xbt/set.h
include/xbt/swag.h
include/xbt/sysdep.h
src/modules.doc
src/msg/deployment.c
src/msg/environment.c
src/msg/global.c
src/msg/gos.c
src/msg/host.c
src/msg/m_process.c
src/surf/cpu.c
src/surf/workstation_KCCFLN05.c
src/xbt/config.c
src/xbt/context.c
src/xbt/dict.c
src/xbt/dynar.c
src/xbt/error.c
src/xbt/fifo.c
src/xbt/heap.c
src/xbt/log.c
src/xbt/set.c
src/xbt/swag.c

index d435fc1..2aa07db 100644 (file)
@@ -13,7 +13,7 @@
 
 #include "xbt/misc.h" /* BEGIN_DECL */
 
-BEGIN_DECL
+BEGIN_DECL()
 
 /**
  * gras_if_RL:
@@ -29,7 +29,7 @@ int gras_if_RL(void);
  */
 int gras_if_SG(void);
 
-END_DECL
+END_DECL()
 
 #endif /* GRAS_COND_H */
 
index fc73b73..6b0b225 100644 (file)
 #include <stddef.h>    /* offsetof() */
 #include <sys/types.h>  /* size_t */
 #include <stdarg.h>
-
-
-/*! C++ users need love */
-#ifndef BEGIN_DECL
-# ifdef __cplusplus
-#  define BEGIN_DECL extern "C" {
-# else
-#  define BEGIN_DECL 
-# endif
-#endif
-
-/*! C++ users need love */
-#ifndef END_DECL
-# ifdef __cplusplus
-#  define END_DECL }
-# else
-#  define END_DECL 
-# endif
-#endif
-/* End of cruft for C++ */
-
-BEGIN_DECL
+#include "xbt/misc.h"
+
+
+/* /\*! C++ users need love *\/ */
+/* #ifndef BEGIN_DECL */
+/* # ifdef __cplusplus */
+/* #  define BEGIN_DECL() extern "C" { */
+/* # else */
+/* #  define BEGIN_DECL()  */
+/* # endif */
+/* #endif */
+
+/* /\*! C++ users need love *\/ */
+/* #ifndef END_DECL */
+/* # ifdef __cplusplus */
+/* #  define END_DECL() } */
+/* # else */
+/* #  define END_DECL()  */
+/* # endif */
+/* #endif */
+/* /\* End of cruft for C++ *\/ */
+
+BEGIN_DECL()
 
 /* **************************************************************************
  * Garbage collection support
@@ -59,7 +60,7 @@ gras_get_my_fqdn(void);
 void gras_init(int *argc,char **argv, const char *defaultlog);
 void gras_exit(void);
 
-END_DECL
+END_DECL()
 
 #endif /* GRAS_CORE_H */
 
index 51c4c20..3550548 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "xbt/misc.h" /* BEGIN_DECL */
 
-BEGIN_DECL
+BEGIN_DECL()
 
 /**
  * gras_datadesc_type_t:
@@ -220,6 +220,6 @@ gras_datadesc_import_nws(const char           *name,
                         unsigned long         howmany,
               /* OUT */ gras_datadesc_type_t *dst);
 
-END_DECL
+END_DECL()
 
 #endif /* GRAS_DATADESC_H */
index 5cfc2b4..9a17eae 100644 (file)
@@ -15,7 +15,7 @@
 #include "gras/transport.h"
 #include "gras/datadesc.h"
 
-BEGIN_DECL
+BEGIN_DECL()
 
 /* msgtype declaration and retrival */
 typedef struct s_gras_msgtype *gras_msgtype_t;
@@ -58,7 +58,7 @@ xbt_error_t gras_msg_wait(double          timeout,
 xbt_error_t gras_msg_handle(double timeOut);
 
 
-END_DECL
+END_DECL()
 
 #endif /* GRAS_MSG_H */
 
index 130960f..d318c9a 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "xbt/misc.h" /* BEGIN_DECL */
 
-BEGIN_DECL
+BEGIN_DECL()
 
 /* **************************************************************************
  * Initializing the processes
@@ -56,7 +56,7 @@ void gras_userdata_set(void *ud);
 
 #define gras_userdata_new(type) (gras_userdata_set(xbt_new0(type,1)),gras_userdata_get())
 
-END_DECL
+END_DECL()
 
 #endif /* GRAS_PROCESS_H */
 
index d925db8..3ec1ab9 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "xbt/misc.h" /* BEGIN_DECL */
 
-BEGIN_DECL
+BEGIN_DECL()
 
 /**
  * gras_os_time:
@@ -42,7 +42,7 @@ void gras_os_sleep(unsigned long sec, unsigned long usec);
 const char *
 gras_get_my_fqdn(void);
 
-END_DECL
+END_DECL()
 
 #endif /* GRAS_VIRTU_H */
 
index db4b38a..d1ad6ec 100644 (file)
 
 /********************************* Host **************************************/
 
-typedef struct simdata_host *simdata_host_t;
-typedef struct m_host {
-  char *name;                  /* host name if any */
-  simdata_host_t simdata;      /* simulator data */
-  void *data;                  /* user data */
-} s_m_host_t;
-/** \brief Host datatype  
+/** @name Host datatype  
     \ingroup m_datatypes_management
 
     A <em>location</em> (or <em>host</em>) is any possible place where
@@ -28,18 +22,17 @@ typedef struct m_host {
 
     \see m_host_management
 */
-typedef s_m_host_t *m_host_t;
-
+/*@{*/
+typedef struct simdata_host *simdata_host_t;
+typedef struct m_host {
+  char *name;                  /**< host name if any */
+  simdata_host_t simdata;      /**< simulator data */
+  void *data;                  /**< user data */
+} s_m_host_t, *m_host_t;
+/*@}*/
 /********************************* Task **************************************/
 
-typedef struct simdata_task *simdata_task_t;
-typedef struct m_task {
-  char *name;                  /* host name if any */
-  simdata_task_t simdata;      /* simulator data */
-  void *data;                  /* user data */
-} s_m_task_t;
-
-/** \brief Task datatype  
+/** @name Task datatype  
     \ingroup m_datatypes_management 
 
     A <em>task</em> may then be defined by a <em>computing
@@ -47,43 +40,59 @@ typedef struct m_task {
     data</em>.
     \see m_task_management
 */
-typedef s_m_task_t *m_task_t;
+/*@{*/
+typedef struct simdata_task *simdata_task_t;
+typedef struct m_task {
+  char *name;                  /* host name if any */
+  simdata_task_t simdata;      /* simulator data */
+  void *data;                  /* user data */
+} s_m_task_t, *m_task_t;
 
 /** \brief Default value for an uninitialized #m_task_t.
     \ingroup m_datatypes_management 
 */
 #define MSG_TASK_UNINITIALIZED NULL
 
+/*@}*/
+
 /******************************* Process *************************************/
-typedef struct simdata_process *simdata_process_t;
-typedef struct m_process {
-  char *name;                  /* process name if any */
-  simdata_process_t simdata;   /* simulator data */
-  void *data;                  /* user data */
-} s_m_process_t;
-/** \brief Agent datatype  
+
+/** @name Agent datatype  
     \ingroup m_datatypes_management 
+
     An agent may be defined as a <em>code</em>, with some <em>private
     data</em>, executing in a <em>location</em>.
     \see m_process_management
 */
-typedef s_m_process_t *m_process_t;
-/** \brief Agent code datatype  
-    \ingroup m_datatypes_management 
+/*@{*/
+typedef struct simdata_process *simdata_process_t;
+typedef struct m_process {
+  /** A name */
+  /** process name if any */
+  char *name;                  
+  simdata_process_t simdata;   /* simulator data */
+  void *data;                  /* user data */
+} s_m_process_t, *m_process_t;
+
+/** 
     The code of an agent is a m_process_code_t, i.e. a function with no arguments 
     returning no value.
     \see m_process_management
 */
 typedef int(*m_process_code_t)(int argc,char *argv[]) ;
+/*@}*/
 
 /********************************** Channel **********************************/
-/** \brief Channel datatype  
+/** @name Channel datatype  
     \ingroup m_datatypes_management 
+
     A <em>channel</em>  is a number and identifies a mailbox type (just as a 
     port number does).
     \see m_channel_management
 */
+/*@{*/
 typedef int m_channel_t;
+/*@}*/
 
 /****************************** Error handling *******************************/
 /** \brief Error handling
@@ -106,27 +115,19 @@ typedef enum {
   MSG_VERBOSE
 } MSG_outputmode_t;
 
+/** \deprecated Network sharing mechanism
+    \ingroup m_datatypes_management*/
 typedef enum {
   MSG_STORE_AND_FORWARD = 1, /* 0 means uninitialized value */
   MSG_TCP
 } MSG_sharing_t;
 
-/************************ deprecated *****************************************/
-/* /\********************************* Link **************************************\/ */
-/* struct s_m_link { */
-/*   char *name;                       /\* link name if any *\/ */
-/*   void *simdata;            /\* simulator data *\/ */
-/*   void *data;                       /\* user data *\/ */
-/* }; */
-
-/* /\** \brief Link datatype   */
-/*     \ingroup m_datatypes_management */
-
-/*     A <em>link</em> is an agglomeration of communicating resources */
-/*     representing a set of physical network links. */
-
-/*     \see m_link_management */
-/* *\/ */
-/* typedef struct s_m_link *m_link_t; */
-
+/** \deprecated Link datatype  
+ *  \ingroup m_datatypes_management
+ *    The notion of <em>link</em> was present in the earliest versions of MSG.  
+ *    It was an agglomeration of communicating resources representing a set of
+ *    physical network links. This abstraction a disappeared because in real-life,
+ *    it is generally not possible to interact directly with a link...
+ */
+typedef struct m_link *m_link_t;
 #endif
index 45c2a3b..cff0463 100644 (file)
@@ -46,7 +46,7 @@ m_process_t MSG_process_create(const char *name,
 m_process_t MSG_process_create_with_arguments(const char *name,
                                              m_process_code_t code, void *data,
                                              m_host_t host, int argc, char **argv);
-void MSG_process_free(m_process_t process);
+void MSG_process_kill(m_process_t process);
 MSG_error_t MSG_get_arguments(int *argc, char ***argv);
 MSG_error_t MSG_set_arguments(m_process_t process,int argc, char *argv[]);
 
index c751977..ed294df 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "xbt/dynar.h"
 
-BEGIN_DECL
+BEGIN_DECL()
   
 /* For now, a config is only a special dynar. But don't rely on it, */
 /* it may change in the future. */
@@ -118,6 +118,6 @@ xbt_error_t xbt_cfg_get_dynar (xbt_cfg_t    cfg,
                                 const char   *name,
                       /* OUT */ xbt_dynar_t *dynar);
 
-END_DECL
+END_DECL()
   
 #endif /* _XBT_CONFIG_H_ */
index ea8a6f5..8e7b646 100644 (file)
 
 #include "xbt/misc.h"
 
+/** \name Context types
+ *  \ingroup XBT_context
+*/
+/*@{*/
 typedef struct s_xbt_context *xbt_context_t;
+/**< A context */
 typedef int(*xbt_context_function_t)(int argc, char *argv[]);
+/**< A context function */
+/*@}*/
 
 void xbt_context_init(void);
 void xbt_context_exit(void);
index 19cd9cf..c337b2d 100644 (file)
 #include "xbt/misc.h" /* BEGIN_DECL */
 #include "xbt/error.h"
 
-BEGIN_DECL
+BEGIN_DECL()
 
 /*####[ Type definition ]####################################################*/
+/** \brief Dictionnary data type 
+    \ingroup XBT_dict
+*/
 typedef struct xbt_dict_ *xbt_dict_t;
 
 /*####[ Simple dict  functions ]#############################################*/
@@ -141,6 +144,6 @@ int          xbt_dict_cursor_get_or_free (xbt_dict_cursor_t *cursor,
        xbt_dict_cursor_get_or_free(&(cursor),&(key),(void**)(&data));\
        xbt_dict_cursor_step(cursor) )
 
-END_DECL
+END_DECL()
 
 #endif /* _XBT_DICT_H */
index 64136a4..062e944 100644 (file)
 
 #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;
 
 xbt_dynar_t  xbt_dynar_new(unsigned long elm_size, 
@@ -64,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
  *
- * <programlisting>
- * xbt_dynar_t dyn;
- * int cpt;
- * string *str;
- * xbt_dynar_foreach (dyn,cpt,str) {
- *   printf("Seen %s\n",str);
- * }</programlisting>
+ * 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))      ; \
@@ -93,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 */
index 0af48fa..d35289a 100644 (file)
 #include <execinfo.h>  /* to print the backtrace */
 #endif
 
-BEGIN_DECL
+BEGIN_DECL()
 
 void xbt_abort(void) _XBT_GNUC_NORETURN;
   
+/**\brief Error types
+   \ingroup XBT_error
+*/
 typedef enum {
-  no_error=0,       /* succes */
-  mismatch_error=1, /* The provided ID does not match */
-  system_error=2,   /* a syscall did fail */
-  network_error=3,  /* error while sending/receiving data */
-  timeout_error=4,  /* not quick enough, dude */
-  thread_error=5,   /* error while [un]locking */
-  unknown_error=6,
+  no_error=0,       /**< succes */
+  mismatch_error=1, /**< The provided ID does not match */
+  system_error=2,   /**< a syscall did fail */
+  network_error=3,  /**< error while sending/receiving data */
+  timeout_error=4,  /**< not quick enough, dude */
+  thread_error=5,   /**< error while [un]locking */
+  unknown_error=6,  /**< unknown error */
      
   /* remote errors: result of a RMI/RPC.
      no_error(=0) is the same for both */   
@@ -42,7 +45,7 @@ typedef enum {
   remote_unknown_error
 } xbt_error_t;
 
-/*@observer@*/ const char *xbt_error_name(xbt_error_t errcode);
+const char *xbt_error_name(xbt_error_t errcode);
 
 #define TRY(a) do {                                     \
   if ((errcode=a) != no_error) {                        \
@@ -134,6 +137,12 @@ typedef enum {
 #define RAISE_IMPOSSIBLE RAISE0(unknown_error,"The Impossible did happen")
 #define RAISE_UNIMPLEMENTED RAISE1(unknown_error,"Function %s unimplemented",__FUNCTION__)
 
+/** 
+ * \name Asserts
+ * \ingroup XBT_error
+ * asserts and stuff
+ */
+/*@{*/
 #ifdef NDEBUG
 #define xbt_assert(cond)
 #define xbt_assert0(cond,msg)
@@ -153,13 +162,17 @@ typedef enum {
 #define xbt_assert5(cond,msg,a,b,c,d,e)   if (!(cond)) { CRITICAL5(msg,a,b,c,d,e); xbt_abort(); }
 #define xbt_assert6(cond,msg,a,b,c,d,e,f) if (!(cond)) { CRITICAL6(msg,a,b,c,d,e,f); xbt_abort(); }
 #endif
+/*@}*/
 
+/** 
+ * \brief How to abort with an error message
+ * \ingroup XBT_error
+ */
 void xbt_die(const char *msg) _XBT_GNUC_NORETURN;
 
 #define DIE_IMPOSSIBLE xbt_assert0(0,"The Impossible did happen (yet again)")
 #define xbt_assert_error(a) xbt_assert1(errcode == (a), "Error %s unexpected",xbt_error_name(errcode))
 
-END_DECL
+END_DECL()
 
 #endif /* XBT_ERROR_H */
-
index 381c292..8971ab5 100644 (file)
@@ -8,10 +8,14 @@
 #ifndef _XBT_FIFO_H
 #define _XBT_FIFO_H
 
-/* Bucket structure */
+/** \brief  Bucket structure 
+ *  \ingroup XBT_fifo
+*/
 typedef struct xbt_fifo_item *xbt_fifo_item_t;
 
-/* FIFO structure */
+/** \brief  FIFO structure
+ *  \ingroup XBT_fifo
+*/
 typedef struct xbt_fifo *xbt_fifo_t;
 
 /* API */
@@ -47,7 +51,17 @@ xbt_fifo_item_t xbt_fifo_getFirstItem(xbt_fifo_t l);
 xbt_fifo_item_t xbt_fifo_getNextItem(xbt_fifo_item_t i);
 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)
+ * \param type a type
+ * \param n an object of type \a type.
+ *
+ * Iterates over the whole list. 
+ */
 #define xbt_fifo_foreach(f,i,n,type)                  \
    for(i=xbt_fifo_getFirstItem(f);                    \
      ((i)?(n=(type)(xbt_fifo_get_item_content(i))):(NULL));             \
index 0daea05..2b44138 100644 (file)
@@ -10,6 +10,9 @@
 
 #include "xbt/misc.h"
 
+/** \brief Heap data type 
+    \ingroup XBT_heap
+*/
 typedef struct xbt_heap *xbt_heap_t;
 
 xbt_heap_t xbt_heap_new(int num, void_f_pvoid_t free_func);
index c581441..1bd156f 100644 (file)
 
 #include "xbt/sysdep.h"
 
-/**
- * e_xbt_log_priority_t:
- * @xbt_log_priority_none:          used internally (don't poke with)
- * @xbt_log_priority_debug:         crufty output 
- * @xbt_log_priority_verbose:       verbose output for the user wanting more
- * @xbt_log_priority_info:          output about the regular functionning 
- * @xbt_log_priority_warning:       minor issue encountered 
- * @xbt_log_priority_error:         issue encountered 
- * @xbt_log_priority_critical:      major issue encountered 
- * @xbt_log_priority_infinite:      value for XBT_LOG_STATIC_THRESHOLD to not log
- * @xbt_log_priority_uninitialized: used internally (don't poke with)
+/**\brief Log priorities
+ * \ingroup XBT_log
  *
  * The different existing priorities.
- */
+*/
 typedef enum {
-  xbt_log_priority_none          = 0, 
+  xbt_log_priority_none          = 0,  /**< used internally (don't poke with) */
   xbt_log_priority_trace         = 1, 
-  xbt_log_priority_debug         = 2, 
-  xbt_log_priority_verbose       = 3, 
-  xbt_log_priority_info          = 4, 
-  xbt_log_priority_warning       = 5, 
-  xbt_log_priority_error         = 6, 
-  xbt_log_priority_critical      = 7, 
+  xbt_log_priority_debug         = 2,  /**< crufty output  */
+  xbt_log_priority_verbose       = 3,  /**< verbose output for the user wanting more */
+  xbt_log_priority_info          = 4,  /**< output about the regular functionning */
+  xbt_log_priority_warning       = 5,  /**< minor issue encountered */
+  xbt_log_priority_error         = 6,  /**< issue encountered */
+  xbt_log_priority_critical      = 7,  /**< major issue encountered */
 
-  xbt_log_priority_infinite      = 8, 
+  xbt_log_priority_infinite      = 8,  /**< value for XBT_LOG_STATIC_THRESHOLD to not log */
 
-  xbt_log_priority_uninitialized = -1 
+  xbt_log_priority_uninitialized = -1  /**< used internally (don't poke with) */
 } e_xbt_log_priority_t;
              
 
 /**
- * NLOG:
+ * \define NLOG
  *
- * All logging facilities are disabled at compilation time
+ * \note All logging facilities are disabled at compilation time
  */
 
 
@@ -84,10 +75,10 @@ typedef enum {
 #define XBT_LOG_ROOT_CAT   root
 
 /**
- * XBT_LOG_NEW_SUBCATEGORY:
- * @catName: name of new category
- * @parent: father of the new category in the tree
- * @desc: string describing the purpose of this category
+ * \ingroup XBT_log
+ * \param catName name of new category
+ * \param parent father of the new category in the tree
+ * \param desc string describing the purpose of this category
  *
  * Defines a new subcategory of the parent. 
  */
@@ -100,17 +91,17 @@ typedef enum {
     }
 
 /**
- * XBT_LOG_NEW_CATEGORY:
- * @catName: name of new category
- * @desc: string describing the purpose of this category
+ * \ingroup XBT_log  
+ * \param catName name of new category
+ * \param desc string describing the purpose of this category
  *
  * Creates a new subcategory of the root category.
  */
 #define XBT_LOG_NEW_CATEGORY(catName,desc)  XBT_LOG_NEW_SUBCATEGORY(catName, XBT_LOG_ROOT_CAT, desc)
 
 /**
- * XBT_LOG_DEFAULT_CATEGORY:
- * @cname: name of the cat
+ * \ingroup XBT_log  
+ * \param cname name of the cat
  *
  * Indicates which category is the default one.
  */
@@ -123,9 +114,9 @@ typedef enum {
 #endif
 
 /**
- * XBT_LOG_NEW_DEFAULT_CATEGORY:
- * @cname: name of the cat
- * @desc: string describing the purpose of this category
+ * \ingroup XBT_log  
+ * \param cname name of the cat
+ * \param desc string describing the purpose of this category
  *
  * Creates a new subcategory of the root category and makes it the default
  * (used by macros that don't explicitly specify a category).
@@ -135,10 +126,10 @@ typedef enum {
     XBT_LOG_DEFAULT_CATEGORY(cname)
 
 /**
- * XBT_LOG_NEW_DEFAULT_SUBCATEGORY:
- * @cname: name of the cat
- * @parent: name of the parent
- * @desc: string describing the purpose of this category
+ * \ingroup XBT_log  
+ * \param cname name of the cat
+ * \param parent name of the parent
+ * \param desc string describing the purpose of this category
  *
  * Creates a new subcategory of the parent category and makes it the default
  * (used by macros that don't explicitly specify a category).
@@ -148,8 +139,8 @@ typedef enum {
     XBT_LOG_DEFAULT_CATEGORY(cname)
 
 /**
- * XBT_LOG_EXTERNAL_CATEGORY:
- * @cname: name of the cat
+ * \ingroup XBT_log  
+ * \param cname name of the cat
  *
  * Indicates that a category you'll use in this file (to get subcategories of it, 
  * for example) really lives in another file.
@@ -198,9 +189,9 @@ struct xbt_log_event_s {
 };
 
 /**
- * xbt_log_threshold_set:
- * @cat: the category (not only its name, but the variable)
- * @thresholdPriority: the priority
+ * \ingroup XBT_log  
+ * \param cat the category (not only its name, but the variable)
+ * \param thresholdPriority the priority
  *
  * Programatically alters a category's threshold priority (don't use).
  */
@@ -208,9 +199,9 @@ extern void xbt_log_threshold_set(xbt_log_category_t cat,
                                   e_xbt_log_priority_t thresholdPriority);
 
 /**
- * xbt_log_parent_set:
- * @cat: the category (not only its name, but the variable)
- * @parent: the parent cat
+ * \ingroup XBT_log  
+ * \param cat the category (not only its name, but the variable)
+ * \param parent the parent cat
  *
  * Programatically alter a category's parent (don't use).
  */
@@ -218,9 +209,9 @@ extern void xbt_log_parent_set(xbt_log_category_t cat,
                                xbt_log_category_t parent);
 
 /**
- * xbt_log_appender_set:
- * @cat: the category (not only its name, but the variable)
- * @app: the appender
+ * \ingroup XBT_log  
+ * \param cat the category (not only its name, but the variable)
+ * \param app the appender
  *
  * Programatically sets the category's appender (don't use).
  */
@@ -241,9 +232,9 @@ XBT_LOG_EXTERNAL_CATEGORY(GRAS);
 extern xbt_log_appender_t xbt_log_default_appender;
 
 /**
- * XBT_LOG_ISENABLED:
- * @catName: name of the category
- * @priority: minimal priority to be enabled to return true
+ * \ingroup XBT_log 
+ * \param catName name of the category
+ * \param priority minimal priority to be enabled to return true
  *
  * Returns true if the given priority is enabled for the category.
  * If you have expensive expressions that are computed outside of the log
@@ -356,24 +347,6 @@ extern xbt_log_appender_t xbt_log_default_appender;
 #define CERROR5(c, f,a1,a2,a3,a4,a5)    CLOG5(c, xbt_log_priority_error, f,a1,a2,a3,a4,a5)
 #define CERROR6(c, f,a1,a2,a3,a4,a5,a6) CLOG6(c, xbt_log_priority_error, f,a1,a2,a3,a4,a5,a6)
 
-/**
- * CCRITICAL6:
- * @c: the category to log into
- * @f: the format string
- * @a1: first argument of the format
- * @a2: second argument of the format
- * @a3: third argument of the format
- * @a4: fourth argument of the format
- * @a5: fifth argument of the format
- * @a6: sixth argument of the format
- *
- * Log something to the current default category under the warning priority.
- *
- * The macros CCRITICAL0 ... CCRITICAL5 naturally also exist, but are not listed here 
- * for sake of clarity. They just differ in the number of arguments passed
- * along with the format string.
- */
-
 #define CCRITICAL0(c, f)                   CLOG0(c, xbt_log_priority_critical, f)
 #define CCRITICAL1(c, f,a1)                CLOG1(c, xbt_log_priority_critical, f,a1)
 #define CCRITICAL2(c, f,a1,a2)             CLOG2(c, xbt_log_priority_critical, f,a1,a2)
@@ -404,23 +377,22 @@ extern xbt_log_appender_t xbt_log_default_appender;
 # define LOG8(p, f,a1,a2,a3,a4,a5,a6,a7,a8) _XBT_LOG_PRE((*_XBT_LOGV(default)),p) ,f,a1,a2,a3,a4,a5,a6,a7,a8 _XBT_LOG_POST
 #endif
 
-/**
- * DEBUG6:
- * @f: the format string
- * @a1: first argument of the format
- * @a2: second argument of the format
- * @a3: third argument of the format
- * @a4: fourth argument of the format
- * @a5: fifth argument of the format
- * @a6: sixth argument of the format
- *
+/** \name DEBUG
+ * \ingroup XBT_log
  * Log something to the current default category under the debug priority.
+ * \param f the format string
+ * \param a1 first argument of the format
+ * \param a2 second argument of the format
+ * \param a3 third argument of the format
+ * \param a4 fourth argument of the format
+ * \param a5 fifth argument of the format
+ * \param a6 sixth argument of the format
  *
  * The macros DEBUG0 ... DEBUG5 naturally also exist, but are not listed here 
  * for sake of clarity. They just differ in the number of arguments passed
  * along with the format string.
  */
-
+/*@{*/
 #define DEBUG0(f)                   LOG0(xbt_log_priority_debug, f)
 #define DEBUG1(f,a1)                LOG1(xbt_log_priority_debug, f,a1)
 #define DEBUG2(f,a1,a2)             LOG2(xbt_log_priority_debug, f,a1,a2)
@@ -430,24 +402,24 @@ extern xbt_log_appender_t xbt_log_default_appender;
 #define DEBUG6(f,a1,a2,a3,a4,a5,a6) LOG6(xbt_log_priority_debug, f,a1,a2,a3,a4,a5,a6)
 #define DEBUG7(f,a1,a2,a3,a4,a5,a6,a7) LOG7(xbt_log_priority_debug, f,a1,a2,a3,a4,a5,a6,a7)
 #define DEBUG8(f,a1,a2,a3,a4,a5,a6,a7,a8) LOG8(xbt_log_priority_debug, f,a1,a2,a3,a4,a5,a6,a7,a8)
+/*@}*/
 
-/**
- * VERB6:
- * @f: the format string
- * @a1: first argument of the format
- * @a2: second argument of the format
- * @a3: third argument of the format
- * @a4: fourth argument of the format
- * @a5: fifth argument of the format
- * @a6: sixth argument of the format
- *
+/** \name VERB
+ * \ingroup XBT_log
  * Log something to the current default category under the verbose priority.
+ * \param f the format string
+ * \param a1 first argument of the format
+ * \param a2 second argument of the format
+ * \param a3 third argument of the format
+ * \param a4 fourth argument of the format
+ * \param a5 fifth argument of the format
+ * \param a6 sixth argument of the format
  *
  * The macros VERB0 ... VERB5 naturally also exist, but are not listed here 
  * for sake of clarity. They just differ in the number of arguments passed
  * along with the format string.
  */
-
+/*@{*/
 #define VERB0(f)                   LOG0(xbt_log_priority_verbose, f)
 #define VERB1(f,a1)                LOG1(xbt_log_priority_verbose, f,a1)
 #define VERB2(f,a1,a2)             LOG2(xbt_log_priority_verbose, f,a1,a2)
@@ -455,24 +427,24 @@ extern xbt_log_appender_t xbt_log_default_appender;
 #define VERB4(f,a1,a2,a3,a4)       LOG4(xbt_log_priority_verbose, f,a1,a2,a3,a4)
 #define VERB5(f,a1,a2,a3,a4,a5)    LOG5(xbt_log_priority_verbose, f,a1,a2,a3,a4,a5)
 #define VERB6(f,a1,a2,a3,a4,a5,a6) LOG6(xbt_log_priority_verbose, f,a1,a2,a3,a4,a5,a6)
+/*@}*/
 
-/**
- * INFO6:
- * @f: the format string
- * @a1: first argument of the format
- * @a2: second argument of the format
- * @a3: third argument of the format
- * @a4: fourth argument of the format
- * @a5: fifth argument of the format
- * @a6: sixth argument of the format
- *
+/** \name INFO
+ * \ingroup XBT_log
  * Log something to the current default category under the info priority.
+ * \param f the format string
+ * \param a1 first argument of the format
+ * \param a2 second argument of the format
+ * \param a3 third argument of the format
+ * \param a4 fourth argument of the format
+ * \param a5 fifth argument of the format
+ * \param a6 sixth argument of the format
  *
  * The macros INFO0 ... INFO5 naturally also exist, but are not listed here 
  * for sake of clarity. They just differ in the number of arguments passed
  * along with the format string.
  */
-
+/*@{*/
 #define INFO0(f)                   LOG0(xbt_log_priority_info, f)
 #define INFO1(f,a1)                LOG1(xbt_log_priority_info, f,a1)
 #define INFO2(f,a1,a2)             LOG2(xbt_log_priority_info, f,a1,a2)
@@ -480,24 +452,24 @@ extern xbt_log_appender_t xbt_log_default_appender;
 #define INFO4(f,a1,a2,a3,a4)       LOG4(xbt_log_priority_info, f,a1,a2,a3,a4)
 #define INFO5(f,a1,a2,a3,a4,a5)    LOG5(xbt_log_priority_info, f,a1,a2,a3,a4,a5)
 #define INFO6(f,a1,a2,a3,a4,a5,a6) LOG6(xbt_log_priority_info, f,a1,a2,a3,a4,a5,a6)
+/*@}*/
 
-/**
- * WARN6:
- * @f: the format string
- * @a1: first argument of the format
- * @a2: second argument of the format
- * @a3: third argument of the format
- * @a4: fourth argument of the format
- * @a5: fifth argument of the format
- * @a6: sixth argument of the format
- *
+/** \name WARN
+ * \ingroup XBT_log
  * Log something to the current default category under the warning priority.
+ * \param f the format string
+ * \param a1 first argument of the format
+ * \param a2 second argument of the format
+ * \param a3 third argument of the format
+ * \param a4 fourth argument of the format
+ * \param a5 fifth argument of the format
+ * \param a6 sixth argument of the format
  *
  * The macros WARN0 ... WARN5 naturally also exist, but are not listed here 
  * for sake of clarity. They just differ in the number of arguments passed
  * along with the format string.
  */
-
+/*@{*/
 #define WARN0(f)                   LOG0(xbt_log_priority_warning, f)
 #define WARN1(f,a1)                LOG1(xbt_log_priority_warning, f,a1)
 #define WARN2(f,a1,a2)             LOG2(xbt_log_priority_warning, f,a1,a2)
@@ -505,24 +477,24 @@ extern xbt_log_appender_t xbt_log_default_appender;
 #define WARN4(f,a1,a2,a3,a4)       LOG4(xbt_log_priority_warning, f,a1,a2,a3,a4)
 #define WARN5(f,a1,a2,a3,a4,a5)    LOG5(xbt_log_priority_warning, f,a1,a2,a3,a4,a5)
 #define WARN6(f,a1,a2,a3,a4,a5,a6) LOG6(xbt_log_priority_warning, f,a1,a2,a3,a4,a5,a6)
+/*@}*/
 
-/**
- * ERROR6:
- * @f: the format string
- * @a1: first argument of the format
- * @a2: second argument of the format
- * @a3: third argument of the format
- * @a4: fourth argument of the format
- * @a5: fifth argument of the format
- * @a6: sixth argument of the format
- *
+/** \name ERROR
+ * \ingroup XBT_log
  * Log something to the current default category under the error priority.
+ * \param f the format string
+ * \param a1 first argument of the format
+ * \param a2 second argument of the format
+ * \param a3 third argument of the format
+ * \param a4 fourth argument of the format
+ * \param a5 fifth argument of the format
+ * \param a6 sixth argument of the format
  *
  * The macros ERROR0 ... ERROR5 naturally also exist, but are not listed here 
  * for sake of clarity. They just differ in the number of arguments passed
  * along with the format string.
  */
-
+/*@{*/
 #define ERROR0(f)                   LOG0(xbt_log_priority_error, f)
 #define ERROR1(f,a1)                LOG1(xbt_log_priority_error, f,a1)
 #define ERROR2(f,a1,a2)             LOG2(xbt_log_priority_error, f,a1,a2)
@@ -530,23 +502,24 @@ extern xbt_log_appender_t xbt_log_default_appender;
 #define ERROR4(f,a1,a2,a3,a4)       LOG4(xbt_log_priority_error, f,a1,a2,a3,a4)
 #define ERROR5(f,a1,a2,a3,a4,a5)    LOG5(xbt_log_priority_error, f,a1,a2,a3,a4,a5)
 #define ERROR6(f,a1,a2,a3,a4,a5,a6) LOG6(xbt_log_priority_error, f,a1,a2,a3,a4,a5,a6)
+/*@}*/
 
-/**
- * CRITICAL6:
- * @f: the format string
- * @a1: first argument of the format
- * @a2: second argument of the format
- * @a3: third argument of the format
- * @a4: fourth argument of the format
- * @a5: fifth argument of the format
- * @a6: sixth argument of the format
- *
+/** \name CRITICAL
+ * \ingroup XBT_log
  * Log something to the current default category under the critical priority.
+ * \param f the format string
+ * \param a1 first argument of the format
+ * \param a2 second argument of the format
+ * \param a3 third argument of the format
+ * \param a4 fourth argument of the format
+ * \param a5 fifth argument of the format
+ * \param a6 sixth argument of the format
  *
  * The macros CRITICAL0 ... CRITICAL5 naturally also exist, but are not listed here 
  * for sake of clarity. They just differ in the number of arguments passed
  * along with the format string.
  */
+/*@{*/
 #define CRITICAL0(f)                   LOG0(xbt_log_priority_critical, f)
 #define CRITICAL1(f,a1)                LOG1(xbt_log_priority_critical, f,a1)
 #define CRITICAL2(f,a1,a2)             LOG2(xbt_log_priority_critical, f,a1,a2)
@@ -554,6 +527,7 @@ extern xbt_log_appender_t xbt_log_default_appender;
 #define CRITICAL4(f,a1,a2,a3,a4)       LOG4(xbt_log_priority_critical, f,a1,a2,a3,a4)
 #define CRITICAL5(f,a1,a2,a3,a4,a5)    LOG5(xbt_log_priority_critical, f,a1,a2,a3,a4,a5)
 #define CRITICAL6(f,a1,a2,a3,a4,a5,a6) LOG6(xbt_log_priority_critical, f,a1,a2,a3,a4,a5,a6)
+/*@}*/
 
 #define XBT_IN               LOG1(xbt_log_priority_trace, ">> begin of %s",     _XBT_GNUC_FUNCTION)
 #define XBT_IN1(fmt,a)       LOG2(xbt_log_priority_trace, ">> begin of %s" fmt, _XBT_GNUC_FUNCTION, a)
index 33f15d0..1808b4d 100644 (file)
 /*! C++ users need love */
 #ifndef BEGIN_DECL
 # ifdef __cplusplus
-#  define BEGIN_DECL extern "C" {
+#  define BEGIN_DECL() extern "C" {
 # else
-#  define BEGIN_DECL 
+#  define BEGIN_DECL() 
 # endif
 #endif
 
 /*! C++ users need love */
 #ifndef END_DECL
 # ifdef __cplusplus
-#  define END_DECL }
+#  define END_DECL() }
 # else
-#  define END_DECL 
+#  define END_DECL() 
 # endif
 #endif
 /* End of cruft for C++ */
 
-BEGIN_DECL
+BEGIN_DECL()
 /* Dunno where to place this: needed by config and amok */
 typedef struct {  
    char *name;
    int port;
 } xbt_host_t;
 
-/* pointer to a function freeing something */
-typedef   void (void_f_ppvoid_t)(void**);
-typedef   void (void_f_pvoid_t) (void*);
+/** \name Free functions
+ *  \ingroup XBT_dynar
+ * Pointer to a function freeing something
+*/
+/*@{*/
+typedef   void (void_f_ppvoid_t)(void**); /**< Pointer to a function freeing something */
+typedef   void (void_f_pvoid_t) (void*);  /**< Pointer to a function freeing something */
+/*@}*/
 
-END_DECL
+END_DECL()
 
 #endif /* XBT_MISC_H */
index 69a2a1f..7ee9285 100644 (file)
 
 #include "xbt/misc.h" /* BEGIN_DECL */
 
-BEGIN_DECL
+BEGIN_DECL()
 
 /*####[ Type definition ]####################################################*/
-typedef struct xbt_set_ *xbt_set_t;
+/** \name Set and set elements
+    \ingroup XBT_set
+    generic dictionary
+*/
+/*@{*/
+typedef struct xbt_set_ *xbt_set_t; /**< Set */
 typedef struct xbt_set_elm_ {
   unsigned int ID;
   char        *name;
   unsigned int name_len;
-} s_xbt_set_elm_t,*xbt_set_elm_t;
+} s_xbt_set_elm_t,*xbt_set_elm_t;   /**< Set element */
 
 /*####[ Functions ]##########################################################*/
 
@@ -50,7 +55,8 @@ xbt_error_t xbt_set_get_by_id      (xbt_set_t      set,
 /* To traverse (simple) caches                                               */
 /* Don't add or remove entries to the cache while traversing !!!             */
 /*###########################################################################*/
-typedef struct xbt_set_cursor_ *xbt_set_cursor_t;
+typedef struct xbt_set_cursor_ *xbt_set_cursor_t;  /**< Set cursor */
+/*@}*/
 
 void         xbt_set_cursor_first       (xbt_set_t         set,
                                          xbt_set_cursor_t *cursor);
@@ -58,11 +64,20 @@ void         xbt_set_cursor_step        (xbt_set_cursor_t  cursor);
 int          xbt_set_cursor_get_or_free (xbt_set_cursor_t *cursor,
                                          xbt_set_elm_t    *elm);
 
+/**
+ \brief Set iterator
+ \ingroup XBT_set
+ * \param set what to iterate over
+ * \param cursor a #xbt_set_cursor_t used as cursor
+ * \param elm  a #xbt_set_elm_t
+ *
+ * Iterates over the whole set. 
+ */
 #define xbt_set_foreach(set,cursor,elm)                       \
   for ((cursor) = NULL, xbt_set_cursor_first((set),&(cursor)) ;   \
        xbt_set_cursor_get_or_free(&(cursor),(xbt_set_elm_t*)&(elm));          \
        xbt_set_cursor_step(cursor) )
 
-END_DECL
+END_DECL()
 
 #endif /* _XBT_SET_H */
index 21d40fd..4c8a42d 100644 (file)
 /* This type should be added to a type that is to be used in such a swag */
 /* Whenever a new object with this struct is created, all fields have
    to be set to NULL */
+
+/** \name Swag types
+    \ingroup XBT_swag
+
+    Specific set. 
+
+    These typedefs are public so that the compiler can
+    do his job but believe me, you don't want to try to play with 
+    those structs directly. Use them as an abstract datatype.
+*/
+/*@{*/
 typedef struct xbt_swag_hookup {
   void *next;
   void *prev;
-} s_xbt_swag_hookup_t, *xbt_swag_hookup_t;
+} s_xbt_swag_hookup_t; 
+/**< This type should be added to a type that is to be used in a swag. 
+ * For example like that :
+
+\code
+typedef struct foo {
+  s_xbt_swag_hookup_t set1_hookup;
+  s_xbt_swag_hookup_t set2_hookup;
+
+  double value;
+} s_foo_t, *foo_t;
+...
+{
+  s_foo_t elem;
+  xbt_swag_t set1=NULL;
+  xbt_swag_t set2=NULL;
+
+  set1 = xbt_swag_new(xbt_swag_offset(elem, set1_hookup));
+  set2 = xbt_swag_new(xbt_swag_offset(elem, set2_hookup));
+
+}
+\endcode
+*/
+typedef s_xbt_swag_hookup_t  *xbt_swag_hookup_t;
+
 
 typedef struct xbt_swag {
   void *head;
@@ -28,6 +63,8 @@ typedef struct xbt_swag {
   size_t offset;
   int count;
 } s_xbt_swag_t, *xbt_swag_t;
+/**< A typical swag */
+/*@}*/
 
 xbt_swag_t xbt_swag_new(size_t offset);
 void xbt_swag_free(xbt_swag_t swag);
@@ -48,13 +85,35 @@ static __inline__ void *xbt_swag_getFirst(xbt_swag_t swag)
 #define xbt_swag_getNext(obj,offset) (((xbt_swag_hookup_t)(((char *) (obj)) + (offset)))->prev)
 #define xbt_swag_getPrev(obj,offset) (((xbt_swag_hookup_t)(((char *) (obj)) + (offset)))->next)
 
+/** 
+ * \ingroup XBT_swag
+ * \brief Offset computation
+ * \arg var a variable of type <tt>struct</tt> something
+ * \arg field a field of <tt>struct</tt> something
+ * \return the offset of \a field in <tt>struct</tt> something.
+ *
+ * It is very similar to offsetof except that is done at runtime and that 
+ * you have to declare a variable. Why defining such a macro then ? 
+ * Because it is portable...
+ */
 #define xbt_swag_offset(var,field) ((char *)&( (var).field ) - (char *)&(var))
 
+/**
+ \name Swag iterator
+ \ingroup XBT_swag
+ *
+ * Iterates over the whole swag. 
+ */
+/*@{*/
 #define xbt_swag_foreach(obj,swag)                            \
    for((obj)=xbt_swag_getFirst((swag));                       \
        (obj)!=NULL;                                           \
        (obj)=xbt_swag_getNext((obj),(swag)->offset))
+/**<  A simple swag iterator 
+ * \param obj the indice of the loop
+ * \param swag what to iterate over
 
+    \warning you cannot modify the \a swag while using this loop  */
 #define xbt_swag_foreach_safe(obj,obj_next,swag)                  \
    for((obj)=xbt_swag_getFirst((swag)),                           \
        ((obj)?(obj_next=xbt_swag_getNext((obj),(swag)->offset)):  \
@@ -63,5 +122,14 @@ static __inline__ void *xbt_swag_getFirst(xbt_swag_t swag)
        (obj)=obj_next,                                            \
        ((obj)?(obj_next=xbt_swag_getNext((obj),(swag)->offset)):  \
                  (obj_next=NULL))     )
+/**< A safe swag iterator 
+ * \param obj the indice of the loop
+ * \param obj_next the object that is right after (if any) \a obj in the swag
+ * \param swag what to iterate over
+
+    You can safely modify the \a swag while using this loop. 
+    Well, safely... Err. You can remove \a obj without having any 
+    trouble at least.  */
+/*@}*/
 
 #endif    /* _XBT_SWAG_H */
index 333d722..a96b1b2 100644 (file)
@@ -16,7 +16,7 @@
 #include <stdlib.h> 
    
 #include "xbt/misc.h"
-BEGIN_DECL
+BEGIN_DECL()
 #if 0
 #define __CALLOC_OP(n, s)  calloc((n), (s))
   #define __REALLOC_OP(n, s)  realloc((n), (s))
@@ -69,7 +69,7 @@ BEGIN_DECL
 # define _XBT_INLINE 
 #endif
 
-END_DECL
+END_DECL()
    
 #include "xbt/error.h" /* needed for xbt_die */
 
index 0f2bbae..fafe886 100644 (file)
@@ -6,7 +6,7 @@
     /** \defgroup XBT_context User-level context library
      *  \ingroup XBT_API
      *  \brief This section describes how to use high-level functions 
-     *  (as opposed to <c>setjump/longjmp</c>) to schedule non-preemptible 
+     *  (as opposed to <tt>setjump/longjmp</tt>) to schedule non-preemptible 
      *  threads.
      */
     /** \defgroup XBT_dict A generic dictionnary
      *   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.
      */
+    /** \defgroup XBT_set A generic set datatype
+     *  \ingroup XBT_API
+     *  \brief A data container consisting in \ref XBT_dict and \ref XBT_dynar
+     */
     /** \defgroup XBT_swag A specific set datatype
      *  \ingroup XBT_API
      *  \brief Warning, this module is done to be efficient and performs tons of
 
 /** \defgroup SURF_API       API of SURF
  *  \ingroup SimGrid_API
+ *  \brief (Not documented yet).
+ *
+ * SURF provides the core functionnalities to simulate a virtual
+ * platform. It is very low-level and is not intended to be used as
+ * such but rather to serve as a basis for higher-level simulators.
+ * We're still working on it and the structure is a little bit complex. 
+ * So we'll document it only when we'll be completely satisfied of 
+ * the way it is organized.
+ *
+ * It is where platform models are encoded. If you need a model that is not 
+ * encoded yet, please tell me (<arnaud.legrand@imag.fr>) and we'll see if
+ * it is feasible or not (hopefully it should be but who knows).
  */
 
-
 /** \defgroup MSG_API      API of MSG 
  *  \ingroup SimGrid_API
  */
index c160d98..dc8e961 100644 (file)
@@ -12,9 +12,6 @@
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(deployment, msg,
                                "Logging specific to MSG (environment)");
 
-extern char *yytext;
-
-
 static int parse_argc = -1 ;
 static char **parse_argv = NULL;
 static m_process_code_t parse_code = NULL;
@@ -64,10 +61,10 @@ void MSG_launch_application(const char *file)
 }
 
 /** \ingroup msg_easier_life
- * \brief Registers a ::m_process_code_t code in a global table.
+ * \brief Registers a #m_process_code_t code in a global table.
  *
  * Registers a code function in a global table. 
- * This table is then used by ::MSG_launch_application. 
+ * This table is then used by #MSG_launch_application. 
  * \param name the reference name of the function.
  * \param code the function
  */
@@ -79,10 +76,10 @@ void MSG_function_register(const char *name,m_process_code_t code)
 }
 
 /** \ingroup msg_easier_life
- * \brief Registers a ::m_process_t code in a global table.
+ * \brief Registers a #m_process_t code in a global table.
  *
  * Registers a code function in a global table. 
- * This table is then used by ::MSG_launch_application. 
+ * This table is then used by #MSG_launch_application. 
  * \param name the reference name of the function.
  */
 m_process_code_t MSG_get_registered_function(const char *name)
@@ -98,10 +95,10 @@ m_process_code_t MSG_get_registered_function(const char *name)
 
 /** \ingroup msg_easier_life
  * \brief Get the arguments of the current process.
- * \deprecated{Not useful since m_process_code_t is int (*)(int argc, char *argv[])}
+ * \deprecated{Not useful since #m_process_code_t is int (*)(int argc, char *argv[])}
  *
  * This functions returns the values set for the current process 
- * using ::MSG_set_arguments or ::MSG_launch_application.
+ * using #MSG_set_arguments or #MSG_launch_application.
  * \param argc the number of arguments
  * \param argv the arguments table
  */
index a706f34..e3eb278 100644 (file)
@@ -39,25 +39,16 @@ m_host_t MSG_get_host_by_name(const char *name)
  *
  * Creates a new platform, including hosts, links and the
  * routing_table. 
- * \param file a filename of a description of a platform. This file is a simple text 
- * file in which you can use C-style comments and C-style strings.
- * Here is a simple description of the format:
- \verbatim
-<CPU>
-host_name "power in MFlops" "availability" "availability file" ON/OFF "failure file"
-host_name "power in MFlops" "availability" "availability file" ON/OFF "failure file"
-...
-</LINKS>
-link_name "bandwidth in Mbytes" "bandwidth file" "latency in ms" "latency file"
-link_name "bandwidth in Mbytes" "bandwidth file" "latency in ms" "latency file"
-...
-ROUTES
-src_name dst_name (link_name link_name link_name ... )
-src_name dst_name (link_name link_name link_name ... )
-...
-\endverbatim
- * Have a look in the directory examples/msg/ to have a better idea of what
- * it looks like.
+ * \param file a filename of a xml description of a platform. This file 
+ * follows this DTD :
+ *
+ *     \include surfxml.dtd
+ *
+ * Here is a small example of such a platform 
+ *
+ *     \include small_platform.xml
+ *
+ * Have a look in the directory examples/msg/ to have a big example.
  */
 void MSG_create_environment(const char *file) {
   xbt_dict_cursor_t cursor = NULL;
index 1889843..c29633b 100644 (file)
@@ -303,7 +303,7 @@ MSG_error_t MSG_clean(void)
 
 
   while((p=xbt_fifo_shift(msg_global->process_list))) {
-    MSG_process_free(p);
+    MSG_process_kill(p);
   }
   xbt_context_exit();
 
index 7cfb055..9041afd 100644 (file)
@@ -14,7 +14,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(gos, msg,
 /** \ingroup msg_gos_functions
  * \brief This function is now deprecated and useless. Please stop using it.
  */
-
 MSG_error_t MSG_process_start(m_process_t process)
 {
   xbt_assert0(0,"This function is now deprecated and useless. Please stop using it.");
@@ -220,6 +219,12 @@ MSG_error_t MSG_task_put(m_task_t task,
   else MSG_RETURN(MSG_TRANSFER_FAILURE);
 }
 
+/** \ingroup msg_gos_functions
+ * \brief Does exactly the same as MSG_task_put but with a bounded transmition 
+ * rate.
+ *
+ * \sa MSG_task_put
+ */
 MSG_error_t MSG_task_put_bounded(m_task_t task,
                                 m_host_t dest, m_channel_t channel,
                                 long double max_rate)
@@ -351,4 +356,3 @@ MSG_error_t MSG_get_errno(void)
 {
   return PROCESS_GET_ERRNO();
 }
-
index 3a9b652..11aa69a 100644 (file)
@@ -98,7 +98,7 @@ m_host_t MSG_host_self(void)
   return MSG_process_get_host(MSG_process_self());
 }
 
-/**
+/*
  * Real function for destroy a host.
  * MSG_host_destroy is just  a front_end that also removes it from 
  * msg_global->host
index 924f80d..2062073 100644 (file)
@@ -12,6 +12,30 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(m_process, msg,
                                "Logging specific to MSG (process)");
 
 /******************************** Process ************************************/
+/** \ingroup m_process_management
+ * \brief Creates and runs a new #m_process_t.
+ *
+ * Does exactly the same as #MSG_process_create_with_arguments but without 
+   providing standard arguments (\a argc, \a argv).
+ * \sa MSG_process_create_with_arguments
+ */
+m_process_t MSG_process_create(const char *name,
+                              m_process_code_t code, void *data,
+                              m_host_t host)
+{
+  return MSG_process_create_with_arguments(name, code, data, host, -1, NULL);
+}
+
+static void MSG_process_cleanup(void *arg)
+{
+  xbt_fifo_remove(msg_global->process_list, arg);
+  xbt_fifo_remove(msg_global->process_to_run, arg);
+  xbt_fifo_remove(((m_process_t) arg)->simdata->host->simdata->process_list, arg);
+  xbt_free(((m_process_t) arg)->name);
+  xbt_free(((m_process_t) arg)->simdata);
+  xbt_free(arg);
+}
+
 /** \ingroup m_process_management
  * \brief Creates and runs a new #m_process_t.
 
@@ -31,26 +55,11 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(m_process, msg,
    object.  It is for user-level information and can be NULL. It can
    be retrieved with the function \ref MSG_process_get_data.
  * \param host the location where the new agent is executed.
+ * \param argc first argument passed to \a code
+ * \param argv second argument passed to \a code
  * \see m_process_t
  * \return The new corresponding object.
  */
-m_process_t MSG_process_create(const char *name,
-                              m_process_code_t code, void *data,
-                              m_host_t host)
-{
-  return MSG_process_create_with_arguments(name, code, data, host, -1, NULL);
-}
-
-static void MSG_process_cleanup(void *arg)
-{
-  xbt_fifo_remove(msg_global->process_list, arg);
-  xbt_fifo_remove(msg_global->process_to_run, arg);
-  xbt_fifo_remove(((m_process_t) arg)->simdata->host->simdata->process_list, arg);
-  xbt_free(((m_process_t) arg)->name);
-  xbt_free(((m_process_t) arg)->simdata);
-  xbt_free(arg);
-}
-
 m_process_t MSG_process_create_with_arguments(const char *name,
                                              m_process_code_t code, void *data,
                                              m_host_t host, int argc, char **argv)
@@ -98,7 +107,12 @@ m_process_t MSG_process_create_with_arguments(const char *name,
   return process;
 }
 
-void MSG_process_free(m_process_t process)
+/** \ingroup m_process_management
+ * \param process poor victim
+ *
+ * This function simply kills a \a process... scarry isn't it ? :)
+ */
+void MSG_process_kill(m_process_t process)
 {
   xbt_fifo_remove(msg_global->process_list,process);
   xbt_context_free(process->simdata->context);
@@ -203,7 +217,6 @@ int MSG_process_get_PID(m_process_t process)
   return (((simdata_process_t) process->simdata)->PID);
 }
 
-
 /** \ingroup m_process_management
  * \brief Returns the process ID of the parent of \a process.
  *
@@ -360,10 +373,6 @@ int MSG_process_isSuspended(m_process_t process)
   return (process->simdata->suspended);
 }
 
-
-
-
-
 MSG_error_t __MSG_process_block(void)
 {
   m_process_t process = MSG_process_self();
index 5a5dc18..490ac65 100644 (file)
@@ -31,6 +31,7 @@ static cpu_t cpu_new(char *name, double power_scale,
   cpu->resource = (surf_resource_t) surf_cpu_resource;
   cpu->name = name;
   cpu->power_scale = power_scale;
+  xbt_assert0(cpu->power_scale>0,"Power has to be >0");
   cpu->power_current = power_initial;
   if (power_trace)
     cpu->power_event =
index cf91f6b..ab285f6 100644 (file)
@@ -50,6 +50,8 @@ static workstation_KCCFLN05_t workstation_new(const char *name,
   workstation->id = nb_workstation++;
 
   workstation->power_scale = power_scale;
+  xbt_assert0(workstation->power_scale>0,"Power has to be >0");
+
   workstation->power_current = power_initial;
   if (power_trace)
     workstation->power_event =
index 2748457..1de8868 100644 (file)
@@ -65,7 +65,7 @@ void xbt_cfg_host_free(void *d){
 /**
  * xbt_cfg_new:
  *
- * @whereto: 
+ * \return
  *
  * Initialise an config set
  */
@@ -78,8 +78,8 @@ xbt_cfg_t xbt_cfg_new(void) {
 /**
  * xbt_cfg_cpy:
  *
- * @whereto: the config set to be created
- * @tocopy: the source data
+ * \arg whereto the config set to be created
+ * \arg tocopy the source data
  *
  */
 
@@ -103,9 +103,9 @@ void xbt_cfg_free(xbt_cfg_t *cfg) {
 
 /**
  * xbt_cfg_dump:
- * @name: The name to give to this config set
- * @indent: what to write at the begining of each line (right number of spaces)
- * @cfg: the config set
+ * \arg name The name to give to this config set
+ * \arg indent what to write at the begining of each line (right number of spaces)
+ * \arg cfg the config set
  *
  * Dumps a config set for debuging purpose
  */
@@ -179,7 +179,7 @@ xbt_cfg_dump(const char *name,const char *indent,xbt_cfg_t cfg) {
 /**
  * xbt_cfgelm_free:
  *
- * @data: the data to be freed (typed as void* to be usable as free funct in dict)
+ * \arg data the data to be freed (typed as void* to be usable as free funct in dict)
  *
  * free an config element
  */
@@ -196,10 +196,10 @@ void xbt_cfgelm_free(void *data) {
 
 /**
  * xbt_cfg_register:
- * @cfg: the config set
- * @type: the type of the config element
- * @min: the minimum
- * @max: the maximum
+ * \arg cfg the config set
+ * \arg type the type of the config element
+ * \arg min the minimum
+ * \arg max the maximum
  *
  * register an element within a config set
  */
@@ -253,8 +253,8 @@ xbt_cfg_register(xbt_cfg_t cfg,
 /**
  * xbt_cfg_unregister:
  * 
- * @cfg: the config set
- * @name: the name of the elem to be freed
+ * \arg cfg the config set
+ * \arg name the name of the elem to be freed
  * 
  * unregister an element from a config set. 
  * Note that it removes both the DTD and the actual content.
@@ -268,8 +268,8 @@ xbt_cfg_unregister(xbt_cfg_t cfg,const char *name) {
 /**
  * xbt_cfg_register_str:
  *
- * @cfg: the config set
- * @entry: a string describing the element to register
+ * \arg cfg the config set
+ * \arg entry a string describing the element to register
  *
  * Parse a string and register the stuff described.
  */
@@ -343,7 +343,7 @@ xbt_cfg_register_str(xbt_cfg_t cfg,const char *entry) {
 /**
  * xbt_cfg_check:
  *
- * @cfg: the config set
+ * \arg cfg the config set
  * 
  * Check the config set
  */
@@ -413,9 +413,9 @@ static xbt_error_t xbt_cfgelm_get(xbt_cfg_t  cfg,
 /**
  * xbt_cfg_get_type:
  *
- * @cfg: the config set
- * @name: the name of the element 
- * @type: the result
+ * \arg cfg the config set
+ * \arg name the name of the element 
+ * \arg type the result
  *
  * Give the type of the config element
  */
@@ -443,11 +443,11 @@ xbt_cfg_get_type(xbt_cfg_t cfg, const char *name,
 /*----[ Setting ]---------------------------------------------------------*/
 /** 
  * xbt_cfg_set_vargs(): 
- * @cfg: config set to fill
- * @varargs: NULL-terminated list of pairs {(const char*)key, value}
+ * \arg cfg config set to fill
+ * \arg varargs NULL-terminated list of pairs {(const char*)key, value}
  *
  * Add some values to the config set.
- * @warning: if the list isn't NULL terminated, it will segfault. 
+ * \warning if the list isn't NULL terminated, it will segfault. 
  */
 xbt_error_t
 xbt_cfg_set_vargs(xbt_cfg_t cfg, va_list pa) {
@@ -496,11 +496,11 @@ xbt_cfg_set_vargs(xbt_cfg_t cfg, va_list pa) {
 
 /** 
  * xbt_cfg_set():
- * @cfg: config set to fill
- * @varargs: NULL-terminated list of pairs {(const char*)key, value}
+ * \arg cfg config set to fill
+ * \arg varargs NULL-terminated list of pairs {(const char*)key, value}
  *
  * Add some values to the config set.
- * @warning: if the list isn't NULL terminated, it will segfault. 
+ * \warning if the list isn't NULL terminated, it will segfault. 
  */
 xbt_error_t xbt_cfg_set(xbt_cfg_t cfg, ...) {
   va_list pa;
@@ -514,8 +514,8 @@ xbt_error_t xbt_cfg_set(xbt_cfg_t cfg, ...) {
 
 /**
  * xbt_cfg_set_parse():
- * @cfg: config set to fill
- * @options: a string containing the content to add to the config set. This
+ * \arg cfg config set to fill
+ * \arg options a string containing the content to add to the config set. This
  * is a '\t',' ' or '\n' separated list of cells. Each individual cell is
  * like "[name]:[value]" where [name] is the name of an already registred 
  * cell, and [value] conforms to the data type under which this cell was
@@ -675,11 +675,11 @@ xbt_cfg_set_parse(xbt_cfg_t cfg, const char *options) {
 /**
  * xbt_cfg_set_int:
  *
- * @cfg: the config set
- * @name: the name of the cell
- * @val: the value of the cell
+ * \arg cfg the config set
+ * \arg name the name of the cell
+ * \arg val the value of the cell
  *
- * Set the value of the cell @name in @cfg with the provided value.
+ * Set the value of the cell #name in #cfg with the provided value.
  */ 
 xbt_error_t
 xbt_cfg_set_int(xbt_cfg_t cfg,const char*name, int val) {
@@ -699,11 +699,11 @@ xbt_cfg_set_int(xbt_cfg_t cfg,const char*name, int val) {
 
 /**
  * xbt_cfg_set_double:
- * @cfg: the config set
- * @name: the name of the cell
- * @val: the doule to set
+ * \arg cfg the config set
+ * \arg name the name of the cell
+ * \arg val the doule to set
  * 
- * Set the value of the cell @name in @cfg with the provided value.
+ * Set the value of the cell #name in #cfg with the provided value.
  */ 
 
 xbt_error_t
@@ -725,11 +725,11 @@ xbt_cfg_set_double(xbt_cfg_t cfg,const char*name, double val) {
 /**
  * xbt_cfg_set_string:
  * 
- * @cfg: the config set
- * @name: the name of the cell
- * @val: the value to be added
+ * \arg cfg the config set
+ * \arg name the name of the cell
+ * \arg val the value to be added
  *
- * Set the value of the cell @name in @cfg with the provided value.
+ * Set the value of the cell #name in #cfg with the provided value.
  */ 
 
 xbt_error_t
@@ -752,13 +752,13 @@ xbt_cfg_set_string(xbt_cfg_t cfg,const char*name, const char*val) {
 /**
  * xbt_cfg_set_host:
  * 
- * @cfg: the config set
- * @name: the name of the cell
- * @host: the host
- * @port: the port number
+ * \arg cfg the config set
+ * \arg name the name of the cell
+ * \arg host the host
+ * \arg port the port number
  *
- * Set the value of the cell @name in @cfg with the provided value 
- * on the given @host to the given @port
+ * Set the value of the cell #name in #cfg with the provided value 
+ * on the given #host to the given #port
  */ 
 
 xbt_error_t 
@@ -788,11 +788,11 @@ xbt_cfg_set_host(xbt_cfg_t cfg,const char*name,
 /**
  * xbt_cfg_rm_int:
  *
- * @cfg: the config set
- * @name: the name of the cell
- * @val: the value to be removed
+ * \arg cfg the config set
+ * \arg name the name of the cell
+ * \arg val the value to be removed
  *
- * Remove the provided @val from the cell @name in @cfg.
+ * Remove the provided #val from the cell #name in #cfg.
  */
 xbt_error_t xbt_cfg_rm_int(xbt_cfg_t cfg,const char*name, int val) {
 
@@ -817,11 +817,11 @@ xbt_error_t xbt_cfg_rm_int(xbt_cfg_t cfg,const char*name, int val) {
 /**
  * xbt_cfg_rm_double:
  *
- * @cfg: the config set
- * @name: the name of the cell
- * @val: the value to be removed
+ * \arg cfg the config set
+ * \arg name the name of the cell
+ * \arg val the value to be removed
  *
- * Remove the provided @val from the cell @name in @cfg.
+ * Remove the provided #val from the cell #name in #cfg.
  */
 
 xbt_error_t xbt_cfg_rm_double(xbt_cfg_t cfg,const char*name, double val) {
@@ -847,11 +847,11 @@ xbt_error_t xbt_cfg_rm_double(xbt_cfg_t cfg,const char*name, double val) {
 /**
  * xbt_cfg_rm_string:
  *
- * @cfg: the config set
- * @name: the name of the cell
- * @val: the value of the string which will be removed
+ * \arg cfg the config set
+ * \arg name the name of the cell
+ * \arg val the value of the string which will be removed
  *
- * Remove the provided @val from the cell @name in @cfg.
+ * Remove the provided #val from the cell #name in #cfg.
  */
 xbt_error_t
 xbt_cfg_rm_string(xbt_cfg_t cfg,const char*name, const char *val) {
@@ -877,12 +877,12 @@ xbt_cfg_rm_string(xbt_cfg_t cfg,const char*name, const char *val) {
 /**
  * xbt_cfg_rm_host:
  * 
- * @cfg: the config set
- * @name: the name of the cell
- * @host: the hostname
- * @port: the port number
+ * \arg cfg the config set
+ * \arg name the name of the cell
+ * \arg host the hostname
+ * \arg port the port number
  *
- * Remove the provided @host:@port from the cell @name in @cfg.
+ * Remove the provided #host:#port from the cell #name in #cfg.
  */
 
 xbt_error_t
@@ -911,8 +911,8 @@ xbt_cfg_rm_host(xbt_cfg_t cfg,const char*name, const char *host,int port) {
 /**
  * xbt_cfg_empty:
  * 
- * @cfg: the config set
- * @name: the name of the cell
+ * \arg cfg the config set
+ * \arg name the name of the cell
  *
  * rm evenything
  */
@@ -941,15 +941,15 @@ xbt_cfg_empty(xbt_cfg_t cfg,const char*name) {
 
 /**
  * xbt_cfg_get_int:
- * @cfg: the config set
- * @name: the name of the cell
- * @val: the wanted value
+ * \arg cfg the config set
+ * \arg name the name of the cell
+ * \arg val the wanted value
  *
  * Returns the first value from the config set under the given name.
  * If there is more than one value, it will issue a warning. Consider using xbt_cfg_get_dynar() 
  * instead.
  *
- * @warning the returned value is the actual content of the config set
+ * \warning the returned value is the actual content of the config set
  */
 xbt_error_t
 xbt_cfg_get_int   (xbt_cfg_t  cfg,
@@ -971,15 +971,15 @@ xbt_cfg_get_int   (xbt_cfg_t  cfg,
 
 /**
  * xbt_cfg_get_double:
- * @cfg: the config set
- * @name: the name of the cell
- * @val: the wanted value
+ * \arg cfg the config set
+ * \arg name the name of the cell
+ * \arg val the wanted value
  *
  * Returns the first value from the config set under the given name.
  * If there is more than one value, it will issue a warning. Consider using xbt_cfg_get_dynar() 
  * instead.
  *
- * @warning the returned value is the actual content of the config set
+ * \warning the returned value is the actual content of the config set
  */
 
 xbt_error_t
@@ -1003,15 +1003,15 @@ xbt_cfg_get_double(xbt_cfg_t  cfg,
 /**
  * xbt_cfg_get_string:
  *
- * @th: the config set
- * @name: the name of the cell
- * @val: the wanted value
+ * \arg th the config set
+ * \arg name the name of the cell
+ * \arg val the wanted value
  *
  * Returns the first value from the config set under the given name.
  * If there is more than one value, it will issue a warning. Consider using xbt_cfg_get_dynar() 
  * instead.
  *
- * @warning the returned value is the actual content of the config set
+ * \warning the returned value is the actual content of the config set
  */
 
 xbt_error_t xbt_cfg_get_string(xbt_cfg_t  cfg,
@@ -1036,16 +1036,16 @@ xbt_error_t xbt_cfg_get_string(xbt_cfg_t  cfg,
 /**
  * xbt_cfg_get_host:
  *
- * @cfg: the config set
- * @name: the name of the cell
- * @host: the host
- * @port: the port number
+ * \arg cfg the config set
+ * \arg name the name of the cell
+ * \arg host the host
+ * \arg port the port number
  *
  * Returns the first value from the config set under the given name.
  * If there is more than one value, it will issue a warning. Consider using xbt_cfg_get_dynar() 
  * instead.
  *
- * @warning the returned value is the actual content of the config set
+ * \warning the returned value is the actual content of the config set
  */
 
 xbt_error_t xbt_cfg_get_host  (xbt_cfg_t  cfg,
@@ -1072,13 +1072,13 @@ xbt_error_t xbt_cfg_get_host  (xbt_cfg_t  cfg,
 
 /**
  * xbt_cfg_get_dynar:
- * @cfg: where to search in
- * @name: what to search for
- * @dynar: result
+ * \arg cfg where to search in
+ * \arg name what to search for
+ * \arg dynar result
  *
  * Get the data stored in the config bag. 
  *
- * @warning the returned value is the actual content of the config set
+ * \warning the returned value is the actual content of the config set
  */
 xbt_error_t xbt_cfg_get_dynar (xbt_cfg_t    cfg,
                                 const char   *name,
index 6ee1726..67d95f7 100644 (file)
@@ -79,6 +79,14 @@ static void xbt_context_destroy(xbt_context_t context)
   return;
 }
 
+/** \name Functions 
+ *  \ingroup XBT_context
+ */
+/*@{*/
+/** Context module initialization
+ *
+ * \warning It has to be called before using any other function of this module.
+ */
 void xbt_context_init(void)
 {
   if(!current_context) {
@@ -89,6 +97,11 @@ void xbt_context_init(void)
   }
 }
 
+/** Garbage collection
+ *
+ * Should be called some time to time to free the memory allocated for contexts
+ * that have finished executing their main functions.
+ */
 void xbt_context_empty_trash(void)
 {
   xbt_context_t context=NULL;
@@ -126,6 +139,12 @@ static void *__context_wrapper(void *c)
   return NULL;
 }
 
+/** 
+ * \param context the context to start
+ * 
+ * Calling this function prepares \a context to be run. It will 
+   however run effectively only when calling #xbt_context_schedule
+ */
 void xbt_context_start(xbt_context_t context) 
 {
 /*   xbt_fifo_insert(msg_global->process, process); */
@@ -136,6 +155,17 @@ void xbt_context_start(xbt_context_t context)
   return;
 }
 
+/** 
+ * \param code a main function
+ * \param startup_func a function to call when running the context for
+ *      the first time and just before the main function \a code
+ * \param startup_arg the argument passed to the previous function (\a startup_func)
+ * \param cleanup_func a function to call when running the context, just after 
+        the termination of the main function \a code
+ * \param cleanup_arg the argument passed to the previous function (\a cleanup_func)
+ * \param argc first argument of function \a code
+ * \param argv seconde argument of function \a code
+ */
 xbt_context_t xbt_context_new(xbt_context_function_t code, 
                              void_f_pvoid_t startup_func, void *startup_arg,
                              void_f_pvoid_t cleanup_func, void *cleanup_arg,
@@ -168,11 +198,24 @@ xbt_context_t xbt_context_new(xbt_context_function_t code,
 }
 
 
+/** 
+ * Calling this function makes the current context yield. The context
+ * that scheduled it returns from xbt_context_schedule as if nothing
+ * had happened.
+ */
 void xbt_context_yield(void)
 {
   __xbt_context_yield(current_context);
 }
 
+
+/** 
+ * \param context the winner
+ *
+ * Calling this function blocks the current context and schedule \a context.  
+ * When \a context will call xbt_context_yield, it will return
+ * to this function as if nothing had happened.
+ */
 void xbt_context_schedule(xbt_context_t context)
 {
   xbt_assert0((current_context==init_context),
@@ -180,6 +223,10 @@ void xbt_context_schedule(xbt_context_t context)
   __xbt_context_yield(context);
 }
 
+/** 
+ * This function kill all existing context and free all the memory
+ * that has been allocated in this module.
+ */
 void xbt_context_exit(void) {
   xbt_context_t context=NULL;
 
@@ -194,6 +241,11 @@ void xbt_context_exit(void) {
   init_context = current_context = NULL ;
 }
 
+/** 
+ * \param context poor victim
+ *
+ * This function simply kills \a context... scarry isn't it ?
+ */
 void xbt_context_free(xbt_context_t context)
 {
   int i ;
@@ -209,3 +261,4 @@ void xbt_context_free(xbt_context_t context)
 
   return;
 }
+/*@}*/
index 4d1d51c..fb87393 100644 (file)
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(dict,xbt,
    "Dictionaries provide the same functionnalities than hash tables");
-
 /*####[ Private prototypes ]#################################################*/
 
-
 /*####[ Code ]###############################################################*/
 
 /**
- * xbt_dict_new:
+ * \ingroup XBT_dict
  *
- * @whereto: pointer to the destination
+ * \return pointer to the destination
  *
  * Creates and initialize a new dictionnary
  */
@@ -36,8 +34,8 @@ xbt_dict_new(void) {
   return res;
 }
 /**
- * xbt_dict_free:
- * @dict: the dictionnary to be freed
+ * \ingroup XBT_dict
+ * \param dict the dictionnary to be freed
  *
  * Frees a cache structure with all its childs.
  */
@@ -54,14 +52,17 @@ xbt_dict_free(xbt_dict_t *dict)  {
 }
 
 /**
- * xbt_dict_set_ext:
+ * \ingroup XBT_dict
  *
- * @dict: the container
- * @key: the key to set the new data
- * @data: the data to add in the dict
+ * \param dict the container
+ * \param key the key to set the new data
+ * \param key_len the size of the #key
+ * \param data the data to add in the dict
+ * \param free_ctn function to call with (#key as argument) when 
+ *        #key is removed from the dictionnary
  *
- * set the @data in the structure under the @key, which can be any kind 
- * of data, as long as its length is provided in @key_len.
+ * set the #data in the structure under the #key, which can be any kind 
+ * of data, as long as its length is provided in #key_len.
  */
 void
 xbt_dict_set_ext(xbt_dict_t      dict,
@@ -77,13 +78,15 @@ xbt_dict_set_ext(xbt_dict_t      dict,
 }
 
 /**
- * xbt_dict_set:
+ * \ingroup XBT_dict
  *
- * @head: the head of the dict
- * @key: the key to set the new data
- * @data: the data to add in the dict
+ * \param dict the head of the dict
+ * \param key the key to set the new data
+ * \param data the data to add in the dict
+ * \param free_ctn function to call with (#key as argument) when 
+ *        #key is removed from the dictionnary
  *
- * set the @data in the structure under the @key, which is a 
+ * set the #data in the structure under the #key, which is a 
  * null terminated string.
  */
 void
@@ -98,14 +101,15 @@ xbt_dict_set(xbt_dict_t     dict,
 }
 
 /**
- * xbt_dict_get_ext:
+ * \ingroup XBT_dict
  *
- * @dict: the dealer of data
- * @key: the key to find data
- * @data: the data that we are looking for
- * @Returns: xbt_error
+ * \param dict the dealer of data
+ * \param key the key to find data
+ * \param key_len the size of the #key
+ * \param data the data that we are looking for
+ * \return xbt_error
  *
- * Search the given @key. mismatch_error when not found.
+ * Search the given #key. mismatch_error when not found.
  */
 xbt_error_t
 xbt_dict_get_ext(xbt_dict_t     dict,
@@ -119,14 +123,14 @@ xbt_dict_get_ext(xbt_dict_t     dict,
 }
 
 /**
- * xbt_dict_get:
+ * \ingroup XBT_dict
  *
- * @dict: the dealer of data
- * @key: the key to find data
- * @data: the data that we are looking for
- * @Returns: xbt_error
+ * \param dict the dealer of data
+ * \param key the key to find data
+ * \param data the data that we are looking for
+ * \return xbt_error
  *
- * Search the given @key. mismatch_error when not found.
+ * Search the given #key. mismatch_error when not found.
  */
 xbt_error_t
 xbt_dict_get(xbt_dict_t     dict,
@@ -139,13 +143,14 @@ xbt_dict_get(xbt_dict_t     dict,
 
 
 /**
- * xbt_dict_remove_ext:
+ * \ingroup XBT_dict
  *
- * @dict: the trash can
- * @key: the key of the data to be removed
- * @Returns: xbt_error_t
+ * \param dict the trash can
+ * \param key the key of the data to be removed
+ * \param key_len the size of the #key
+ * \return xbt_error_t
  *
- * Remove the entry associated with the given @key
+ * Remove the entry associated with the given #key
  */
 xbt_error_t
 xbt_dict_remove_ext(xbt_dict_t  dict,
@@ -157,13 +162,13 @@ xbt_dict_remove_ext(xbt_dict_t  dict,
 }
 
 /**
- * xbt_dict_remove:
+ * \ingroup XBT_dict
  *
- * @head: the head of the dict
- * @key: the key of the data to be removed
- * @Returns: xbt_error_t
+ * \param dict the head of the dict
+ * \param key the key of the data to be removed
+ * \return xbt_error_t
  *
- * Remove the entry associated with the given @key
+ * Remove the entry associated with the given #key
  */
 xbt_error_t
 xbt_dict_remove(xbt_dict_t  dict,
@@ -176,13 +181,13 @@ xbt_dict_remove(xbt_dict_t  dict,
 
 
 /**
- * xbt_dict_dump:
+ * \ingroup XBT_dict
  *
- * @dict: the exibitionist
- * @output: a function to dump each data in the tree
- * @Returns: xbt_error_t
+ * \param dict the exibitionist
+ * \param output a function to dump each data in the tree
+ * \return xbt_error_t
  *
- * Ouputs the content of the structure. (for debuging purpose). @ouput is a
+ * Ouputs the content of the structure. (for debuging purpose). #ouput is a
  * function to output the data. If NULL, data won't be displayed.
  */
 
@@ -193,4 +198,3 @@ xbt_dict_dump(xbt_dict_t     dict,
   printf("Dict %p:\n", (void*)dict);
   xbt_dictelm_dump(dict ? dict->head: NULL, output);
 }
-
index 9a85b80..6b0bcd8 100644 (file)
@@ -119,9 +119,9 @@ _xbt_dynar_put_elm(const xbt_dynar_t  dynar,
 }
 
 /**
- * xbt_dynar_new:
- * @elm_size: size of each element in the dynar
- * @free_func: function to call each time we want to get rid of an element (or NULL if nothing to do).
+ * \ingroup XBT_dynar
+ * \param elmsize size of each element in the dynar
+ * \param free_f function to call each time we want to get rid of an element (or NULL if nothing to do).
  *
  * Creates a new dynar. If a free_func is provided, the elements have to be
  * pointer of pointer. That is to say that dynars can contain either base
@@ -143,8 +143,8 @@ xbt_dynar_new(const unsigned long           elmsize,
 }
 
 /**
- * xbt_dynar_free_container:
- * @dynar: poor victim
+ * \ingroup XBT_dynar
+ * \param dynar poor victim
  *
  * kilkil a dynar BUT NOT its content. Ie, the array is freed, but not what
  * its contain points to.
@@ -166,8 +166,8 @@ xbt_dynar_free_container(xbt_dynar_t *dynar) {
 }
 
 /**
- * xbt_dynar_reset:
- * @dynar: who to squeeze
+ * \ingroup XBT_dynar
+ * \param dynar who to squeeze
  *
  * Frees the content and set the size to 0
  */
@@ -190,8 +190,8 @@ xbt_dynar_reset(xbt_dynar_t const dynar) {
 }
 
 /**
- * xbt_dynar_free:
- * @dynar: poor victim
+ * \ingroup XBT_dynar
+ * \param dynar poor victim
  *
  * kilkil a dynar and its content
  */
@@ -205,8 +205,8 @@ xbt_dynar_free(xbt_dynar_t * dynar) {
 }
 
 /**
- * xbt_dynar_length:
- * @dynar: the dynar we want to mesure
+ * \ingroup XBT_dynar
+ * \param dynar the dynar we want to mesure
  *
  * Returns the count of elements in a dynar
  */
@@ -216,10 +216,10 @@ xbt_dynar_length(const xbt_dynar_t dynar) {
 }
 
 /**
- * xbt_dynar_get_cpy:
- * @dynar: information dealer
- * @idx: index of the slot we want to retrive
- * @dst: where to pu the result to.
+ * \ingroup XBT_dynar
+ * \param dynar information dealer
+ * \param idx index of the slot we want to retrive
+ * \param[out] dst where to put the result to.
  *
  * Retrieve a copy of the Nth element of a dynar.
  */
@@ -236,10 +236,10 @@ xbt_dynar_get_cpy(const xbt_dynar_t dynar,
 }
 
 /**
- * xbt_dynar_get_ptr:
- * @dynar: information dealer
- * @idx: index of the slot we want to retrive
- * @dst: where to pu the result to.
+ * \ingroup XBT_dynar
+ * \param dynar information dealer
+ * \param idx index of the slot we want to retrieve
+ * \return the #idx-th element of #dynar.
  *
  * Retrieve the Nth element of a dynar. Warning, the returned value is the actual content of 
  * the dynar. Make a copy before fooling with it.
@@ -256,10 +256,10 @@ xbt_dynar_get_ptr(const xbt_dynar_t dynar,
 }
 
 /**
- * xbt_dynar_set:
- * @dynar:
- * @idx:
- * @src: What will be feeded to the dynar
+ * \ingroup XBT_dynar
+ * \param dynar information dealer
+ * \param idx index of the slot we want to modify
+ * \param src What will be feeded to the dynar
  *
  * Set the Nth element of a dynar, expanding the dynar if needed, BUT NOT freeing
  * the previous value at this position. If you want to free the previous content,
@@ -283,10 +283,10 @@ xbt_dynar_set(xbt_dynar_t         dynar,
 }
 
 /**
- * xbt_dynar_replace:
- * @dynar:
- * @idx:
- * @object:
+ * \ingroup XBT_dynar
+ * \param dynar
+ * \param idx
+ * \param object
  *
  * Set the Nth element of a dynar, expanding the dynar if needed, AND DO
  * free the previous value at this position. If you don't want to free the
@@ -310,7 +310,7 @@ xbt_dynar_replace(xbt_dynar_t         dynar,
 }
 
 /**
- * xbt_dynar_insert_at_ptr:
+ * \ingroup XBT_dynar
  * 
  * Make room for a new element in the dynar, and return a pointer to
  * its position. You can then use regular affectation to set its value
@@ -345,10 +345,10 @@ xbt_dynar_insert_at_ptr(xbt_dynar_t const dynar,
 }
 
 /**
- * xbt_dynar_insert_at:
- * @dynar:
- * @idx:
- * @src: What will be feeded to the dynar
+ * \ingroup XBT_dynar
+ * \param dynar
+ * \param idx
+ * \param src What will be feeded to the dynar
  *
  * Set the Nth element of a dynar, expanding the dynar if needed, and
  * moving the previously existing value and all subsequent ones to one
@@ -366,10 +366,10 @@ xbt_dynar_insert_at(xbt_dynar_t  const dynar,
 }
 
 /**
- * xbt_dynar_remove_at:
- * @dynar: 
- * @idx:
- * @object:
+ * \ingroup XBT_dynar
+ * \param dynar 
+ * \param idx
+ * \param object
  *
  * Get the Nth element of a dynar, removing it from the dynar and moving
  * all subsequent values to one position left in the dynar.
@@ -405,7 +405,7 @@ xbt_dynar_remove_at(xbt_dynar_t  const dynar,
 }
 
 /**
- * xbt_dynar_push_ptr:
+ * \ingroup XBT_dynar
  * 
  * Make room at the end of the dynar for a new element, and return a pointer to it
  */
@@ -415,9 +415,9 @@ xbt_dynar_push_ptr(xbt_dynar_t  const dynar) {
 }
 
 /**
- * xbt_dynar_push:
- * @dynar:
- * @src:
+ * \ingroup XBT_dynar
+ * \param dynar
+ * \param src
  *
  * Add an element at the end of the dynar
  */
@@ -429,9 +429,8 @@ xbt_dynar_push(xbt_dynar_t  const dynar,
 }
 
 /**
- * xbt_dynar_pop_ptr:
- * @dynar:
- * @dst:
+ * \param dynar
+ * \param dst
  *
  * Make the last element of the dynar as unused and return a pointer to it.
  */
@@ -445,9 +444,9 @@ xbt_dynar_pop_ptr(xbt_dynar_t  const dynar) {
 }
 
 /**
- * xbt_dynar_pop:
- * @dynar:
- * @dst:
+ * \ingroup XBT_dynar
+ * \param dynar
+ * \param[out] dst
  *
  * Get and remove the last element of the dynar
  */
@@ -461,9 +460,9 @@ xbt_dynar_pop(xbt_dynar_t  const dynar,
 }
 
 /**
- * xbt_dynar_unshift:
- * @dynar:
- * @src:
+ * \ingroup XBT_dynar
+ * \param dynar
+ * \param src
  *
  * Add an element at the begining of the dynar (rather long, Use
  * xbt_dynar_push() when possible)
@@ -477,9 +476,9 @@ xbt_dynar_unshift(xbt_dynar_t  const dynar,
 }
 
 /**
- * xbt_dynar_shift:
- * @dynar:
- * @dst:
+ * \ingroup XBT_dynar
+ * \param dynar
+ * \param[out] dst
  *
  * Get and remove the first element of the dynar (rather long, Use
  * xbt_dynar_pop() when possible)
@@ -493,9 +492,9 @@ xbt_dynar_shift(xbt_dynar_t  const dynar,
 }
 
 /**
- * xbt_dynar_map:
- * @dynar:
- * @operator:
+ * \ingroup XBT_dynar
+ * \param dynar
+ * \param operator
  *
  * Apply a function to each member of a dynar (this function may change the
  * value of the element itself, but should not mess with the dynar).
@@ -519,7 +518,7 @@ xbt_dynar_map(const xbt_dynar_t  dynar,
 }
 
 /**
- * xbt_dynar_cursor_first:
+ * \ingroup XBT_dynar
  *
  * Put the cursor at the begining of the dynar. (actually, one step before
  * the begining, so that you can iterate over the dynar with a for loop).
@@ -538,7 +537,7 @@ xbt_dynar_cursor_first(const xbt_dynar_t dynar,
 }
 
 /**
- * xbt_dynar_cursor_step:
+ * \ingroup XBT_dynar
  *
  * Move the cursor to the next value (and return true), or return false.
  */
@@ -550,7 +549,7 @@ xbt_dynar_cursor_step(const xbt_dynar_t dynar,
 }
 
 /**
- * xbt_dynar_cursor_get:
+ * \ingroup XBT_dynar
  *
  * Get the current value of the cursor
  */
@@ -577,9 +576,9 @@ xbt_dynar_cursor_get(const xbt_dynar_t dynar,
 }
 
 /**
- * xbt_dynar_cursor_rm:
- * @dynar:
- * @cursor:
+ * \ingroup XBT_dynar
+ * \param dynar
+ * \param cursor
  *
  * Remove (free) the entry pointed by the cursor, for use in the middle of a foreach
  */
index 7f221a7..de142cf 100644 (file)
 #include "xbt/error.h"
 
 /**
- * xbt_error_name:
- * @errcode: 
- * @Returns: the printable name of an error code
+ * \brief Usefull to do nice error repporting messages.
+ * \ingroup XBT_error
+ * \param errcode 
+ * \return the printable name of an error code
  *
- * usefull to do nice error repporting messages
  */
-
 const char *xbt_error_name(xbt_error_t errcode)  {
 
    switch (errcode) {
@@ -37,6 +36,12 @@ const char *xbt_error_name(xbt_error_t errcode)  {
 XBT_LOG_EXTERNAL_CATEGORY(xbt);
 XBT_LOG_DEFAULT_CATEGORY(xbt);
   
+/**
+ * \ingroup XBT_error
+ * \param msg 
+ *
+ * Things are so messed up that the only thing to do now, is to stop the program.
+ */
 void xbt_die (const char *msg) {
    CRITICAL1("%s",msg);
    xbt_abort();
index d839032..e0c4121 100644 (file)
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(fifo,xbt,"FIFO");
 
-/*
- * xbt_fifo_new()
+/** \name Functions 
+ *  \ingroup XBT_fifo
+ */
+/*@{*/
+
+/** Constructor
+ * \return a new fifo
  */
 xbt_fifo_t xbt_fifo_new(void)
 {
@@ -21,8 +26,10 @@ xbt_fifo_t xbt_fifo_new(void)
   return fifo;
 }
 
-/*
- * xbt_fifo_free()
+/** Destructor
+ * \param l poor victim
+ *
+ * Free the fifo structure. None of the objects that was in the fifo is however modified.
  */
 void xbt_fifo_free(xbt_fifo_t l)
 {
@@ -34,9 +41,12 @@ void xbt_fifo_free(xbt_fifo_t l)
   return;
 }
 
-/*
- * xbt_fifo_push()
- * at the tail
+/* Push
+ * \param l list
+ * \param t element
+ * \return the bucket that was just added
+ *
+ * Add an object at the tail of the list
  */
 xbt_fifo_item_t xbt_fifo_push(xbt_fifo_t l, void *t)
 {
@@ -49,9 +59,12 @@ xbt_fifo_item_t xbt_fifo_push(xbt_fifo_t l, void *t)
   return new;
 }
 
-/*
- * xbt_fifo_pop()
- * from the tail
+/** Pop
+ * \param l list
+ * \returns the object stored at the tail of the list.
+ *
+ * Removes and returns the object stored at the tail of the list. 
+ * Returns NULL if the list is empty.
  */
 void *xbt_fifo_pop(xbt_fifo_t l)
 {
@@ -66,9 +79,12 @@ void *xbt_fifo_pop(xbt_fifo_t l)
   return content;
 }
 
-/*
- * xbt_fifo_unshift()
- * at the head
+/**
+ * \param l list
+ * \param t element
+ * \return the bucket that was just added
+ *
+ * Add an object at the head of the list
  */
 xbt_fifo_item_t xbt_fifo_unshift(xbt_fifo_t l, void *t)
 {
@@ -80,9 +96,12 @@ xbt_fifo_item_t xbt_fifo_unshift(xbt_fifo_t l, void *t)
   return new;
 }
 
-/*
- * xbt_fifo_shift()
- * from the head
+/** Shift
+ * \param l list
+ * \returns the object stored at the head of the list.
+ *
+ * Removes and returns the object stored at the head of the list. 
+ * Returns NULL if the list is empty.
  */
 void *xbt_fifo_shift(xbt_fifo_t l)
 {
@@ -97,9 +116,11 @@ void *xbt_fifo_shift(xbt_fifo_t l)
   return content;
 }
 
-/*
- * xbt_fifo_push_item()
- * at the tail
+/** Push a bucket
+ * \param l list
+ * \param new bucket
+ *
+ * Hook up this bucket at the tail of the list
  */
 void xbt_fifo_push_item(xbt_fifo_t l, xbt_fifo_item_t new)
 {
@@ -114,9 +135,11 @@ void xbt_fifo_push_item(xbt_fifo_t l, xbt_fifo_item_t new)
   l->tail = new;
 }
 
-/*
- * xbt_fifo_pop_item()
- * from the tail
+/** Pop bucket
+ * \param l
+ * \returns the bucket that was at the tail of the list.
+ *
+ * Returns NULL if the list was empty.
  */
 xbt_fifo_item_t xbt_fifo_pop_item(xbt_fifo_t l)
 {
@@ -137,9 +160,11 @@ xbt_fifo_item_t xbt_fifo_pop_item(xbt_fifo_t l)
   return item;
 }
 
-/*
- * xbt_fifo_unshift_item()
- * at the head
+/** Push a bucket
+ * \param l list
+ * \param new bucket
+ *
+ * Hook up this bucket at the head of the list
  */
 void xbt_fifo_unshift_item(xbt_fifo_t l, xbt_fifo_item_t new)
 {
@@ -155,9 +180,11 @@ void xbt_fifo_unshift_item(xbt_fifo_t l, xbt_fifo_item_t new)
   return;
 }
 
-/*
- * xbt_fifo_shift_item()
- * from the head
+/** Shift bucket
+ * \param l
+ * \returns the bucket that was at the head of the list.
+ *
+ * Returns NULL if the list was empty.
  */
 xbt_fifo_item_t xbt_fifo_shift_item(xbt_fifo_t l)
 {
@@ -178,9 +205,12 @@ xbt_fifo_item_t xbt_fifo_shift_item(xbt_fifo_t l)
   return item;
 }
 
-/*
- * xbt_fifo_remove()
- *   removes an xbt_fifo_item_t using its content from the xbt_fifo 
+/**
+ * \param l 
+ * \param t an objet
+ *
+ * removes the first occurence of \a t from \a l. 
+ * \warning it will not remove duplicates
  */
 void xbt_fifo_remove(xbt_fifo_t l, void *t)
 {
@@ -200,9 +230,11 @@ void xbt_fifo_remove(xbt_fifo_t l, void *t)
   return;
 }
 
-/*
- * xbt_fifo_remove_item()
- *   removes a given xbt_fifo_item_t from the xbt_fifo
+/**
+ * \param l a list
+ * \param current a bucket
+ *
+ * removes a the bucket \a current from the list \a l
  */
 void xbt_fifo_remove_item(xbt_fifo_t l, xbt_fifo_item_t current)
 {
@@ -226,8 +258,10 @@ void xbt_fifo_remove_item(xbt_fifo_t l, xbt_fifo_item_t current)
     (l->count)--;
 }
 
-/*
- * xbt_fifo_is_in()
+/**
+ * \param f a list
+ * \param content an object
+ * \return 1 if \a content is in \a f.
  */
 int xbt_fifo_is_in(xbt_fifo_t f, void *content)
 {
@@ -240,8 +274,9 @@ int xbt_fifo_is_in(xbt_fifo_t f, void *content)
   return 0;
 }
 
-/*
- * xbt_fifo_to_array()
+/**
+ * \param f a list
+ * \return a table with the objects stored in \a f.
  */
 void **xbt_fifo_to_array(xbt_fifo_t f)
 {
@@ -260,8 +295,9 @@ void **xbt_fifo_to_array(xbt_fifo_t f)
   return array;
 }
 
-/*
- * xbt_fifo_Copy()
+/**
+ * \param f a list
+ * \return a copy of \a f.
  */
 xbt_fifo_t xbt_fifo_copy(xbt_fifo_t f)
 {
@@ -276,26 +312,38 @@ xbt_fifo_t xbt_fifo_copy(xbt_fifo_t f)
   return copy;
 }
 
-/*
- * xbt_fifo_newitem()
+/** Constructor
+ * \return a new bucket
  */
 xbt_fifo_item_t xbt_fifo_newitem(void)
 {
   return xbt_new0(struct xbt_fifo_item,1);
 }
 
+/**
+ * \param i a bucket
+ * \param v an object
+ *
+ * stores \a v in \a i.
+ */
 void xbt_fifo_set_item_content(xbt_fifo_item_t i , void *v)
 {
   xbt_fifo_setItemcontent(i,v);
 }
 
+/**
+ * \param i a bucket
+ * \return the object stored \a i.
+ */
 void *xbt_fifo_get_item_content(xbt_fifo_item_t i)
 {
   return xbt_fifo_getItemcontent(i);
 }
 
-/*
- * xbt_fifo_freeitem()
+/** Destructor
+ * \param b poor victim
+ *
+ * Free the bucket but does not modifies the object (if any) that was stored in it.
  */
 void xbt_fifo_freeitem(xbt_fifo_item_t b)
 {
@@ -303,26 +351,43 @@ void xbt_fifo_freeitem(xbt_fifo_item_t b)
   return;
 }
 
+/**
+ * \param f a list
+ * \return the number of buckets in \a f.
+ */
 int xbt_fifo_size(xbt_fifo_t f)
 {
   return f->count;
 }
 
+/**
+ * \param l a list
+ * \return the head of \a l.
+ */
 xbt_fifo_item_t xbt_fifo_getFirstItem(xbt_fifo_t l)
 {
   return l->head;
 }
 
+/**
+ * \param i a bucket
+ * \return the bucket that comes next
+ */
 xbt_fifo_item_t xbt_fifo_getNextItem(xbt_fifo_item_t i)
 {
   if(i) return i->next;
   return NULL;
 }
 
+/**
+ * \param i a bucket
+ * \return the bucket that is just before \a i.
+ */
 xbt_fifo_item_t xbt_fifo_getPrevItem(xbt_fifo_item_t i)
 {
   if(i) return i->prev;
   return NULL;
 }
+/*@}*/
 
 
index e37675f..8de439f 100644 (file)
 #include "heap_private.h"
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(heap, xbt, "Heap");
 
+/** \name Functions 
+ *  \ingroup XBT_heap
+ */
+/*@{*/
 /**
- * xbt_heap_new:
- * @init_size: initial size of the heap
- * @free_func: function to call on each element when you want to free
+ * \param init_size initial size of the heap
+ * \param free_func function to call on each element when you want to free
  *             the whole heap (or NULL if nothing to do).
  *
  * Creates a new heap.
@@ -31,8 +34,7 @@ xbt_heap_t xbt_heap_new(int init_size, void_f_pvoid_t * const free_func)
 }
 
 /**
- * xbt_heap_free:
- * @H: poor victim
+ * \param H poor victim
  *
  * kilkil a heap and its content
  */
@@ -48,10 +50,8 @@ void xbt_heap_free(xbt_heap_t H)
 }
 
 /**
- * xbt_heap_size:
- * @H: the heap we're working on
- *
- * returns the number of elements in the heap
+ * \param H the heap we're working on
+ * \return the number of elements in the heap
  */
 int xbt_heap_size(xbt_heap_t H)
 {
@@ -59,10 +59,9 @@ int xbt_heap_size(xbt_heap_t H)
 }
 
 /**
- * xbt_heap_push:
- * @H: the heap we're working on
- * @content: the object you want to add to the heap
- * @key: the key associated to this object
+ * \param H the heap we're working on
+ * \param content the object you want to add to the heap
+ * \param key the key associated to this object
  *
  * Add an element int the heap. The element with the smallest key is
  * automatically moved at the top of the heap.
@@ -86,8 +85,8 @@ void xbt_heap_push(xbt_heap_t H, void *content, double key)
 }
 
 /**
- * xbt_heap_pop:
- * @H: the heap we're working on
+ * \param H the heap we're working on
+ * \return the element with the smallest key
  *
  * Extracts from the heap and returns the element with the smallest
  * key. The element with the next smallest key is automatically moved
@@ -115,10 +114,9 @@ void *xbt_heap_pop(xbt_heap_t H)
 }
 
 /**
- * xbt_heap_maxkey:
- * @H: the heap we're working on
+ * \param H the heap we're working on
  *
- * Returns the smallest key in the heap without modifying the heap.
+ * \return the smallest key in the heap without modifying the heap.
  */
 double xbt_heap_maxkey(xbt_heap_t H)
 {
@@ -127,10 +125,9 @@ double xbt_heap_maxkey(xbt_heap_t H)
 }
 
 /**
- * xbt_heap_maxcontent:
- * @H: the heap we're working on
+ * \param H the heap we're working on
  *
- * Returns the value associated to the smallest key in the heap
+ * \return the value associated to the smallest key in the heap
  * without modifying the heap.
  */
 void *xbt_heap_maxcontent(xbt_heap_t H)
@@ -139,9 +136,8 @@ void *xbt_heap_maxcontent(xbt_heap_t H)
   return CONTENT(H, 0);
 }
 
-/**
- * xbt_heap_maxcontent:
- * @H: the heap we're working on
+/* <<<< private >>>>
+ * \param H the heap we're working on
  * 
  * Restores the heap property once an element has been deleted.
  */
@@ -167,10 +163,9 @@ static void xbt_heap_maxHeapify(xbt_heap_t H)
   }
 }
 
-/**
- * xbt_heap_maxcontent:
- * @H: the heap we're working on
- * @i: an item position in the heap
+/* <<<< private >>>>
+ * \param H the heap we're working on
+ * \param i an item position in the heap
  * 
  * Moves up an item at position i to its correct position. Works only
  * when called from xbt_heap_push. Do not use otherwise.
@@ -185,3 +180,4 @@ static void xbt_heap_increaseKey(xbt_heap_t H, int i)
   }
   return;
 }
+/*@}*/
index e76d823..205a479 100644 (file)
@@ -324,8 +324,8 @@ static void _cleanup_double_spaces(char *s) {
 }
 
 /**
- * xbt_log_control_set:
- * @cs: What to parse
+ * \ingroup XBT_log  
+ * \param control_string What to parse
  *
  * Typically passed a command-line argument. The string has the syntax:
  *
@@ -337,7 +337,7 @@ static void _cleanup_double_spaces(char *s) {
  *      thresh         value is an integer priority level. Sets the category's
  *                        threshold priority.
  *
- * @warning
+ * \warning
  * This routine may only be called once and that must be before any other
  * logging command! Typically, this is done from main().
  */
index 3df8c9d..899fd82 100644 (file)
@@ -26,8 +26,8 @@ typedef struct xbt_set_ {
 
 /*####[ Memory  ]############################################################*/
 /**
- * xbt_set_new:
- * @dst: where to
+ * \ingroup XBT_set 
+ * \return a new set
  *
  * Creates a new set.
  */
@@ -41,8 +41,8 @@ xbt_set_t xbt_set_new (void) {
 }
 
 /**
- * xbt_set_free:
- * @set:
+ * \ingroup XBT_set 
+ * \param set
  *
  * Frees a set.
  */
@@ -56,10 +56,10 @@ void  xbt_set_free(xbt_set_t *set) {
 }
 
 /**
- * xbt_set_add:
- * @set: set to populate
- * @elm: element to add. 
- * @free_ctn: How to add the data 
+ * \ingroup XBT_set 
+ * \param set set to populate
+ * \param elm element to add. 
+ * \param free_func How to add the data 
  *
  * Add an element to a set. 
  *
@@ -105,10 +105,10 @@ void xbt_set_add    (xbt_set_t      set,
 }
 
 /**
- * xbt_set_get_by_name:
- * @set:
- * @name: Name of the searched cell
- * @dst: where to put the found data into
+ * \ingroup XBT_set 
+ * \param set
+ * \param name Name of the searched cell
+ * \param dst where to put the found data into
  *
  * get a data stored in the cell by providing its name.
  */
@@ -121,11 +121,11 @@ xbt_error_t xbt_set_get_by_name    (xbt_set_t     set,
   return errcode;
 }
 /**
- * xbt_set_get_by_name_ext:
- * @set:
- * @name: Name of the searched cell
- * @name_len: length of the name, when strlen cannot be trusted
- * @dst: where to put the found data into
+ * \ingroup XBT_set 
+ * \param set
+ * \param name Name of the searched cell
+ * \param name_len length of the name, when strlen cannot be trusted
+ * \param dst where to put the found data into
  *
  * get a data stored in the cell by providing its name (and the length
  * of the name, when strlen cannot be trusted because you don't use a char*
@@ -140,10 +140,10 @@ xbt_error_t xbt_set_get_by_name_ext(xbt_set_t      set,
 }
 
 /**
- * xbt_set_get_by_code:
- * @set:
- * @id: what you're looking for
- * @dst: where to put the found data into
+ * \ingroup XBT_set 
+ * \param set
+ * \param id what you're looking for
+ * \param dst where to put the found data into
  *
  * get a data stored in the cell by providing its id. 
  * @warning, if the ID does not exists, you're getting into trouble
@@ -170,9 +170,9 @@ typedef struct xbt_set_cursor_ {
 } s_xbt_set_cursor_t;
 
 /**
- * xbt_set_cursor_first:
- * @set: on what to let the cursor iterate
- * @cursor: dest address
+ * \ingroup XBT_set 
+ * \param set on what to let the cursor iterate
+ * \param cursor dest address
  *
  * Create the cursor if it does not exists. Rewind it in any case.
  */
@@ -194,8 +194,8 @@ void         xbt_set_cursor_first       (xbt_set_t         set,
 }
 
 /**
- * xbt_set_cursor_step:
- * @cursor: the cursor
+ * \ingroup XBT_set 
+ * \param cursor the cursor
  *
  * Move to the next element. 
  */
@@ -204,9 +204,10 @@ void         xbt_set_cursor_step        (xbt_set_cursor_t cursor) {
 }
 
 /**
- * xbt_set_cursor_get_or_free:
- * @cursor: the cursor
- * @Returns: true if it's ok, false if there is no more data
+ * \ingroup XBT_set 
+ * \param curs the cursor
+ * \param elm an element
+ * \return true if it's ok, false if there is no more data
  *
  * Get current data
  */
index dae77dc..5374dc1 100644 (file)
@@ -20,10 +20,17 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(swag,xbt,"Swag : O(1) set library");
 #define PREV(obj,offset) xbt_swag_getPrev(obj,offset)
 #define NEXT(obj,offset) xbt_swag_getNext(obj,offset)
 
-/*
-  Usage : xbt_swag_new(&obj.setA-&obj);
+/** \name Functions 
+ *  \ingroup XBT_swag
  */
+/*@{*/
 
+/** Creates a new swag.
+ * \param offset where the hookup is located in the structure
+ * \see xbt_swag_offset
+ *
+ * Usage : xbt_swag_new(&obj.setA-&obj); 
+ */
 xbt_swag_t xbt_swag_new(size_t offset)
 {
   xbt_swag_t swag = xbt_new0(s_xbt_swag_t, 1);
@@ -33,17 +40,36 @@ xbt_swag_t xbt_swag_new(size_t offset)
   return swag;
 }
 
-
+/** 
+ * \param swag poor victim
+ * 
+ * kilkil a swag but not it's content. If you do not understand why
+ * xbt_swag_free should not free its content, don't use swags.
+ */
 void xbt_swag_free(xbt_swag_t swag)
 {
   xbt_free(swag);
 }
 
+/** Creates a new swag.
+ * \param swag the swag to initialize
+ * \param offset where the hookup is located in the structure
+ * \see xbt_swag_offset
+ *
+ * Usage : xbt_swag_init(swag,&obj.setA-&obj); 
+ */
 void xbt_swag_init(xbt_swag_t swag, size_t offset)
 {
   swag->offset = offset;
 }
 
+
+/** 
+ * \param obj the objet to insert in the swag
+ * \param swag a swag
+ *
+ * insert \a obj in \a swag
+ */
 void xbt_swag_insert(void *obj, xbt_swag_t swag)
 {
 
@@ -64,6 +90,13 @@ void xbt_swag_insert(void *obj, xbt_swag_t swag)
   swag->tail = obj;
 }
 
+/** 
+ * \param obj the objet to insert in the swag
+ * \param swag a swag
+ *
+ * insert (at the head... you probably had a very good reason to do
+ * that, I hope you know what you're doing) \a obj in \a swag
+ */
 void xbt_swag_insert_at_head(void *obj, xbt_swag_t swag)
 {
 
@@ -84,6 +117,13 @@ void xbt_swag_insert_at_head(void *obj, xbt_swag_t swag)
   swag->head = obj;
 }
 
+/** 
+ * \param obj the objet to insert in the swag
+ * \param swag a swag
+ *
+ * insert (at the tail... you probably had a very good reason to do
+ * that, I hope you know what you're doing) \a obj in \a swag
+ */
 void xbt_swag_insert_at_tail(void *obj, xbt_swag_t swag)
 {
 
@@ -104,6 +144,13 @@ void xbt_swag_insert_at_tail(void *obj, xbt_swag_t swag)
   swag->tail = obj;
 }
 
+/** 
+ * \param obj the objet to remove from the swag
+ * \param swag a swag
+ * \return \a obj if it was in the \a swag and NULL otherwise
+ *
+ * removes \a obj from \a swag
+ */
 void *xbt_swag_remove(void *obj, xbt_swag_t swag)
 {
   size_t offset = swag->offset;
@@ -137,6 +184,10 @@ void *xbt_swag_remove(void *obj, xbt_swag_t swag)
   return obj;
 }
 
+/** 
+ * \param swag a swag
+ * \return an object from the \a swag
+ */
 void *xbt_swag_extract(xbt_swag_t swag)
 {
   size_t offset = swag->offset;
@@ -159,14 +210,23 @@ void *xbt_swag_extract(xbt_swag_t swag)
 
   return obj;
 }
-
+/** 
+ * \param swag a swag
+ * \return the number of objects in \a swag
+ */
 int xbt_swag_size(xbt_swag_t swag)
 {
   return (swag->count);
 }
 
+/** 
+ * \param obj an object
+ * \param swag a swag
+ * \return 1 if \a obj is in the \a swag and 0 otherwise
+ */
 int xbt_swag_belongs(void *obj, xbt_swag_t swag)
 {
   return ((NEXT(obj, swag->offset)) || (PREV(obj, swag->offset))
          || (swag->head == obj));
 }
+/*@}*/