From: degomme Date: Fri, 22 Jan 2016 14:40:15 +0000 (+0100) Subject: add missing call in host (available in MSG, used in lua) X-Git-Tag: v3_13~1129 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/5bf2cc80ee57d674f7f6c3660542643d0526780e?hp=a19a76028ffebbad449fee2b784a3ad6101c6295 add missing call in host (available in MSG, used in lua) --- diff --git a/include/simgrid/host.h b/include/simgrid/host.h index 282fa76291..5929ec66eb 100644 --- a/include/simgrid/host.h +++ b/include/simgrid/host.h @@ -61,7 +61,8 @@ XBT_PUBLIC(int) sg_host_get_nb_pstates(sg_host_t host); XBT_PUBLIC(int) sg_host_get_pstate(sg_host_t host); XBT_PUBLIC(void) sg_host_set_pstate(sg_host_t host,int pstate); XBT_PUBLIC(xbt_dict_t) sg_host_get_properties(sg_host_t host); - +XBT_PUBLIC(const char *) sg_host_get_property_value(sg_host_t host, + const char *name); SG_END_DECL() #endif /* SIMGRID_HOST_H_ */ diff --git a/src/simgrid/host.cpp b/src/simgrid/host.cpp index 8e527800f2..ab6de0edb2 100644 --- a/src/simgrid/host.cpp +++ b/src/simgrid/host.cpp @@ -159,3 +159,16 @@ xbt_dict_t sg_host_get_properties(sg_host_t host) { return host->properties(); } + +/** \ingroup m_host_management + * \brief Returns the value of a given host property + * + * \param host a host + * \param name a property name + * \return value of a property (or NULL if property not set) +*/ +const char *sg_host_get_property_value(sg_host_t host, const char *name) +{ + return (const char*) xbt_dict_get_or_null(sg_host_get_properties(host), name); +} +