From 2da40b8c48f7615cb7fb4bdab32f4d96e4541d91 Mon Sep 17 00:00:00 2001 From: mquinson Date: Tue, 20 Oct 2009 13:08:44 +0000 Subject: [PATCH 1/1] New function: SIMIX_action_set_name() git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6802 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/include/simix/simix.h | 1 + src/simix/smx_action.c | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/include/simix/simix.h b/src/include/simix/simix.h index bf29e190c8..e27e4f7610 100644 --- a/src/include/simix/simix.h +++ b/src/include/simix/simix.h @@ -171,6 +171,7 @@ XBT_PUBLIC(smx_action_t) SIMIX_action_parallel_execute(char *name, double rate); XBT_PUBLIC(char *) SIMIX_action_get_name(smx_action_t action); +XBT_PUBLIC(void) SIMIX_action_set_name(smx_action_t action,char *name); XBT_PUBLIC(void) SIMIX_action_signal_all(smx_action_t action); XBT_PUBLIC(void) SIMIX_display_process_status(void); /************************** Comunication Handling *****************************/ diff --git a/src/simix/smx_action.c b/src/simix/smx_action.c index bbe3a040ca..a61c9230eb 100644 --- a/src/simix/smx_action.c +++ b/src/simix/smx_action.c @@ -101,7 +101,10 @@ smx_action_t SIMIX_action_execute(smx_host_t host, const char *name, /** \brief Creates a new sleep SIMIX action. * - * This function creates a SURF action and allocates the data necessary to create the SIMIX action. It can raise a host_error exception if the host crashed. The default SIMIX name of the action is "sleep". + * This function creates a SURF action and allocates the data necessary + * to create the SIMIX action. It can raise a host_error exception if the + * host crashed. The default SIMIX name of the action is "sleep". + * * \param host SIMIX host where the sleep will run. * \param duration Time duration of the sleep. * \return A new SIMIX action @@ -364,6 +367,11 @@ char *SIMIX_action_get_name(smx_action_t action) xbt_assert0((action != NULL), "Invalid parameter"); return action->name; } +/** @brief Change the name of the action. Warning, the string you provide is not strdup()ed */ +void SIMIX_action_set_name(smx_action_t action,char *name) +{ + action->name = name; +} void SIMIX_action_signal_all(smx_action_t action) { -- 2.20.1