X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/da2032381b4a55d6eadc23b8e2b01d5095b62903..164535529e5d19976ed96a2ee265d5945d27a660:/src/msg/msg_host.c diff --git a/src/msg/msg_host.c b/src/msg/msg_host.c index 6b518afd76..ce32fdf887 100644 --- a/src/msg/msg_host.c +++ b/src/msg/msg_host.c @@ -59,6 +59,25 @@ m_host_t __MSG_host_create(smx_host_t workstation, void *data) 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.