#include "xbt/sysdep.h"
#include "xbt/log.h"
-/** \defgroup m_host_management Management functions of Hosts
- * \brief This section describes the host structure of MSG
- */
/** @addtogroup m_host_management
* \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Hosts" --> \endhtmlonly
* (#m_host_t) and the functions for managing it.
return host;
}
+/** \ingroup msg_host_management
+ * \brief Finds a m_host_t using its name.
+ *
+ * This is a name directory service
+ * \param name the name of an host.
+ * \return the corresponding host
+ */
+m_host_t MSG_get_host_by_name(const char *name)
+{
+ smx_host_t simix_h = NULL;
+ simix_h = simcall_host_get_by_name(name);
+
+ if (simix_h == NULL)
+ return NULL;
+
+ return (m_host_t) simcall_host_get_data(simix_h);
+}
+
+
/** \ingroup m_host_management
*
* \brief Set the user data of a #m_host_t.
/** \ingroup msg_gos_functions
* \brief Determine if a host is available.
*
- * \param h host to test
+ * \param host host to test
+ * \return Returns 1 if host is available, 0 otherwise
*/
-int MSG_host_is_avail(m_host_t h)
+int MSG_host_is_avail(m_host_t host)
{
- xbt_assert((h != NULL), "Invalid parameters (host is NULL)");
- return (simcall_host_get_state(h->simdata->smx_host));
+ xbt_assert((host != NULL), "Invalid parameters (host is NULL)");
+ return (simcall_host_get_state(host->simdata->smx_host));
}