/** * \brief Returns the value of a host property. * \param L a Lua state * \return number of values returned to Lua * * - Argument 1 (host): a host * - Argument 2 (string): name of the property to get * - Return value (string): the value of this property */ static int l_host_get_property_value(lua_State * L) { sg_host_t ht = sglua_check_host(L, 1); const char *prop = luaL_checkstring(L, 2); lua_pushstring(L, sg_host_get_property_value(ht,prop)); return 1; }
/** * \brief Returns the name of a host. * \param L a Lua state * \return number of values returned to Lua * * - Argument 1 (host): a host * - Return value (string): name of this host */ static int l_host_get_name(lua_State * L) { sg_host_t ht = sglua_check_host(L, 1); lua_pushstring(L, ht->cname()); return 1; }
/** * \brief Returns the name of a host. * \param L a Lua state * \return number of values returned to Lua * * - Argument 1 (host): a host * - Return value (string): name of this host */ static int l_host_get_name(lua_State * L) { msg_host_t ht = sglua_check_host(L, 1); lua_pushstring(L, MSG_host_get_name(ht)); return 1; }
/** * \brief Destroys a host. * \param L a Lua state * \return number of values returned to Lua * * - Argument 1 (host): the host to destroy */ static int l_host_destroy(lua_State *L) { msg_host_t ht = sglua_check_host(L, 1); __MSG_host_destroy(ht); return 0; }