-/** @brief Set or add an peer value to \a name within \a cfg
- *
- * @param cfg the config set
- * @param name the name of the variable
- * @param peer the peer
- * @param port the port number
- *
- * \e peer values are composed of a string (peername) and an integer (port)
- */
-
-void
-xbt_cfg_set_peer(xbt_cfg_t cfg, const char *name, const char *peer,
- int port)
-{
- xbt_cfgelm_t variable;
- xbt_peer_t val = xbt_peer_new(peer, port);
-
- XBT_VERB("Configuration setting: %s=%s:%d", name, peer, port);
-
- variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_peer);
-
- if (variable->max == 1) {
- if (variable->cb_rm && !xbt_dynar_is_empty(variable->content))
- variable->cb_rm(name, 0);
-
- xbt_dynar_set(variable->content, 0, &val);
- } else {
- if (variable->max
- && xbt_dynar_length(variable->content) == variable->max)
- THROWF(mismatch_error, 0,
- "Cannot add value %s:%d to the config element %s since it's already full (size=%d)",
- peer, port, name, variable->max);
-
- xbt_dynar_push(variable->content, &val);
- }
-
- if (variable->cb_set)
- variable->cb_set(name, xbt_dynar_length(variable->content) - 1);
- variable->isdefault = 0;
-}
-