- xbt_cfgelm_t variable;
- unsigned int cpt;
- int seen;
-
- variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_int);
-
- if (xbt_dynar_length(variable->content) == variable->min)
- THROWF(mismatch_error, 0,
- "Cannot remove value %d from the config element %s since it's already at its minimal size (=%d)",
- val, name, variable->min);
-
- xbt_dynar_foreach(variable->content, cpt, seen) {
- if (seen == val) {
- if (variable->cb_rm)
- variable->cb_rm(name, cpt);
- xbt_dynar_cursor_rm(variable->content, &cpt);
- return;
- }
- }
-
- THROWF(not_found_error, 0,
- "Can't remove the value %d of config element %s: value not found.",
- val, name);
-}
-
-/** @brief Remove the provided \e val double value from a variable
- *
- * @param cfg the config set
- * @param name the name of the variable
- * @param val the value to be removed
- */
-
-void xbt_cfg_rm_double(xbt_cfg_t cfg, const char *name, double val)
-{
- xbt_cfgelm_t variable;
- unsigned int cpt;
- double seen;
-
- variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_double);
-
- if (xbt_dynar_length(variable->content) == variable->min)
- THROWF(mismatch_error, 0,
- "Cannot remove value %f from the config element %s since it's already at its minimal size (=%d)",
- val, name, variable->min);
-
- xbt_dynar_foreach(variable->content, cpt, seen) {
- if (seen == val) {
- xbt_dynar_cursor_rm(variable->content, &cpt);
- if (variable->cb_rm)
- variable->cb_rm(name, cpt);
- return;
- }
- }
-
- THROWF(not_found_error, 0,
- "Can't remove the value %f of config element %s: value not found.",
- val, name);
-}
-
-/** @brief Remove the provided \e val string value from a variable
- *
- * @param cfg the config set
- * @param name the name of the variable
- * @param val the value of the string which will be removed
- */
-void xbt_cfg_rm_string(xbt_cfg_t cfg, const char *name, const char *val)
-{
- xbt_cfgelm_t variable;
- unsigned int cpt;
- char *seen;
-
- variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_string);
-
- if (xbt_dynar_length(variable->content) == variable->min)
- THROWF(mismatch_error, 0,
- "Cannot remove value %s from the config element %s since it's already at its minimal size (=%d)",
- name, val, variable->min);
-
- xbt_dynar_foreach(variable->content, cpt, seen) {
- if (!strcpy(seen, val)) {
- if (variable->cb_rm)
- variable->cb_rm(name, cpt);
- xbt_dynar_cursor_rm(variable->content, &cpt);
- return;